Commit df53773c authored by Linus Torvalds's avatar Linus Torvalds

Fix page_address() to not re-evaluate its arguments

multiple times under certain circumstances.

This fixes svc_tcp_recvfrom().

Found by Ted Phelps <phelps@dstc.edu.au>
parent 71a17fca
...@@ -296,9 +296,10 @@ static inline void set_page_zone(struct page *page, unsigned long zone_num) ...@@ -296,9 +296,10 @@ static inline void set_page_zone(struct page *page, unsigned long zone_num)
page->flags |= zone_num << ZONE_SHIFT; page->flags |= zone_num << ZONE_SHIFT;
} }
#define lowmem_page_address(page) \ static inline void * lowmem_page_address(struct page *page)
__va( ( ((page) - page_zone(page)->zone_mem_map) \ {
+ page_zone(page)->zone_start_pfn) << PAGE_SHIFT) return __va( ( (page - page_zone(page)->zone_mem_map) + page_zone(page)->zone_start_pfn) << PAGE_SHIFT);
}
#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) #if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
#define HASHED_PAGE_VIRTUAL #define HASHED_PAGE_VIRTUAL
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment