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:   Sun, 8 Jan 2023 16:51:26 +0200
From:   Oded Gabbay <ogabbay@...nel.org>
To:     Tom Rix <trix@...hat.com>
Cc:     gregkh@...uxfoundation.org, dliberman@...ana.ai,
        osharabi@...ana.ai, obitton@...ana.ai, talcohen@...ana.ai,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] habanalabs: remove redundant memset

On Sat, Jan 7, 2023 at 8:48 PM Tom Rix <trix@...hat.com> wrote:
>
> From reviewing the code, the line
>   memset(kdata, 0, usize);
> is not needed because kdata is either zeroed by
>   kdata = kzalloc(asize, GFP_KERNEL);
> when allocated at runtime or by
>   char stack_kdata[128] = {0};
> at compile time.
>
> Signed-off-by: Tom Rix <trix@...hat.com>
> ---
>  drivers/accel/habanalabs/common/habanalabs_ioctl.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/accel/habanalabs/common/habanalabs_ioctl.c b/drivers/accel/habanalabs/common/habanalabs_ioctl.c
> index 619d56c40b30..949d38527160 100644
> --- a/drivers/accel/habanalabs/common/habanalabs_ioctl.c
> +++ b/drivers/accel/habanalabs/common/habanalabs_ioctl.c
> @@ -1123,8 +1123,6 @@ static long _hl_ioctl(struct file *filep, unsigned int cmd, unsigned long arg,
>                         retcode = -EFAULT;
>                         goto out_err;
>                 }
> -       } else if (cmd & IOC_OUT) {
> -               memset(kdata, 0, usize);
>         }
>
>         retcode = func(hpriv, kdata);
> --
> 2.27.0
>

Reviewed-by: Oded Gabbay <ogabbay@...nel.org>
Applied to -next.

Thanks,
Oded

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ