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:   Thu, 23 Dec 2021 17:03:19 +0200
From:   Ville Syrjälä <ville.syrjala@...ux.intel.com>
To:     Simon Ser <contact@...rsion.fr>
Cc:     José Expósito <jose.exposito89@...il.com>,
        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

On Thu, Dec 23, 2021 at 01:42:32PM +0000, Simon Ser wrote:
> On Thursday, December 23rd, 2021 at 12:56, Ville Syrjälä <ville.syrjala@...ux.intel.com> wrote:
> 
> > > -	/* If we can't determine support, just bail */
> > > -	if (!plane->funcs->format_mod_supported)
> > > -		goto done;
> > > -
> > >  	mod = modifiers_ptr(blob_data);
> > >  	for (i = 0; i < plane->modifier_count; i++) {
> > >  		for (j = 0; j < plane->format_count; j++) {
> > > -			if (plane->funcs->format_mod_supported(plane,
> > > +			if (!plane->funcs->format_mod_supported ||
> > > +			    plane->funcs->format_mod_supported(plane,
> > >  							       plane->format_types[j],
> > >  							       plane->modifiers[i])) {
> >
> > So instead of skipping the whole loop you just skip doing anything
> > inside the loop? Can't see how that achieves anything at all.
> 
> No, the check is skipped when the function isn't populated by the driver.

Ah right. So we advertise all modifiers in that case. Looks like
drm_plane_check_pixel_format() does support that model, so seems OK.

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).

-- 
Ville Syrjälä
Intel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ