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]
Date:   Sat, 12 Mar 2022 05:41:42 +0700
From:   Ammar Faizi <ammarfaizi2@...il.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>, kbuild@...ts.01.org,
        Daniel Baluta <daniel.baluta@....com>
Cc:     lkp@...el.com, kbuild-all@...ts.01.org,
        GNU/Weeb Mailing List <gwml@...r.gnuweeb.org>,
        linux-kernel@...r.kernel.org, Mark Brown <broonie@...nel.org>
Subject: Re: [ammarfaizi2-block:broonie/sound/for-5.18 33/171]
 sound/soc/sof/compress.c:54 snd_sof_compr_fragment_elapsed() warn: variable
 dereferenced before check 'cstream' (see line 48)

On 3/12/22 1:59 AM, Dan Carpenter wrote:
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@...el.com>
> Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
> 
> New smatch warnings:
> sound/soc/sof/compress.c:54 snd_sof_compr_fragment_elapsed() warn: variable dereferenced before check 'cstream' (see line 48)
> 
> vim +/cstream +54 sound/soc/sof/compress.c
> 
> 858f7a5c45cacb Daniel Baluta 2021-10-04  46  void snd_sof_compr_fragment_elapsed(struct snd_compr_stream *cstream)
> 858f7a5c45cacb Daniel Baluta 2021-10-04  47  {
> 6324cf901e14c6 Daniel Baluta 2022-01-20 @48  	struct snd_soc_pcm_runtime *rtd = cstream->private_data;
>                                                                                    ^^^^^^^^^^^^^^^^^^^^^^
> 6324cf901e14c6 Daniel Baluta 2022-01-20  49  	struct snd_compr_runtime *crtd = cstream->runtime;
>                                                                                   ^^^^^^^^^^^^^^^^^
> Dereference
> 
> 858f7a5c45cacb Daniel Baluta 2021-10-04  50  	struct snd_soc_component *component;
> 6324cf901e14c6 Daniel Baluta 2022-01-20  51  	struct snd_compr_tstamp *tstamp;
> 858f7a5c45cacb Daniel Baluta 2021-10-04  52  	struct snd_sof_pcm *spcm;
> 858f7a5c45cacb Daniel Baluta 2021-10-04  53
> 858f7a5c45cacb Daniel Baluta 2021-10-04 @54  	if (!cstream)
>                                                      ^^^^^^^^
> Checked too late

Hi Dan,

Thanks for reporting, it has already been fixed in commit
    
   7e4bfcf10a03981 ("ASoC: SOF: compress: fix null check after dereference")

   Link: https://git.kernel.org/broonie/sound/c/7e4bfcf10a03981

Regards,
-- 
Ammar Faizi

Powered by blists - more mailing lists