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]
Message-ID: <20140917174647.GC19308@redhat.com>
Date:	Wed, 17 Sep 2014 19:46:47 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Roman Pen <r.peniaev@...il.com>
Cc:	Ming Lei <ming.lei@...onical.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [v2 PATCH 1/1] init: fix race between rootfs mount and
	firmware loading

On 09/17, Roman Pen wrote:
>
> +void wait_for_rootfs(void)
> +{
> +	/* Avoid waiting for ourselves */
> +	if (is_global_init(current))
> +		pr_warn("init: it is not a good idea to wait for the rootfs mount from the init task\n");
> +	else
> +		wait_event(rootfs_waitq, rootfs_mounted);
> +}

Well, this pr_warn() doesn't look very useful, how about

	if (WARN_ON((is_global_init(current))))
		return;

? this will show the caller.

> +static inline void wake_up_rootfs_waiters(void)
> +{
> +	rootfs_mounted = true;
> +	/* wake_up guarantees write memory barrier if and only if
> +	   there is a task to be woken up, it is not always true
> +	   for our case. */

Yes, but this doesn't matter. wait_event() takes care,

> +	smp_wmb();

so please remove this wmb() and the comment.

Oleg.

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