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, 2 Jun 2015 09:14:15 -0700
From:	John Stultz <john.stultz@...aro.org>
To:	Jiri Kosina <jkosina@...e.cz>
Cc:	Jiri Bohac <jbohac@...e.cz>, lkml <linux-kernel@...r.kernel.org>,
	Prarit Bhargava <prarit@...hat.com>,
	Daniel Bristot de Oliveira <bristot@...hat.com>,
	Richard Cochran <richardcochran@...il.com>,
	Jan Kara <jack@...e.cz>, Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	Shuah Khan <shuahkh@....samsung.com>
Subject: Re: [RFC][PATCH 3/4] ntp: Use printk_deferred in leapsecond path

On Tue, Jun 2, 2015 at 3:43 AM, Jiri Kosina <jkosina@...e.cz> wrote:
> On Tue, 2 Jun 2015, Jiri Bohac wrote:
>
>> > Looking over the leapsecond code, I noticed the printk messages
>> > reporting the leapsecond insertion in the second_overflow path
>> > were not using the printk_deferred method. This was surprising
>> > since the printk_deferred method was added in part to avoid
>> > printk-ing while holding the timekeeping locks.
>> >
>> > See 6d9bcb621b0b (timekeeping: use printk_deferred when holding
>> > timekeeping seqlock) for further rational.
>> >
>> > I can only guess that this omission was a git add -p oversight.
>>
>> second_overflow() is called from accumulate_nsecs_to_secs().
>>
>> accumulate_nsecs_to_secs() is called from update_wall_time()
>> - once directly
>> - once via logarithmic_accumulation()
>> Both calls are before write_seqcount_begin(&tk_core.seq).
>>
>> So it looks safe to use printk there.
>
> Couldn't we stuff a couple of
>
>         !lockdep_is_held()
>
> assertions into printk() so that we don't have to keep rediscovering this
> sort of problems over and over again?

Yea.  I was thinking if we could add something very early in printk
before we disable lockdep where we lockdep_aquire/release a few of the
locks we know printk might take, it would help close the gap on these
sorts of call paths that surprise us.

Lockdep is *such* a great tool, because it provides some confidence
that changes don't cause locking regressions, so to have printk poke a
hole in that confidence is frustrating.

thanks
-john
--
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