mirror of
https://github.com/S3NEO/android_kernel_samsung_msm8226.git
synced 2024-11-07 03:47:13 +00:00
dsp: codecs: fix range check for audio buffer copying
The range checking for audio buffer copying in function "audio_in_write" is using the incorrect buffer size. Change it to the actual allocated audio buffer size. Change-Id: Ib7aaa2163c0d99161369eb85d09dc2d23d8c787b Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org> [haggertk: Backport to 3.4/msm8974] CVE-2019-2341 Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
This commit is contained in:
parent
66c27b00ee
commit
b3fb83770e
1 changed files with 2 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2010-2014, 2019 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
|
@ -614,8 +614,7 @@ ssize_t audio_in_write(struct file *file,
|
|||
__func__, audio->ac->session);
|
||||
}
|
||||
}
|
||||
xfer = (count > (audio->pcm_cfg.buffer_size)) ?
|
||||
(audio->pcm_cfg.buffer_size) : count;
|
||||
xfer = (count > size) ? size : count;
|
||||
|
||||
if (copy_from_user(cpy_ptr, buf, xfer)) {
|
||||
rc = -EFAULT;
|
||||
|
|
Loading…
Reference in a new issue