aboutsummaryrefslogtreecommitdiff
path: root/scripts/gcc-plugins/sancov_plugin.c
diff options
context:
space:
mode:
authorTakashi Iwai <[email protected]>2020-03-09 09:21:48 +0100
committerTakashi Iwai <[email protected]>2020-03-09 09:22:22 +0100
commitf2ecf903ef06eb1bbbfa969db9889643d487e73a (patch)
tree6da14e501b136c80f46c2ffbd5135708a528cf71 /scripts/gcc-plugins/sancov_plugin.c
parent5a56996b0f13b9a5db0ca60528d13c661d37377a (diff)
ALSA: pcm: oss: Avoid plugin buffer overflow
Each OSS PCM plugins allocate its internal buffer per pre-calculation of the max buffer size through the chain of plugins (calling src_frames and dst_frames callbacks). This works for most plugins, but the rate plugin might behave incorrectly. The calculation in the rate plugin involves with the fractional position, i.e. it may vary depending on the input position. Since the buffer size pre-calculation is always done with the offset zero, it may return a shorter size than it might be; this may result in the out-of-bound access as spotted by fuzzer. This patch addresses those possible buffer overflow accesses by simply setting the upper limit per the given buffer size for each plugin before src_frames() and after dst_frames() calls. Reported-by: [email protected] Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
Diffstat (limited to 'scripts/gcc-plugins/sancov_plugin.c')
0 files changed, 0 insertions, 0 deletions