NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-alpha/57701: alpha kernel is built with RWX segment



Sorry, I responded from my phone last night, and wanted to add some additional context from a proper keyboard.

> On Nov 17, 2023, at 7:50 PM, campbell+netbsd%mumble.net@localhost wrote:
> 
>> Description:
> /space/tools/bin/../lib/gcc/alpha--netbsd/10.5.0/../../../../alpha--netbsd/bin/ld: warning: cc1 has a LOAD segment with RWX permissions

Notice my comment was about “cc1”, i.e. the C compiler back-end.  Not about the kernel.

> The kernel image should have finer-grained permissions so the CPU doesn't allow, e.g., writing to the text segment.

Doing this for the kernel image would be mostly just a waste of memory, because the kernel is loaded into and executed from K0SEG, which is a direct-mapped segment with no permission enforcement other than “not accessible from user mode".  The likelihood of *that* being changed is zero, so there’s no point in adding space between the sections to page-align them.

-- thorpej



Home | Main Index | Thread Index | Old Index