Re: [PATCH V9] RO/NX protection for loadable kernel modules

From: Siarhei Liakh
Date: Mon Feb 01 2010 - 17:48:26 EST


> But not compile tested:
[...]
> The casts here should cause a warning.

I did compile it prior to submission and the resulting kernel boots.
However, you are right about the warnings as they scrolled off the
screen when I did not pay attention.
Will fix.

>> +     if (total_size > text_size) {
>> +             begin_pfn = PFN_UP((unsigned long)base + text_size);
>> +             end_pfn = PFN_UP((unsigned long)base + total_size);
>> +             if (end_pfn > begin_pfn)
>> +                     set_memory_nx(begin_pfn << PAGE_SHIFT,
>> +                                             end_pfn - begin_pfn);
>
> Use the helper here too?

No, not really. The helper uses PFN_DUWN, and we need PFN_UP here.
This is the only place where I use PFN_UP, so another helper would not
make much sense.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/