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]
Message-ID: <20211223165706.GA11019@elementary>
Date:   Thu, 23 Dec 2021 17:57:06 +0100
From:   José Expósito <jose.exposito89@...il.com>
To:     Ville Syrjälä <ville.syrjala@...ux.intel.com>
Cc:     Simon Ser <contact@...rsion.fr>, airlied@...ux.ie,
        alexandre.torgue@...s.st.com, benjamin.gaignard@...aro.org,
        linux-stm32@...md-mailman.stormreply.com, marex@...x.de,
        linux-imx@....com, intel-gfx@...ts.freedesktop.org,
        tzimmermann@...e.de, s.hauer@...gutronix.de,
        rodrigo.vivi@...el.com, kernel@...gutronix.de,
        linux-arm-kernel@...ts.infradead.org,
        dri-devel@...ts.freedesktop.org, yannick.fertre@...s.st.com,
        linux-kernel@...r.kernel.org, philippe.cornu@...s.st.com,
        mcoquelin.stm32@...il.com, dmitry.baryshkov@...aro.org,
        shawnguo@...nel.org
Subject: Re: [PATCH v2 1/6] drm/plane: Make format_mod_supported truly optional

Thanks for your reviews :) I'll wait a couple of days to see
if somebody else wants to comment and I'll send v3 adding the
reviewed by tags and fixing the compiler warning.

On Thu, Dec 23, 2021 at 05:03:19PM +0200, Ville Syrjälä wrote:
> Another related thing that might be worth checking is whether
> drivers generally do anything to validate the modifiers in
> the addfb2 ioctl. Looks like i915 and amdgpu are the only ones
> to use drm_any_plane_has_format() for that, so all the other
> drivers must either be checking it manually (or they're just
> potentially broken when handed unexpected modifiers by evil
> userspace).

I'm pretty new to this subsystem, so please correct me if I'm 
wrong, but after looking into a couple of drivers I think you
are right, this check is missing in some drivers.

This possible bug reminds me of this ToDo task [1]:

> Many drivers wrap drm_gem_fb_create() only to check for valid formats. For
> atomic drivers we could check for valid formats by calling
> drm_plane_check_pixel_format() against all planes, and pass if any plane
> supports the format. For non-atomic that's not possible since like the format
> list for the primary plane is fake and we'd therefor reject valid formats.

I had a look to the Raspberry Pi driver (mainly because I'm trying
to understand it) and it looks like the check is missing. Other
drivers, for example Mali, are checking the format modifier manually.

I'll try to do some actual testing during Christmas and see
how it goes.

José Expósito

[1] https://www.kernel.org/doc/html/latest/gpu/todo.html#drm-framebuffer-funcs-and-drm-mode-config-funcs-fb-create-cleanup

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ