lkml.org 
[lkml]   [2023]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] /proc/modules: honor kptr_restrict even without CONFIG_KALLSYMS
On Sat, May 27, 2023, at 00:55, Aleksander Mazur wrote:
> Have you had a chance to review my patch?

I don't seem to have the original submission from you.

> Dnia 2022-06-05, o godz. 22:43:47
> Aleksander Mazur <deweloper@wp.pl> napisał(a):
>
>> Commit e4a8ca3baa55 fixed building without CONFIG_KALLSYMS by providing
>> dummy kallsyms_show_value(). Unfortunately -- due to hard-coded "false"
>> being returned -- access to addresses in /proc/modules became permanently
>> disabled.
>>
>> My proposal is to change this unconditional "false" to !kptr_restrict.
>> This re-enables addresses in /proc/modules even without CONFIG_KALLSYSMS
>> unless restricted by means of sysctl (kernel.kptr_restrict).

I just looked at the original 516fb7f2e73dc ("/proc/module: use the
same logic as /proc/kallsyms for address exposure") commit again,
the intention here was to use the same logic for /proc/modules
and /proc/kallsyms.

I agree that this means my patch went too far, but I'm not sure
about yours either. Maybe we can just move kallsyms_show_value()
into a different location that is always built and rename it
accordingly. Then it can be used by both kallsyms and /proc/modules
regardless of which combination of these two is enabled in the
kernel.

Arnd

\
 
 \ /
  Last update: 2023-05-27 11:45    [W:0.046 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site