Re: Hashed pointer issues

2018-05-03 Thread Geert Uytterhoeven
On Mon, Apr 30, 2018 at 7:06 PM, Randy Dunlap wrote: > On 04/30/2018 10:01 AM, Linus Torvalds wrote: >> On Mon, Apr 30, 2018 at 9:57 AM Linus Torvalds < >> torva...@linux-foundation.org> wrote: >> >>> Although in *practice* we'd have tons of entropy on any modern development >>> CPU too, since any

Re: Hashed pointer issues

2018-05-01 Thread tcharding
On Mon, Apr 30, 2018 at 05:12:05PM +, Linus Torvalds wrote: > On Mon, Apr 30, 2018 at 10:06 AM Randy Dunlap wrote: > > On 04/30/2018 10:01 AM, Linus Torvalds wrote: > > > > > > No kernel command line needed in practice any more. That's assuming any > > > kernel developer will have an IvyBridge

Re: Hashed pointer issues

2018-04-30 Thread Tobin C. Harding
On Mon, Apr 30, 2018 at 12:16:45PM -0700, Kees Cook wrote: > On Mon, Apr 30, 2018 at 12:00 PM, Linus Torvalds > wrote: > > On Mon, Apr 30, 2018 at 11:38 AM Kees Cook wrote: > > > >> Something like this? (Untested.) > > > > Looks workable. > > > >> + /* If we have hw RNG, start hashing immed

Re: Hashed pointer issues

2018-04-30 Thread Linus Torvalds
On Mon, Apr 30, 2018 at 1:01 PM Linus Torvalds < torva...@linux-foundation.org> wrote: > But if there are no actual users of get_random_bytes_arch(), maybe we can > just remove the fallback to the non-arch code, and add that return value > (and the __must_check()). Hmm. It is exported, so maybe t

Re: Hashed pointer issues

2018-04-30 Thread Linus Torvalds
On Mon, Apr 30, 2018 at 12:16 PM Kees Cook wrote: > I just noticed: there are _no_ users of get_random_bytes_arch() ... > didn't we once use it to feed entropy to the CRNG? We use arch_get_random_long() for that. See "crng_initialize()". But if there are no actual users of get_random_bytes_arch

Re: Hashed pointer issues

2018-04-30 Thread Kees Cook
On Mon, Apr 30, 2018 at 12:00 PM, Linus Torvalds wrote: > On Mon, Apr 30, 2018 at 11:38 AM Kees Cook wrote: > >> Something like this? (Untested.) > > Looks workable. > >> + /* If we have hw RNG, start hashing immediately. */ >> + if (arch_has_random()) { >> + get_random_

Re: Hashed pointer issues

2018-04-30 Thread Linus Torvalds
On Mon, Apr 30, 2018 at 11:38 AM Kees Cook wrote: > Something like this? (Untested.) Looks workable. > + /* If we have hw RNG, start hashing immediately. */ > + if (arch_has_random()) { > + get_random_bytes_arch(&ptr_key, sizeof(ptr_key)); > + ptr_key_rea

Re: Hashed pointer issues

2018-04-30 Thread Kees Cook
On Mon, Apr 30, 2018 at 10:01 AM, Linus Torvalds wrote: > On Mon, Apr 30, 2018 at 9:57 AM Linus Torvalds < > torva...@linux-foundation.org> wrote: > >> Although in *practice* we'd have tons of entropy on any modern development >> CPU too, since any new hardware will have the hardware random number

Re: Hashed pointer issues

2018-04-30 Thread Linus Torvalds
On Mon, Apr 30, 2018 at 10:06 AM Randy Dunlap wrote: > On 04/30/2018 10:01 AM, Linus Torvalds wrote: > > > > No kernel command line needed in practice any more. That's assuming any > > kernel developer will have an IvyBridge or newer. > any paid kernel developer :) I suspect a lot of hobbyists t

Re: Hashed pointer issues

2018-04-30 Thread Randy Dunlap
On 04/30/2018 10:01 AM, Linus Torvalds wrote: > On Mon, Apr 30, 2018 at 9:57 AM Linus Torvalds < > torva...@linux-foundation.org> wrote: > >> Although in *practice* we'd have tons of entropy on any modern development >> CPU too, since any new hardware will have the hardware random number >> genera

Re: Hashed pointer issues

2018-04-30 Thread Linus Torvalds
On Mon, Apr 30, 2018 at 9:57 AM Linus Torvalds < torva...@linux-foundation.org> wrote: > Although in *practice* we'd have tons of entropy on any modern development > CPU too, since any new hardware will have the hardware random number > generation. Some overly cautious person might not trust it, o

Re: Hashed pointer issues

2018-04-30 Thread Linus Torvalds
On Mon, Apr 30, 2018 at 9:41 AM Steven Rostedt wrote: > > > > And if we really want a command line option, can we make that still hash > > the pointer, just force the entropy early. That way kernel developers that > > test that command line option are still testing the *hashing*, they just > > ar

Re: Hashed pointer issues

2018-04-30 Thread Steven Rostedt
On Mon, 30 Apr 2018 16:31:52 + Linus Torvalds wrote: > On Mon, Apr 30, 2018 at 9:11 AM Kees Cook wrote: > > > I (or other folks?) had proposed this before, but, AIUI, Linus remains > > opposed. > > Yeah, I hate this, because it will make people paper over their problems by > just booting

Re: Hashed pointer issues

2018-04-30 Thread Linus Torvalds
On Mon, Apr 30, 2018 at 9:11 AM Kees Cook wrote: > I (or other folks?) had proposed this before, but, AIUI, Linus remains > opposed. Yeah, I hate this, because it will make people paper over their problems by just booting with that option. I think it should just be fixed. Is there really any r

Re: Hashed pointer issues

2018-04-30 Thread Kees Cook
On Mon, Apr 30, 2018 at 8:50 AM, Anna-Maria Gleixner wrote: > Hi, > > I stumbled over an issue with hashed pointers and tracing. > > I'm using trace points for examination and on error the trace buffers > are dumped. The error occurs when entropy has not been set up, so the > pointers are not hash

Hashed pointer issues

2018-04-30 Thread Anna-Maria Gleixner
Hi, I stumbled over an issue with hashed pointers and tracing. I'm using trace points for examination and on error the trace buffers are dumped. The error occurs when entropy has not been set up, so the pointers are not hashed and only (ptrval) is printed instead. The pointers are required to di