Unverified Commit 7a073155 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!9037 fix CVE-2021-47509

Merge Pull Request from: @ci-robot 
 
PR sync from: Jialin Zhang <zhangjialin11@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/773VESBKEY64ARSZKRQJWG2ZI72PJTCB/ 
Takashi Iwai (2):
  ALSA: pcm: oss: Fix potential out-of-bounds shift
  ALSA: pcm: oss: Limit the period size to 16MB


-- 
2.25.1
 
https://gitee.com/src-openeuler/kernel/issues/I9S1ZV 
 
Link:https://gitee.com/openeuler/kernel/pulls/9037

 

Reviewed-by: default avatarLiu YongQiang <liuyongqiang13@huawei.com>
Reviewed-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
parents efc3f2d3 a3aceba0
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1962,11 +1962,15 @@ static int snd_pcm_oss_set_subdivide(struct snd_pcm_oss_file *pcm_oss_file, int
static int snd_pcm_oss_set_fragment1(struct snd_pcm_substream *substream, unsigned int val)
{
	struct snd_pcm_runtime *runtime;
	int fragshift;

	runtime = substream->runtime;
	if (runtime->oss.subdivision || runtime->oss.fragshift)
		return -EINVAL;
	runtime->oss.fragshift = val & 0xffff;
	fragshift = val & 0xffff;
	if (fragshift >= 25) /* should be large enough */
		return -EINVAL;
	runtime->oss.fragshift = fragshift;
	runtime->oss.maxfrags = (val >> 16) & 0xffff;
	if (runtime->oss.fragshift < 4)		/* < 16 */
		runtime->oss.fragshift = 4;