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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 15 Feb 2019 09:28:07 +0000
From:   Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To:     Bartosz Golaszewski <brgl@...ev.pl>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        stable@...r.kernel.org
Subject: Re: [PATCH] nvmem: core: fix the return value check when calling the
 notifier chain



On 14/02/2019 16:23, Bartosz Golaszewski wrote:
> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> index f7301bb4ef3b..a3bed2d9aec7 100644
> --- a/drivers/nvmem/core.c
> +++ b/drivers/nvmem/core.c
> @@ -687,7 +687,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
>   		goto err_remove_cells;
>   
>   	rval = blocking_notifier_call_chain(&nvmem_notifier, NVMEM_ADD, nvmem);
> -	if (rval)
> +	if (rval < 0)
>   		goto err_remove_cells;

rval will be masked with STOP MASK, so the above statement could be 
false even if we have error.
So you should consider returning an errono which can be understood by user:

may be something like this:

if (rval & NOTIFY_STOP_MASK) {
	rval = notifier_to_errno(rval);
	goto err_remove_cells
}


--srini

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ