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, 8 Jan 2020 11:04:48 -0800
From:   Bjorn Andersson <bjorn.andersson@...aro.org>
To:     Rob Clark <robdclark@...il.com>, dri-devel@...ts.freedesktop.org,
        devicetree@...r.kernel.org, freedreno@...ts.freedesktop.org,
        linux-arm-msm@...r.kernel.org,
        Sharat Masetty <smasetty@...eaurora.org>,
        Rob Clark <robdclark@...omium.org>,
        Sean Paul <sean@...rly.run>, David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Douglas Anderson <dianders@...omium.org>,
        Brian Masney <masneyb@...tation.org>,
        Fabio Estevam <festevam@...il.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/3] drm/msm: support firmware-name for zap fw

On Wed 08 Jan 10:48 PST 2020, Jordan Crouse wrote:

> On Tue, Jan 07, 2020 at 05:38:42PM -0800, Rob Clark wrote:
> > From: Rob Clark <robdclark@...omium.org>
> > 
> > Since zap firmware can be device specific, allow for a firmware-name
> > property in the zap node to specify which firmware to load, similarly to
> > the scheme used for dsp/wifi/etc.
> > 
> > Signed-off-by: Rob Clark <robdclark@...omium.org>
> > ---
> >  drivers/gpu/drm/msm/adreno/adreno_gpu.c | 32 ++++++++++++++++++++++---
> >  1 file changed, 29 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> > index 112e8b8a261e..aa8737bd58db 100644
> > --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> > +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> > @@ -26,6 +26,7 @@ static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname,
> >  {
> >  	struct device *dev = &gpu->pdev->dev;
> >  	const struct firmware *fw;
> > +	const char *signed_fwname = NULL;
> >  	struct device_node *np, *mem_np;
> >  	struct resource r;
> >  	phys_addr_t mem_phys;
> > @@ -58,8 +59,33 @@ static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname,
> >  
> >  	mem_phys = r.start;
> >  
> > -	/* Request the MDT file for the firmware */
> > -	fw = adreno_request_fw(to_adreno_gpu(gpu), fwname);
> > +	/*
> > +	 * Check for a firmware-name property.  This is the new scheme
> > +	 * to handle firmware that may be signed with device specific
> > +	 * keys, allowing us to have a different zap fw path for different
> > +	 * devices.
> > +	 *
> > +	 * If the firmware-name property is found, we bypass the
> > +	 * adreno_request_fw() mechanism, because we don't need to handle
> > +	 * the /lib/firmware/qcom/* vs /lib/firmware/* case.
> > +	 *
> > +	 * If the firmware-name property is not found, for backwards
> > +	 * compatibility we fall back to the fwname from the gpulist
> > +	 * table.
> > +	 */
> > +	of_property_read_string_index(np, "firmware-name", 0, &signed_fwname);
> > +	if (signed_fwname) {
> > +		fwname = signed_fwname;
> > +		ret = request_firmware_direct(&fw, signed_fwname, gpu->dev->dev);
> > +		if (ret) {
> > +			DRM_DEV_ERROR(dev, "could not load signed zap firmware: %d\n", ret);
> > +			fw = ERR_PTR(ret);
> > +		}
> > +	} else {
> > +		/* Request the MDT file for the firmware */
> > +		fw = adreno_request_fw(to_adreno_gpu(gpu), fwname);
> > +	}
> > +
> 
> Since DT seems to be the trend for target specific firmware names I think we
> should plan to quickly deprecate the legacy name and not require new targets to
> set it. If a zap node is going to be opt in then it isn't onerous to ask
> the developer to set the additional property for each target platform.
> 

For the zap specifically I agree that it would be nice to require this
property, but for non-zap firmware it seems reasonable to continue with
the existing scheme.

Regards,
Bjorn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ