grsecurity-2.9.1-2.6.32.60-201302202031 compilation problem

Discuss usability issues, general maintenance, and general support issues for a grsecurity-enabled system.

grsecurity-2.9.1-2.6.32.60-201302202031 compilation problem

Postby jorgus » Fri Feb 22, 2013 3:31 am

Hi,

I think there is a problem with the changes in mm/page_alloc.c introduced in grsecurity-2.9.1-2.6.32.60-201302202031.patch. When trying to compile 2.6.32.60 for x86 I get compilation errors:

mm/page_alloc.c: In function ‘pfn_to_bitidx’:
mm/page_alloc.c:4970: error: implicit declaration of function ‘round_down’
make[2]: *** [mm/page_alloc.o] Error 1

After comparing grsecurity-2.9.1-2.6.32.60-201302202031.patch with grsecurity-2.9.1-2.6.32.60-201302181144.patch it clearly looks that the following change is the culprit:

diff -u b/mm/page_alloc.c b/mm/page_alloc.c
--- b/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4964,7 +4967,7 @@
pfn &= (PAGES_PER_SECTION-1);
return (pfn >> pageblock_order) * NR_PAGEBLOCK_BITS;
#else
- pfn = pfn - zone->zone_start_pfn;
+ pfn = pfn - round_down(zone->zone_start_pfn, pageblock_nr_pages);
return (pfn >> pageblock_order) * NR_PAGEBLOCK_BITS;
#endif /* CONFIG_SPARSEMEM */
}

Diving deeper it seems that to trigger the error you need to set a different memory model than CONFIG_SPARSEMEM. This probably rules out amd64, where at least with my configs I see no other choice than sparse memory. Indeed I encountered the error in x86 kernel only, where the model was set to CONFIG_FLATMEM.
jorgus
 
Posts: 65
Joined: Wed Feb 20, 2008 9:50 pm

Re: grsecurity-2.9.1-2.6.32.60-201302202031 compilation prob

Postby spender » Fri Feb 22, 2013 8:16 am

Thanks for the report, I'll have this fixed in the next patch (I didn't catch it in my x86/x64 configurations).

-Brad
spender
 
Posts: 2185
Joined: Wed Feb 20, 2002 8:00 pm

Re: grsecurity-2.9.1-2.6.32.60-201302202031 compilation prob

Postby jorgus » Mon Feb 25, 2013 7:21 pm

I courteously confirm that grsecurity-2.9.1-2.6.32.60-201302222044.patch solved the problem. Thank you :)

--
Simon
jorgus
 
Posts: 65
Joined: Wed Feb 20, 2008 9:50 pm


Return to grsecurity support