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: <a320ae82-24ce-4c0d-bae3-b14e43c1f512@gmx.de>
Date:   Wed, 8 Nov 2023 16:38:34 +0100
From:   Helge Deller <deller@....de>
To:     Arnd Bergmann <arnd@...nel.org>,
        "K. Y. Srinivasan" <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Wei Liu <wei.liu@...nel.org>, Dexuan Cui <decui@...rosoft.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Javier Martinez Canillas <javierm@...hat.com>,
        Arnd Bergmann <arnd@...db.de>
Cc:     kernel test robot <lkp@...el.com>,
        Dan Carpenter <dan.carpenter@...aro.org>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        Michael Kelley <mikelley@...rosoft.com>,
        "Guilherme G. Piccoli" <gpiccoli@...lia.com>,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        Dawei Li <set_pte_at@...look.com>,
        linux-hyperv@...r.kernel.org, linux-fbdev@...r.kernel.org,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fbdev: hyperv_fb: fix uninitialized local variable use

On 11/8/23 15:58, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> When CONFIG_SYSFB is disabled, the hyperv_fb driver can now run into
> undefined behavior on a gen2 VM, as indicated by this smatch warning:
>
> drivers/video/fbdev/hyperv_fb.c:1077 hvfb_getmem() error: uninitialized symbol 'base'.
> drivers/video/fbdev/hyperv_fb.c:1077 hvfb_getmem() error: uninitialized symbol 'size'.
>
> Since there is no way to know the actual framebuffer in this configuration,
> just return an allocation failure here, which should avoid the build
> warning and the undefined behavior.
>
> Reported-by: kernel test robot <lkp@...el.com>
> Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
> Closes: https://lore.kernel.org/r/202311070802.YCpvehaz-lkp@intel.com/
> Fixes: a07b50d80ab6 ("hyperv: avoid dependency on screen_info")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>

applied.

Thanks!
Helge


> ---
>   drivers/video/fbdev/hyperv_fb.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
> index bf59daf862fc..a80939fe2ee6 100644
> --- a/drivers/video/fbdev/hyperv_fb.c
> +++ b/drivers/video/fbdev/hyperv_fb.c
> @@ -1013,6 +1013,8 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
>   	} else if (IS_ENABLED(CONFIG_SYSFB)) {
>   		base = screen_info.lfb_base;
>   		size = screen_info.lfb_size;
> +	} else {
> +		goto err1;
>   	}
>
>   	/*

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ