lkml.org 
[lkml]   [2018]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/dumpstack: fix address space casting in show_opcodes()
On Fri, Aug 31, 2018 at 03:26:24PM +0200, Jann Horn wrote:
>
> By the way, here are all 60 probe_kernel_read() callers:

...

> 41 of these (or something like that, I counted by hand) have some sort
> of cast in the call expression.
> probe_kernel_read() is kinda special in that expected types for the
> second argument are both kernel pointers and unsigned longs. It might
> make sense to have a wrapper macro around probe_kernel_read() that
> accepts anything as long as it's as wide as a pointer...

Well, if __user pointers should not be accepted, then it's much
better, typewisely, to leave it as const void * (and cast the
ulong args to some plain generic pointer, like void* or u8*).

-- Luc Van Oostenryck

\
 
 \ /
  Last update: 2018-08-31 16:38    [W:2.777 / U:0.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site