[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YufJ4vQyAMkU9HBx@linutronix.de>
Date: Mon, 1 Aug 2022 14:41:06 +0200
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: "Jason A. Donenfeld" <Jason@...c4.com>
Cc: linux-kernel@...r.kernel.org,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
John Ogness <john.ogness@...utronix.de>,
Mike Galbraith <efault@....de>, Petr Mladek <pmladek@...e.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>,
Theodore Ts'o <tytso@....edu>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 2/2 v3] lib/vsprintf: Initialize vsprintf's pointer hash
once the random core is ready.
On 2022-08-01 14:36:48 [+0200], Jason A. Donenfeld wrote:
> > --- a/lib/vsprintf.c
> > +++ b/lib/vsprintf.c
> > @@ -751,31 +751,39 @@ static int __init debug_boot_weak_hash_e
> > early_param("debug_boot_weak_hash", debug_boot_weak_hash_enable);
> >
> > static bool filled_random_ptr_key;
> > +static siphash_key_t ptr_key __read_mostly;
> > +static void fill_ptr_key_workfn(struct work_struct *work);
> > +static DECLARE_DELAYED_WORK(fill_ptr_key_work, fill_ptr_key_workfn);
> > +
> > +static void fill_ptr_key_workfn(struct work_struct *work)
> > +{
> > + if (!rng_is_initialized()) {
> > + queue_delayed_work(system_unbound_wq, &fill_ptr_key_work, HZ * 2);
> > + return;
> > + }
>
> This seems kind of crazy and over-complex. You only need this on RT,
> right? Because of the raw lock issue? So just schedule it for the right
> time on RT and not elsewhere.
Then we have two code paths for RT and !RT and I would to avoid that
especially if it ends up as a user visible change.
And then there is lockdep which might yell on !RT if you acquire a
spinlock_t from context which won't work on RT.
> I'll send a more basic patch.
oki.
> Jason
Sebastian
Powered by blists - more mailing lists