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] [day] [month] [year] [list]
Date:   Thu, 27 Oct 2016 13:44:49 +0300
From:   Vasily Averin <vvs@...tuozzo.com>
To:     linux-kernel@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 2/2] notifiers: double register detection

Dear Andrew,
could you please pick up this patch?

It helps to detect double register of the same notifiers.
This kind of problem can lead to unexpected failures (some notifiers can be not called),
endless cycles, memory corruption or crashes.
Initially I've found such cases in OpenVZ kernels in our custom code,
then found similar bug in mainline nfsd (commit 1eca45f8)

On 21.09.2016 15:33, Vasily Averin wrote:
> WARN_ON should help to detect double register of the same notifiers
> 
> Signed-off-by: Vasily Averin <vvs@...tuozzo.com>
> ---
>  kernel/notifier.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/notifier.c b/kernel/notifier.c
> index fd2c9ac..e02b2f0 100644
> --- a/kernel/notifier.c
> +++ b/kernel/notifier.c
> @@ -22,6 +22,7 @@ static int notifier_chain_register(struct notifier_block **nl,
>  		struct notifier_block *n)
>  {
>  	while ((*nl) != NULL) {
> +		WARN_ON((*nl) == n);
>  		if (n->priority > (*nl)->priority)
>  			break;
>  		nl = &((*nl)->next);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ