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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 19 Dec 2018 16:10:11 +0200
From:   Oleksandr Andrushchenko <andr2000@...il.com>
To:     Gerd Hoffmann <kraxel@...hat.com>, dri-devel@...ts.freedesktop.org
Cc:     David Airlie <airlied@...ux.ie>,
        open list <linux-kernel@...r.kernel.org>,
        "open list:DRM DRIVER FOR BOCHS VIRTUAL GPU" 
        <virtualization@...ts.linux-foundation.org>
Subject: Re: [PATCH] drm/bochs: add edid present check

Hello, Gerd!

On 12/18/18 9:33 AM, Gerd Hoffmann wrote:
> Check first two header bytes before trying to read the edid blob,
> to avoid the log being spammed in case qemu has no edid support (old
> qemu or edid turned off).
>
> Fixes: 01f23459cf drm/bochs: add edid support.
> Signed-off-by: Gerd Hoffmann <kraxel@...hat.com>
> ---
>   drivers/gpu/drm/bochs/bochs_hw.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
> index c90a0d492f..f91e049625 100644
> --- a/drivers/gpu/drm/bochs/bochs_hw.c
> +++ b/drivers/gpu/drm/bochs/bochs_hw.c
> @@ -89,6 +89,10 @@ int bochs_hw_load_edid(struct bochs_device *bochs)
>   	if (!bochs->mmio)
>   		return -1;
>   

You could probably have a comment here explaining the magic below

(just like in the commit message to ease the task of understanding

while reading the code why 2 of 8 bytes of the EDID header is checked

and why it is all needed). Of course one can use git blame... Up to you

> +	if (readb(bochs->mmio + 0) != 0x00 ||
> +	    readb(bochs->mmio + 1) != 0xff)

bochs->mmio is defined as "void __iomem   *mmio;". Can we please avoid

void pointer arithmetic here?

> +		return -1;
> +
>   	kfree(bochs->edid);
>   	bochs->edid = drm_do_get_edid(&bochs->connector,
>   				      bochs_get_edid_block, bochs);

With the above fixed:

Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@...m.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ