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]
Message-ID: <9a684e939409ed298c69782581fda7f838d61545.camel@irl.hu>
Date: Thu, 02 Oct 2025 21:27:46 +0200
From: Gergo Koteles <soyer@....hu>
To: Shenghao Ding <shenghao-ding@...com>, tiwai@...e.de
Cc: broonie@...nel.org, andriy.shevchenko@...ux.intel.com,
  13564923607@....com, 13916275206@....com,
  alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
  baojun.xu@...com, Baojun.Xu@....com, stable@...r.kernel.org
Subject: Re: [PATCH v1] ALSA: hda/tas2781: Fix a potential race condition
 that causes a NULL pointer in case no efi.get_variable exsits

Cc: <stable@...r.kernel.org>

On Thu, 2025-09-11 at 15:11 +0800, Shenghao Ding wrote:
> A a potential race condition reported by one of my customers that leads to
> a NULL pointer dereference, where the call to efi.get_variable should be
> guarded with efi_rt_services_supported() to ensure that function exists.
> 
> Fixes: 4fe238513407 ("ALSA: hda/tas2781: Move and unified the calibrated-data getting function for SPI and I2C into the tas2781_hda lib")
> Signed-off-by: Shenghao Ding <shenghao-ding@...com>
> ---
>  sound/hda/codecs/side-codecs/tas2781_hda.c     | 5 +++++
>  sound/hda/codecs/side-codecs/tas2781_hda_i2c.c | 5 +++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/sound/hda/codecs/side-codecs/tas2781_hda.c b/sound/hda/codecs/side-codecs/tas2781_hda.c
> index 536940c78f00..96e6d82dc69e 100644
> --- a/sound/hda/codecs/side-codecs/tas2781_hda.c
> +++ b/sound/hda/codecs/side-codecs/tas2781_hda.c
> @@ -193,6 +193,11 @@ int tas2781_save_calibration(struct tas2781_hda *hda)
>  	efi_status_t status;
>  	int i;
>  
> +	if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) {
> +		dev_err(p->dev, "%s: NO EFI FOUND!\n", __func__);
> +		return -EINVAL;
> +	}
> +
>  	if (hda->catlog_id < LENOVO)
>  		efi_guid = tasdev_fct_efi_guid[hda->catlog_id];
>  
> diff --git a/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c b/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
> index 008dbe1490a7..4dea442d8c30 100644
> --- a/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
> +++ b/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
> @@ -317,6 +317,11 @@ static int tas2563_save_calibration(struct tas2781_hda *h)
>  	unsigned int attr;
>  	int ret, i, j, k;
>  
> +	if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) {
> +		dev_err(p->dev, "%s: NO EFI FOUND!\n", __func__);
> +		return -EINVAL;
> +	}
> +
>  	cd->cali_dat_sz_per_dev = TAS2563_CAL_DATA_SIZE * TASDEV_CALIB_N;
>  
>  	/* extra byte for each device is the device number */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ