* [PATCH][next][V2] drm/xe/xe_late_bind_fw: Fix missing initialization of variable offset
@ 2025-09-24 10:22 Colin Ian King
2025-09-25 12:04 ` Nilawar, Badal
0 siblings, 1 reply; 4+ messages in thread
From: Colin Ian King @ 2025-09-24 10:22 UTC (permalink / raw)
To: Lucas De Marchi, Thomas Hellström, Rodrigo Vivi,
David Airlie, Simona Vetter, Badal Nilawar,
Daniele Ceraolo Spurio, intel-xe, dri-devel
Cc: kernel-janitors, linux-kernel
The variable offset is not being initialized, and it is only set inside
a for-loop if entry->name is the same as manifest_entry. In the case
where it is not initialized a non-zero check on offset is potentialy checking
a bogus uninitalized value. Fix this by initializing offset to zero.
Fixes: efa29317a553 ("drm/xe/xe_late_bind_fw: Extract and print version info")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
V2: Fix identical issue in parse_lb_layout that I ommitted in the first
patch
---
drivers/gpu/drm/xe/xe_late_bind_fw.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_late_bind_fw.c b/drivers/gpu/drm/xe/xe_late_bind_fw.c
index 38f3feb2aecd..8f5082e689dc 100644
--- a/drivers/gpu/drm/xe/xe_late_bind_fw.c
+++ b/drivers/gpu/drm/xe/xe_late_bind_fw.c
@@ -60,7 +60,7 @@ static int parse_cpd_header(struct xe_late_bind_fw *lb_fw,
const struct gsc_manifest_header *manifest;
const struct gsc_cpd_entry *entry;
size_t min_size = sizeof(*header);
- u32 offset;
+ u32 offset = 0;
int i;
/* manifest_entry is mandatory */
@@ -116,7 +116,7 @@ static int parse_lb_layout(struct xe_late_bind_fw *lb_fw,
const struct csc_fpt_header *header = data;
const struct csc_fpt_entry *entry;
size_t min_size = sizeof(*header);
- u32 offset;
+ u32 offset = 0;
int i;
/* fpt_entry is mandatory */
--
2.51.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH][next][V2] drm/xe/xe_late_bind_fw: Fix missing initialization of variable offset
2025-09-24 10:22 [PATCH][next][V2] drm/xe/xe_late_bind_fw: Fix missing initialization of variable offset Colin Ian King
@ 2025-09-25 12:04 ` Nilawar, Badal
2025-09-29 15:49 ` Cavitt, Jonathan
0 siblings, 1 reply; 4+ messages in thread
From: Nilawar, Badal @ 2025-09-25 12:04 UTC (permalink / raw)
To: Colin Ian King, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, David Airlie, Simona Vetter, Daniele Ceraolo Spurio,
intel-xe, dri-devel
Cc: kernel-janitors, linux-kernel
On 24-09-2025 15:52, Colin Ian King wrote:
> The variable offset is not being initialized, and it is only set inside
> a for-loop if entry->name is the same as manifest_entry. In the case
> where it is not initialized a non-zero check on offset is potentialy checking
> a bogus uninitalized value. Fix this by initializing offset to zero.
>
> Fixes: efa29317a553 ("drm/xe/xe_late_bind_fw: Extract and print version info")
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Badal Nilawar <badal.nilawar@intel.com>
> ---
>
> V2: Fix identical issue in parse_lb_layout that I ommitted in the first
> patch
>
> ---
> drivers/gpu/drm/xe/xe_late_bind_fw.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_late_bind_fw.c b/drivers/gpu/drm/xe/xe_late_bind_fw.c
> index 38f3feb2aecd..8f5082e689dc 100644
> --- a/drivers/gpu/drm/xe/xe_late_bind_fw.c
> +++ b/drivers/gpu/drm/xe/xe_late_bind_fw.c
> @@ -60,7 +60,7 @@ static int parse_cpd_header(struct xe_late_bind_fw *lb_fw,
> const struct gsc_manifest_header *manifest;
> const struct gsc_cpd_entry *entry;
> size_t min_size = sizeof(*header);
> - u32 offset;
> + u32 offset = 0;
> int i;
>
> /* manifest_entry is mandatory */
> @@ -116,7 +116,7 @@ static int parse_lb_layout(struct xe_late_bind_fw *lb_fw,
> const struct csc_fpt_header *header = data;
> const struct csc_fpt_entry *entry;
> size_t min_size = sizeof(*header);
> - u32 offset;
> + u32 offset = 0;
> int i;
>
> /* fpt_entry is mandatory */
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH][next][V2] drm/xe/xe_late_bind_fw: Fix missing initialization of variable offset
2025-09-25 12:04 ` Nilawar, Badal
@ 2025-09-29 15:49 ` Cavitt, Jonathan
2025-09-30 14:32 ` Rodrigo Vivi
0 siblings, 1 reply; 4+ messages in thread
From: Cavitt, Jonathan @ 2025-09-29 15:49 UTC (permalink / raw)
To: Nilawar, Badal, Colin Ian King, De Marchi, Lucas,
Thomas Hellström, Vivi, Rodrigo, David Airlie, Simona Vetter,
Ceraolo Spurio, Daniele, intel-xe@lists.freedesktop.org,
dri-devel@lists.freedesktop.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
Cavitt, Jonathan
-----Original Message-----
From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Nilawar, Badal
Sent: Thursday, September 25, 2025 5:05 AM
To: Colin Ian King <colin.i.king@gmail.com>; De Marchi, Lucas <lucas.demarchi@intel.com>; Thomas Hellström <thomas.hellstrom@linux.intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com>; David Airlie <airlied@gmail.com>; Simona Vetter <simona@ffwll.ch>; Ceraolo Spurio, Daniele <daniele.ceraolospurio@intel.com>; intel-xe@lists.freedesktop.org; dri-devel@lists.freedesktop.org
Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next][V2] drm/xe/xe_late_bind_fw: Fix missing initialization of variable offset
>
> On 24-09-2025 15:52, Colin Ian King wrote:
> > The variable offset is not being initialized, and it is only set inside
> > a for-loop if entry->name is the same as manifest_entry. In the case
> > where it is not initialized a non-zero check on offset is potentialy checking
> > a bogus uninitalized value. Fix this by initializing offset to zero.
> >
> > Fixes: efa29317a553 ("drm/xe/xe_late_bind_fw: Extract and print version info")
> > Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
-Jonathan Cavitt
> > ---
> >
> > V2: Fix identical issue in parse_lb_layout that I ommitted in the first
> > patch
> >
> > ---
> > drivers/gpu/drm/xe/xe_late_bind_fw.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/xe/xe_late_bind_fw.c b/drivers/gpu/drm/xe/xe_late_bind_fw.c
> > index 38f3feb2aecd..8f5082e689dc 100644
> > --- a/drivers/gpu/drm/xe/xe_late_bind_fw.c
> > +++ b/drivers/gpu/drm/xe/xe_late_bind_fw.c
> > @@ -60,7 +60,7 @@ static int parse_cpd_header(struct xe_late_bind_fw *lb_fw,
> > const struct gsc_manifest_header *manifest;
> > const struct gsc_cpd_entry *entry;
> > size_t min_size = sizeof(*header);
> > - u32 offset;
> > + u32 offset = 0;
> > int i;
> >
> > /* manifest_entry is mandatory */
> > @@ -116,7 +116,7 @@ static int parse_lb_layout(struct xe_late_bind_fw *lb_fw,
> > const struct csc_fpt_header *header = data;
> > const struct csc_fpt_entry *entry;
> > size_t min_size = sizeof(*header);
> > - u32 offset;
> > + u32 offset = 0;
> > int i;
> >
> > /* fpt_entry is mandatory */
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][next][V2] drm/xe/xe_late_bind_fw: Fix missing initialization of variable offset
2025-09-29 15:49 ` Cavitt, Jonathan
@ 2025-09-30 14:32 ` Rodrigo Vivi
0 siblings, 0 replies; 4+ messages in thread
From: Rodrigo Vivi @ 2025-09-30 14:32 UTC (permalink / raw)
To: Cavitt, Jonathan
Cc: Nilawar, Badal, Colin Ian King, De Marchi, Lucas,
Thomas Hellström, David Airlie, Simona Vetter,
Ceraolo Spurio, Daniele, intel-xe@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
On Mon, Sep 29, 2025 at 11:49:24AM -0400, Cavitt, Jonathan wrote:
> -----Original Message-----
> From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Nilawar, Badal
> Sent: Thursday, September 25, 2025 5:05 AM
> To: Colin Ian King <colin.i.king@gmail.com>; De Marchi, Lucas <lucas.demarchi@intel.com>; Thomas Hellström <thomas.hellstrom@linux.intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com>; David Airlie <airlied@gmail.com>; Simona Vetter <simona@ffwll.ch>; Ceraolo Spurio, Daniele <daniele.ceraolospurio@intel.com>; intel-xe@lists.freedesktop.org; dri-devel@lists.freedesktop.org
> Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH][next][V2] drm/xe/xe_late_bind_fw: Fix missing initialization of variable offset
> >
> > On 24-09-2025 15:52, Colin Ian King wrote:
> > > The variable offset is not being initialized, and it is only set inside
> > > a for-loop if entry->name is the same as manifest_entry. In the case
> > > where it is not initialized a non-zero check on offset is potentialy checking
> > > a bogus uninitalized value. Fix this by initializing offset to zero.
> > >
> > > Fixes: efa29317a553 ("drm/xe/xe_late_bind_fw: Extract and print version info")
> > > Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> > Reviewed-by: Badal Nilawar <badal.nilawar@intel.com>
>
> Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
pushed to drm-xe-next. Thanks for the patch and reviews.
> -Jonathan Cavitt
>
> > > ---
> > >
> > > V2: Fix identical issue in parse_lb_layout that I ommitted in the first
> > > patch
> > >
> > > ---
> > > drivers/gpu/drm/xe/xe_late_bind_fw.c | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/xe/xe_late_bind_fw.c b/drivers/gpu/drm/xe/xe_late_bind_fw.c
> > > index 38f3feb2aecd..8f5082e689dc 100644
> > > --- a/drivers/gpu/drm/xe/xe_late_bind_fw.c
> > > +++ b/drivers/gpu/drm/xe/xe_late_bind_fw.c
> > > @@ -60,7 +60,7 @@ static int parse_cpd_header(struct xe_late_bind_fw *lb_fw,
> > > const struct gsc_manifest_header *manifest;
> > > const struct gsc_cpd_entry *entry;
> > > size_t min_size = sizeof(*header);
> > > - u32 offset;
> > > + u32 offset = 0;
> > > int i;
> > >
> > > /* manifest_entry is mandatory */
> > > @@ -116,7 +116,7 @@ static int parse_lb_layout(struct xe_late_bind_fw *lb_fw,
> > > const struct csc_fpt_header *header = data;
> > > const struct csc_fpt_entry *entry;
> > > size_t min_size = sizeof(*header);
> > > - u32 offset;
> > > + u32 offset = 0;
> > > int i;
> > >
> > > /* fpt_entry is mandatory */
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-09-30 14:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-24 10:22 [PATCH][next][V2] drm/xe/xe_late_bind_fw: Fix missing initialization of variable offset Colin Ian King
2025-09-25 12:04 ` Nilawar, Badal
2025-09-29 15:49 ` Cavitt, Jonathan
2025-09-30 14:32 ` Rodrigo Vivi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox