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:	Sat, 26 Jan 2008 10:50:17 +0100
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Christoph Hellwig <hch@...radead.org>,
	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
	Gregory Haskins <ghaskins@...ell.com>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Thomas Gleixner <tglx@...utronix.de>,
	Tim Bird <tim.bird@...sony.com>,
	Sam Ravnborg <sam@...nborg.org>,
	"Frank Ch. Eigler" <fche@...hat.com>,
	Jan Kiszka <jan.kiszka@...mens.com>,
	John Stultz <johnstul@...ibm.com>,
	Arjan van de Ven <arjan@...radead.org>,
	Pavel Machek <pavel@....cz>,
	Steven Rostedt <srostedt@...hat.com>
Subject: Re: [PATCH 01/23 -v6] printk - dont wakeup klogd with interrupts
	disabled


On Fri, 2008-01-25 at 23:21 -0500, Steven Rostedt wrote:

> @@ -1003,7 +1005,11 @@ void release_console_sem(void)
>  	console_locked = 0;
>  	up(&console_sem);
>  	spin_unlock_irqrestore(&logbuf_lock, flags);
> -	if (wake_klogd)
> +	/*
> +	 * If we try to wake up klogd while printing with the runqueue lock
> +	 * held, this will deadlock.
> +	 */
> +	if (wake_klogd && !runqueue_is_locked())
>  		wake_up_klogd();
>  }
>  EXPORT_SYMBOL(release_console_sem);

> +/**
> + * runqueue_is_locked
> + *
> + * Returns true if the current cpu runqueue is locked.
> + * This interface allows printk to be called with the runqueue lock
> + * held and know whether or not it is OK to wake up the klogd.
> + */
> +int runqueue_is_locked(void)
> +{
> +	int cpu = get_cpu();
> +	struct rq *rq = cpu_rq(cpu);
> +	int ret;
> +
> +	ret = spin_is_locked(&rq->lock);
> +	put_cpu();
> +	return ret;
> +}

Right, while this might appear to be sound, I hate to point out that we
only want to exclude it when current holds the rq->lock. This could lead
to spuriously missing klogd wakeups because other cpus hold our
rq->lock.

Now, is this klogd thing only relevant for dumping stuff into the log,
or also for writing stuff out to the serial line?

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