lkml.org 
[lkml]   [2017]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] printk: hash addresses printed with %p
On Tue, Oct 17, 2017 at 4:15 PM, Tobin C. Harding <me@tobin.cc> wrote:
> On Tue, Oct 17, 2017 at 09:31:19AM -0400, Steven Rostedt wrote:
>> On Tue, 17 Oct 2017 15:52:51 +1100
>> "Tobin C. Harding" <me@tobin.cc> wrote:
>>
>> > Currently there are many places in the kernel where addresses are being
>> > printed using an unadorned %p. Kernel pointers should be printed using
>> > %pK allowing some control via the kptr_restrict sysctl. Exposing addresses
>> > gives attackers sensitive information about the kernel layout in memory.
>> >
>> > We can reduce the attack surface by hashing all addresses printed with
>> > %p. This will of course break some users, forcing code printing needed
>> > addresses to be updated.
>> >
>> > For what it's worth, usage of unadorned %p can be broken down as follows
>> >
>> > git grep '%p[^KFfSsBRrbMmIiEUVKNhdDgCGO]' | wc -l
>>
>> Does %p[FfSs] leak addresses? Well, I guess it does if they are not
>> found in kallsyms, but otherwise you have:
>>
>> function+0x<offset>
>
> You are correct %pF and %pS print an offset. Does this provide an attack vector,
> I didn't think so but I'm no security expert. If they do then we need to amend
> those calls also.

They haven't traditionally been a big deal. If they turn out to be
problematic, we can deal with it then, IMO.

-Kees

--
Kees Cook
Pixel Security

\
 
 \ /
  Last update: 2017-10-22 17:06    [W:0.064 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site