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]
Message-ID: <CADnq5_M5jS2LNhH1im_KSgraTF3Z858PXTxvke45-7ZAnANOMA@mail.gmail.com>
Date:   Wed, 11 Aug 2021 16:15:27 -0400
From:   Alex Deucher <alexdeucher@...il.com>
To:     Tuo Li <islituo@...il.com>
Cc:     "Deucher, Alexander" <alexander.deucher@....com>,
        Christian Koenig <christian.koenig@....com>,
        xinhui pan <Xinhui.Pan@....com>,
        Dave Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        "Tuikov, Luben" <luben.tuikov@....com>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        Sam Ravnborg <sam@...nborg.org>,
        amd-gfx list <amd-gfx@...ts.freedesktop.org>,
        Maling list - DRI developers 
        <dri-devel@...ts.freedesktop.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Jia-Ju Bai <baijiaju1990@...il.com>,
        TOTE Robot <oslab@...nghua.edu.cn>
Subject: Re: [PATCH] gpu: drm: amd: amdgpu: amdgpu_i2c: fix possible
 uninitialized-variable access in amdgpu_i2c_router_select_ddc_port()

Applied.  Thanks!

Alex

On Wed, Aug 11, 2021 at 7:35 AM Tuo Li <islituo@...il.com> wrote:
>
> The variable val is declared without initialization, and its address is
> passed to amdgpu_i2c_get_byte(). In this function, the value of val is
> accessed in:
>   DRM_DEBUG("i2c 0x%02x 0x%02x read failed\n",
>        addr, *val);
>
> Also, when amdgpu_i2c_get_byte() returns, val may remain uninitialized,
> but it is accessed in:
>   val &= ~amdgpu_connector->router.ddc_mux_control_pin;
>
> To fix this possible uninitialized-variable access, initialize val to 0 in
> amdgpu_i2c_router_select_ddc_port().
>
> Reported-by: TOTE Robot <oslab@...nghua.edu.cn>
> Signed-off-by: Tuo Li <islituo@...il.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
> index bca4dddd5a15..82608df43396 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
> @@ -339,7 +339,7 @@ static void amdgpu_i2c_put_byte(struct amdgpu_i2c_chan *i2c_bus,
>  void
>  amdgpu_i2c_router_select_ddc_port(const struct amdgpu_connector *amdgpu_connector)
>  {
> -       u8 val;
> +       u8 val = 0;
>
>         if (!amdgpu_connector->router.ddc_valid)
>                 return;
> --
> 2.25.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ