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:   Mon, 1 Mar 2021 11:53:01 +0300
From:   Sergei Shtylyov <sergei.shtylyov@...il.com>
To:     Wang Qing <wangqing@...o.com>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arch: mips: sibyte: Return -EFAULT if copy_to_user()
 fails

Hello!

On 01.03.2021 9:33, Wang Qing wrote:

> The copy_to_user() function returns the number of bytes remaining to be
> copied, but we want to return -EFAULT if the copy doesn't complete.

    Then 'err' is hardly a good name for that variable. :-)

> 
> Signed-off-by: Wang Qing <wangqing@...o.com>
> ---
>   arch/mips/sibyte/common/sb_tbprof.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/sibyte/common/sb_tbprof.c b/arch/mips/sibyte/common/sb_tbprof.c
> index f80d7a7..eac125f
> --- a/arch/mips/sibyte/common/sb_tbprof.c
> +++ b/arch/mips/sibyte/common/sb_tbprof.c
> @@ -465,7 +465,7 @@ static ssize_t sbprof_tb_read(struct file *filp, char *buf,
>   		if (err) {
>   			*offp = cur_off + cur_count - err;
>   			mutex_unlock(&sbp.lock);
> -			return err;
> +			return -EFAULT;
>   		}
>   		pr_debug(DEVNAME ": read from sample %d, %d bytes\n",
>   			 cur_sample, cur_count);

MBR, Sergei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ