mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: lyude@redhat.com
To: Slavin Liu <bolin.liu@seu.edu.cn>,
	dakr@kernel.org,  maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
	simona@ffwll.ch
Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/nouveau: validate required NET_img regions
Date: Mon, 14 Sep 2026 17:31:17 -0400	[thread overview]
Message-ID: <3bc92cd6aa88e52c2645b00b97c9d75a112b5d16.camel@redhat.com> (raw)
In-Reply-To: <20260913125228.110071-1-bolin.liu@seu.edu.cn>

Hi. What bug are you fixing here?

On Sun, 2026-09-13 at 20:52 +0800, Slavin Liu wrote:
> The NET_img parser can finish without all FECS and GPCCS regions.
> Reject missing required regions before computing their data
> addresses,
> and release the firmware on both validation and ACR loading failures.
> 
> Detected by static analysis and reviewed with AI-assisted source
> auditing.
> 
> Fixes: c4bdac754ca0 ("drm/nouveau/gr/ga102: initial support")
> Assisted-by: LLM
> Signed-off-by: Slavin Liu <bolin.liu@seu.edu.cn>
> ---
>  drivers/gpu/drm/nouveau/nvkm/engine/gr/ga102.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ga102.c
> b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ga102.c
> index 2b51f1d0c281..bfd1e00537b8 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ga102.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ga102.c
> @@ -317,6 +317,11 @@ ga102_gr_load(struct gf100_gr *gr, int ver,
> const struct gf100_gr_fwif *fwif)
>  		}
>  	}
>  
> +	if (!fecs_inst || !fecs_data || !gpccs_inst || !gpccs_data)
> {
> +		ret = -EINVAL;
> +		goto out_firmware;
> +	}
> +
>  	ret = nvkm_acr_lsfw_load_bl_sig_net(subdev, &gr-
> >fecs.falcon, NVKM_ACR_LSF_FECS,
>  					    "gr/fecs_", ver, fwif-
> >fecs,
>  					    fw->data + fecs_inst-
> >data_offset,
> @@ -324,7 +329,7 @@ ga102_gr_load(struct gf100_gr *gr, int ver, const
> struct gf100_gr_fwif *fwif)
>  					    fw->data + fecs_data-
> >data_offset,
>  						       fecs_data-
> >data_size);
>  	if (ret)
> -		return ret;
> +		goto out_firmware;
>  
>  	ret = nvkm_acr_lsfw_load_bl_sig_net(subdev, &gr-
> >gpccs.falcon, NVKM_ACR_LSF_GPCCS,
>  					    "gr/gpccs_", ver, fwif-
> >gpccs,
> @@ -333,12 +338,13 @@ ga102_gr_load(struct gf100_gr *gr, int ver,
> const struct gf100_gr_fwif *fwif)
>  					    fw->data + gpccs_data-
> >data_offset,
>  						       gpccs_data-
> >data_size);
>  	if (ret)
> -		return ret;
> +		goto out_firmware;
>  
>  	gr->firmware = true;
>  
> + out_firmware:
>  	nvkm_firmware_put(fw);
> -	return 0;
> +	return ret;
>  }
>  
>  static const struct gf100_gr_fwif


      reply	other threads:[~2026-09-14 21:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-13 12:52 Slavin Liu
2026-09-14 21:31 ` lyude [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3bc92cd6aa88e52c2645b00b97c9d75a112b5d16.camel@redhat.com \
    --to=lyude@redhat.com \
    --cc=airlied@gmail.com \
    --cc=bolin.liu@seu.edu.cn \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®