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] [day] [month] [year] [list]
Message-ID: <wrljiogi3nturdsnevfdsxs3nuzrox7bimlvaqtyedxrfswsit@yawpecrjk7f2>
Date: Tue, 20 Jan 2026 15:47:43 -0800
From: David Box <david.e.box@...ux.intel.com>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: thomas.hellstrom@...ux.intel.com, rodrigo.vivi@...el.com, 
	irenic.rajneesh@...il.com, srinivas.pandruvada@...ux.intel.com, 
	intel-xe@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org, xi.pardee@...ux.intel.comn, 
	Hans de Goede <hansg@...nel.org>, LKML <linux-kernel@...r.kernel.org>, 
	platform-driver-x86@...r.kernel.org
Subject: Re: [PATCH 2/4] platform/x86/intel/vsec: Switch exported helpers
 from pci_dev to device

On Thu, Jan 15, 2026 at 03:08:09PM +0200, Ilpo Järvinen wrote:
> On Tue, 6 Jan 2026, David E. Box wrote:
> 
> > Preparatory refactor for ACPI-enumerated PMT endpoints. Several exported
> > PMT/VSEC interfaces and structs carried struct pci_dev * even though
> > callers only need a generic struct device. Move those to struct device * so
> > the same APIs work for PCI and ACPI parents.
> > 
> > Signed-off-by: David E. Box <david.e.box@...ux.intel.com>
> > ---
> >  drivers/gpu/drm/xe/xe_debugfs.c               |  2 +-
> >  drivers/gpu/drm/xe/xe_hwmon.c                 |  2 +-
> >  drivers/gpu/drm/xe/xe_vsec.c                  |  7 +-
> >  drivers/gpu/drm/xe/xe_vsec.h                  |  2 +-
> >  drivers/platform/x86/intel/pmc/core.c         |  4 +-
> >  .../platform/x86/intel/pmc/ssram_telemetry.c  |  2 +-
> >  drivers/platform/x86/intel/pmt/class.c        |  8 +-
> >  drivers/platform/x86/intel/pmt/class.h        |  4 +-
> >  drivers/platform/x86/intel/pmt/discovery.c    |  4 +-
> >  drivers/platform/x86/intel/pmt/telemetry.c    | 13 ++--
> >  drivers/platform/x86/intel/pmt/telemetry.h    | 11 ++-
> >  drivers/platform/x86/intel/sdsi.c             |  5 +-
> >  drivers/platform/x86/intel/vsec.c             | 74 +++++++++++--------
> >  drivers/platform/x86/intel/vsec_tpmi.c        |  6 +-
> >  include/linux/intel_vsec.h                    | 18 ++---
> >  15 files changed, 86 insertions(+), 76 deletions(-)
> > 
> 

...

> > @@ -630,7 +634,7 @@ static void intel_vsec_skip_missing_dependencies(struct pci_dev *pdev)
> >  
> >  static int intel_vsec_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> >  {
> > -	struct intel_vsec_platform_info *info;
> > +	struct intel_vsec_platform_info info, *info_temp;
> >  	struct vsec_priv *priv;
> >  	int num_caps, ret;
> >  	int run_once = 0;
> > @@ -641,22 +645,25 @@ static int intel_vsec_pci_probe(struct pci_dev *pdev, const struct pci_device_id
> >  		return ret;
> >  
> >  	pci_save_state(pdev);
> > -	info = (struct intel_vsec_platform_info *)id->driver_data;
> > -	if (!info)
> > +	info_temp = (struct intel_vsec_platform_info *)id->driver_data;
> > +	if (!info_temp)
> >  		return -EINVAL;
> >  
> > +	/* XXX: Needs better fix */
> > +	info = *info_temp;
> > +
> >  	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
> >  	if (!priv)
> >  		return -ENOMEM;
> >  
> > -	priv->info = info;
> > +	priv->info = &info;
> >  	pci_set_drvdata(pdev, priv);
> 
> What's going on here??? 'info' is a stack variable and you're taking 
> a pointer of it into priv/drvdata??

Oy vey. This chunk shouldn't even be here. It was part of an incomplete
refactor of code from heap to stack that I ended up dropping anyway.
Sorry for the noise. Ack on everything else. Thanks Ilpo.

David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ