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]
Date:   Thu, 26 Apr 2018 14:50:23 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Baolin Wang <baolin.wang@...aro.org>
Cc:     kbuild test robot <lkp@...el.com>, kbuild-all@...org,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>,
        Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Takashi Sakamoto <o-takashi@...amocchi.jp>,
        Ingo Molnar <mingo@...nel.org>,
        SF Markus Elfring <elfring@...rs.sourceforge.net>,
        Dan Carpenter <dan.carpenter@...cle.com>, jeeja.kp@...el.com,
        Vinod Koul <vinod.koul@...el.com>,
        Guneshwor Singh <guneshwor.o.singh@...el.com>,
        subhransu.s.prusty@...el.com, Bhumika Goyal <bhumirks@...il.com>,
        gudishax.kranthikumar@...el.com, Naveen M <naveen.m@...el.com>,
        hardik.t.shah@...el.com, Arvind Yadav <arvind.yadav.cs@...il.com>,
        Fabian Frederick <fabf@...net.be>, alsa-devel@...a-project.org,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4/8] ALSA: Avoid using timespec for struct snd_pcm_status

On Thu, Apr 26, 2018 at 12:53 PM, Baolin Wang <baolin.wang@...aro.org> wrote:

>>
>>    971
>>    972  static int snd_pcm_status_user32(struct snd_pcm_substream *substream,
>>    973                                   struct snd_pcm_status32 __user * _status,
>>    974                                   bool ext)
>>    975  {
>>    976          struct snd_pcm_status64 status64;
>>    977          struct snd_pcm_status32 status32;
>>    978          int res;
>>    979
>>    980          memset(&status64, 0, sizeof(status64));
>>    981          memset(&status32, 0, sizeof(status32));
>>    982          /*
>>    983           * with extension, parameters are read/write,
>>    984           * get audio_tstamp_data from user,
>>    985           * ignore rest of status structure
>>    986           */
>>    987          if (ext && get_user(status64.audio_tstamp_data,
>>    988                              (u32 __user *)(&_status->audio_tstamp_data)))
>>    989                  return -EFAULT;
>>    990          res = snd_pcm_status64(substream, &status64);
>>    991          if (res < 0)
>>    992                  return res;
>>    993
>>    994          status32 = (struct snd_pcm_status32) {
>>  > 995                  .state = status64.state,
>>    996                  .trigger_tstamp_sec = status64.trigger_tstamp_sec,
>>    997                  .trigger_tstamp_nsec = status64.trigger_tstamp_nsec,
>>    998                  .tstamp_sec = status64.tstamp_sec,
>>    999                  .tstamp_nsec = status64.tstamp_nsec,
>>   1000                  .appl_ptr = status64.appl_ptr,
>>   1001                  .hw_ptr = status64.hw_ptr,
>>   1002                  .delay = status64.delay,
>>   1003                  .avail = status64.avail,
>>   1004                  .avail_max = status64.avail_max,
>>   1005                  .overrange = status64.overrange,
>>> 1006                  .suspended_state = status64.suspended_state,
>
> I am not sure for the warning here, we should change 'snd_pcm_state_t'
> to 's32' for struct snd_pcm_status64?
>
> typedef int __bitwise snd_pcm_state_t;

The problem is that snd_pcm_status32 uses 'u32' here instead of snd_pcm_state_t,
and the __bitwise annotation makes the two types incompatible. This is a
preexisting problem, the warning mail just appeared because you moved that
code to a different file.

If you want to avoid that warning, either use a type case with '__force',
or change the snd_pcm_status32 structure to also use snd_pcm_state_t.

That would be a useful change, but it should be separate from your
other changes since it's an unrelated problem.

      Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ