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:   Tue, 19 Oct 2021 16:33:20 -0400
From:   Alex Deucher <alexdeucher@...il.com>
To:     Qing Wang <wangqing@...o.com>
Cc:     Alex Deucher <alexander.deucher@....com>,
        Christian K├Ânig <christian.koenig@....com>,
        "Pan, Xinhui" <Xinhui.Pan@....com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        amd-gfx list <amd-gfx@...ts.freedesktop.org>,
        Maling list - DRI developers 
        <dri-devel@...ts.freedesktop.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] amdgpu: replace snprintf in show functions with sysfs_emit

Applied.  thanks!

On Fri, Oct 15, 2021 at 2:48 AM Qing Wang <wangqing@...o.com> wrote:
>
> show() must not use snprintf() when formatting the value to be
> returned to user space.
>
> Fix the following coccicheck warning:
> drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c:427:
> WARNING: use scnprintf or sprintf.
>
> Signed-off-by: Qing Wang <wangqing@...o.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
> index 2834981..faf4011 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
> @@ -424,7 +424,7 @@ static ssize_t show_##name(struct device *dev,                              \
>         struct drm_device *ddev = dev_get_drvdata(dev);                 \
>         struct amdgpu_device *adev = drm_to_adev(ddev);                 \
>                                                                         \
> -       return snprintf(buf, PAGE_SIZE, "0x%08x\n", adev->field);       \
> +       return sysfs_emit(buf, "0x%08x\n", adev->field);        \
>  }                                                                      \
>  static DEVICE_ATTR(name, mode, show_##name, NULL)
>
> --
> 2.7.4
>

Powered by blists - more mailing lists