未验证 提交 0a481a3e 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!541 fix CVE-2023-0266

Merge Pull Request from: @barry19901226 
 
fix CVE-2023-0266 
 
Link:https://gitee.com/openeuler/kernel/pulls/541 

Reviewed-by: Zucheng Zheng <zhengzucheng@huawei.com> 
Reviewed-by: Jialin Zhang <zhangjialin11@huawei.com> 
Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com> 
......@@ -304,7 +304,9 @@ static int ctl_elem_read_user(struct snd_card *card,
err = snd_power_wait(card, SNDRV_CTL_POWER_D0);
if (err < 0)
goto error;
down_read(&card->controls_rwsem);
err = snd_ctl_elem_read(card, data);
up_read(&card->controls_rwsem);
if (err < 0)
goto error;
err = copy_ctl_value_to_user(userdata, valuep, data, type, count);
......@@ -332,7 +334,9 @@ static int ctl_elem_write_user(struct snd_ctl_file *file,
err = snd_power_wait(card, SNDRV_CTL_POWER_D0);
if (err < 0)
goto error;
down_write(&card->controls_rwsem);
err = snd_ctl_elem_write(card, file, data);
up_write(&card->controls_rwsem);
if (err < 0)
goto error;
err = copy_ctl_value_to_user(userdata, valuep, data, type, count);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册