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:	Wed, 02 Jul 2014 16:13:59 +0200
From:	Lars-Peter Clausen <lars@...afoo.de>
To:	Takashi Iwai <tiwai@...e.de>
CC:	Peter Ujfalusi <peter.ujfalusi@...com>,
	alsa-devel@...a-project.org, vinod.koul@...el.com, nsekhar@...com,
	Liam Girdwood <lgirdwood@...il.com>,
	linux-kernel@...r.kernel.org, joelf@...com,
	Mark Brown <broonie@...nel.org>, dmaengine@...r.kernel.org,
	dan.j.williams@...el.com
Subject: Re: [alsa-devel] [PATCH v2 3/5] ASoC: generic-dmaengine-pcm: Prepare
 formats mask for valid physical sample sizes

On 07/02/2014 04:12 PM, Takashi Iwai wrote:
> At Wed, 02 Jul 2014 16:10:09 +0200,
> Lars-Peter Clausen wrote:
>>
>> On 07/02/2014 03:47 PM, Takashi Iwai wrote:
>> [...]
>>>> +	/*
>>>> +	 * Prepare formats mask for valid/allowed sample types. If the dma does
>>>> +	 * not have support for the given physical word size, it needs to be
>>>> +	 * masked out so user space can not use the format which produces
>>>> +	 * corrupted audio.
>>>> +	 * In case the dma driver does not implement the slave_caps the default
>>>> +	 * assumption is that it supports 1, 2 and 4 bytes widths.
>>>> +	 */
>>>> +	for (i = 0; i <= SNDRV_PCM_FORMAT_LAST; i++) {
>>>> +		int bits = snd_pcm_format_physical_width(i);
>>>
>>> Better to add a negative value check.  Some formats return -EINVAL.
>>>
>>
>> So what should we do with those formats? Not support them?
>
> Yes, these are special formats that can't be handled generically.
>

Looking through the list in pcm_misc.c there are also some formats where the 
physical width is not a multiple of 8. We should probably also skip those.

- Lars

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ