lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 1 Feb 2011 22:08:40 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	John Stultz <john.stultz@...aro.org>
cc:	LKML <linux-kernel@...r.kernel.org>,
	Richard Cochran <richard.cochran@...cron.at>,
	Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <peterz@...radead.org>
Subject: Re: [patch 07/28] posix-timers: Convert clock_nanosleep_restart to
 clockid_to_kclock()

On Tue, 1 Feb 2011, Thomas Gleixner wrote:
> On Tue, 1 Feb 2011, John Stultz wrote:
> 
> > On Tue, 2011-02-01 at 13:51 +0000, Thomas Gleixner wrote:
> > > plain text document attachment
> > > (posix-timers-convert-nanosleep-restart.patch)
> > > Use the new kclock decoding function in clock_nanosleep_restart. No
> > > need to check kclock here as the restart block always contains a valid
> > > clockid. If not, we are in serious trouble anyway.
> > > 
> > > Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> > > Cc: John Stultz <john.stultz@...aro.org>
> > > Cc: Richard Cochran <richard.cochran@...cron.at>
> > 
> > One nit.
> > 
> > > -long
> > > -clock_nanosleep_restart(struct restart_block *restart_block)
> > > +long clock_nanosleep_restart(struct restart_block *restart_block)
> > >  {
> > >  	clockid_t which_clock = restart_block->arg0;
> > > +	struct k_clock *kc = clockid_to_kclock(which_clock);
> > > 
> > > -	return CLOCK_DISPATCH(which_clock, nsleep_restart,
> > > -			      (restart_block));
> > > +	return kc->nsleep_restart(restart_block);
> > >  }
> > 
> > 
> > Should you be checking if kc is null before dereferencing? Or am I being
> > overly paranoid?
> 
> See changelog. If we get a corrupted restart_block then checking kc is
> probably the least of our worries.

Ok, I'll add the checks for nsleep_restart and timer_get/set/del, but
I make them a WARN_ON_ONCE() as this is serious data corruption in the
kernel.

Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ