android_kernel_samsung_msm8976/include/sound
Daniel Rosenberg 1d58fb16a8 ANDROID: sound: rawmidi: Hold lock around realloc
The SNDRV_RAWMIDI_STREAM_{OUTPUT,INPUT} ioctls may reallocate
runtime->buffer while other kernel threads are accessing it.  If the
underlying krealloc() call frees the original buffer, then this can turn
into a use-after-free.

Most of these accesses happen while the thread is holding runtime->lock,
and can be fixed by just holding the same lock while replacing
runtime->buffer, however we can't hold this spinlock while
snd_rawmidi_kernel_{read1,write1} are copying to/from userspace.  We
need to add and acquire a new mutex to prevent this from happening
concurrently with reallocation.  We hold this mutex during the entire
reallocation process, to also prevent multiple concurrent reallocations
leading to a double-free.

Signed-off-by: Daniel Rosenberg <drosen@google.com>
bug: 64315347
Change-Id: I05764d4f1a38f373eb7c0ac1c98607ee5ff0eded
2018-05-26 00:39:34 +02:00
..
ac97_codec.h Sound updates for 3.7-rc1 2012-10-09 07:07:14 +09:00
aci.h
ad1816a.h Sound updates for 3.7-rc1 2012-10-09 07:07:14 +09:00
ad1843.h
adau1373.h
adsp_err.h sound: adsp_err: initial version of adsp error code header file 2015-06-12 01:49:06 -07:00
aess.h ASoC: TI AESS: add autogating-enable function, callable from architecture code 2013-02-10 11:22:23 -07:00
ak4xxx-adda.h
ak4113.h ALSA: ak411x: Fix stall in work callback 2015-02-11 14:48:17 +08:00
ak4114.h ALSA: ak411x: Fix stall in work callback 2015-02-11 14:48:17 +08:00
ak4117.h
ak4531_codec.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
ak4641.h
alc5623.h
apr_audio-v2.h Import latest Samsung release 2017-04-18 03:43:52 +02:00
apr_audio.h msm: qdsp6v2: reorganize kernel driver under misc drivers. 2013-12-24 11:11:10 +05:30
asequencer.h UAPI: (Scripted) Disintegrate include/sound 2012-10-09 09:49:13 +01:00
asound.h UAPI: (Scripted) Disintegrate include/sound 2012-10-09 09:49:13 +01:00
asoundef.h ALSA: Add definitions for CEA-861 Audio InfoFrames 2012-04-18 08:00:36 +02:00
atmel-abdac.h
atmel-ac97c.h
audio_cal_utils.h ASoC: msm: qdsp6v2: Update calibration driver and voice driver 2014-08-21 18:24:24 -07:00
audio_calibration.h ASoC: qdsp6v2: Move calibration header files 2014-08-08 16:56:08 -07:00
audio_slimslave.h ASoC: msm: Add new slimbus slave driver 2013-12-18 13:52:15 -08:00
compress_driver.h ALSA: compress: Add support to send codec specific data 2015-08-10 08:55:22 +05:30
control.h ALSA: add/change some comments describing function return values 2013-03-12 08:32:53 +01:00
core.h Merge upstream tag 'v3.10.49' into msm-3.10 2014-08-20 13:23:09 -07:00
cpe_cmi.h ASoC: msm-cpe-lsm: Add support for openCPE 2015-10-14 11:34:32 +05:30
cpe_core.h ASoC: msm: Add support for HW MAD bypass feature for listen 2015-12-15 20:03:55 -08:00
cs42l52.h ASoC: Add support for CS42L52 Codec 2012-04-30 23:36:20 +01:00
cs4231-regs.h
cs4271.h ALSA: ASoC: cs4271: add optional soft reset workaround 2012-12-24 15:53:28 +00:00
cs8403.h
cs8427.h ASoC: msm: Moving the gpio request and free in probe and exit. 2013-09-04 15:34:44 -07:00
da7213.h ASoC: codecs: Add da7213 codec 2013-02-14 17:27:17 +00:00
da9055.h ASoC: codecs: Add DA9055 codec driver 2012-09-28 14:21:54 +01:00
designware_i2s.h ASoC: Add support for synopsys i2s controller as per ASoC framework. 2012-06-22 10:25:45 +01:00
dmaengine_pcm.h ASoC: generic-dmaengine-pcm: Add support for half-duplex 2013-04-22 11:27:04 +01:00
emu10k1.h ALSA: emu10k1: Emu10k2 32 bit DMA mode 2015-05-13 05:15:41 -07:00
emu10k1_synth.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
emu8000.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
emu8000_reg.h
emux_legacy.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
emux_synth.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
es1688.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
gus.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
hda_hwdep.h
hwdep.h
i2c.h
info.h ALSA: core: Add an API to create and register module 2015-07-22 05:04:09 -07:00
initval.h ALSA: isa: Move snd_legacy_find_free_ioport to initval.h 2012-08-03 12:57:44 +02:00
jack.h ALSA: jack: Add support to report second microphone 2014-01-13 17:21:41 -08:00
l3.h
max9768.h ASoC: max9768: add driver for max9768 amplifier 2012-01-30 21:50:55 +00:00
max98088.h
max98090.h ASoC:: max98090: Remove executable bit 2013-03-20 10:54:12 +01:00
max98095.h ASoC: max98095: Single bit bitfields should be unsigned 2012-05-13 23:33:53 +01:00
memalloc.h ALSA: memalloc.h - fix wrong truncation of dma_addr_t 2013-12-20 07:45:06 -08:00
minors.h ALSA: core: add support for compressed devices 2011-12-23 10:07:46 +01:00
mixer_oss.h
mpu401.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
msm-audio-effects-q6-v2.h ASoC: msm: audio-effects: fix stack overread and heap overwrite 2016-05-23 02:34:21 -07:00
msm-dai-q6-v2.h ASoC: Add support for senary capture TX dailink 2015-06-01 14:33:08 +05:30
msm-slim-dma.h ASoC: msm-cpe: Fix sequence for data channel teardown 2016-01-10 21:47:39 -08:00
opl3.h
opl4.h
pcm-indirect.h
pcm.h Merge "ALSA: pcm: use lock to protect substream runtime resource" 2018-01-22 19:30:03 -08:00
pcm_oss.h
pcm_params.h ALSA: Add missing include of pcm.h to pcm_params.h 2012-06-20 12:00:59 +02:00
pt2258.h
pxa2xx-lib.h
q6adm-v2.h Merge tag 'LA.BR.1.3.6-03910-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD 2017-05-26 13:28:48 +02:00
q6afe-v2.h ASoC: msm: add support for AVS 2.7 in native drivers 2016-11-14 18:46:24 +05:30
q6asm-v2.h Import latest Samsung release 2017-04-18 03:43:52 +02:00
q6audio-v2.h msm: qdsp6v2: reorganize kernel driver under misc drivers. 2013-12-24 11:11:10 +05:30
q6core.h ASoC: msm: qdsp6v2: Add support to query adsp version 2016-11-14 18:37:12 +05:30
q6lsm.h ASoC: msm-lsm-client: free lsm client data in msm_lsm_close 2015-12-24 01:53:33 -08:00
rawmidi.h ANDROID: sound: rawmidi: Hold lock around realloc 2018-05-26 00:39:34 +02:00
rt5659.h Import latest Samsung release 2017-04-18 03:43:52 +02:00
s3c24xx_uda134x.h
sb.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
sb16_csp.h UAPI: (Scripted) Disintegrate include/sound 2012-10-09 09:49:13 +01:00
seq_device.h
seq_kernel.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
seq_midi_emul.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
seq_midi_event.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
seq_oss.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
seq_oss_legacy.h
seq_virmidi.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
sh_dac_audio.h
sh_fsi.h ASoC: fsi: cleanup sh_fsi.h 2012-12-24 15:57:20 +00:00
simple_card.h ASoC: simple-card: add asoc_simple_dai for initializing 2013-01-14 06:55:43 +09:00
snd_wavefront.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
soc-dai.h ASoC: core: Add support for getting TX and RX channels 2013-09-04 17:23:43 -07:00
soc-dapm.h ASoC: wcd9320: Codec changes kernel 3.10 upgrade 2013-09-04 17:23:44 -07:00
soc-dpcm.h ASoC: Cold start latency reduction 2014-04-21 18:13:04 -07:00
soc.h ASoC: soc-core: export function to find codec 2015-10-14 01:44:09 -07:00
soundfont.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
spear_dma.h ASoC: Add support for SPEAr ASoC pcm layer. 2012-06-22 10:27:29 +01:00
spear_spdif.h ASoC: SPEAr spdif_in: Add spdif IN support 2012-06-23 11:58:10 +01:00
sta32x.h ASoC: sta32x: add workaround for ESD reset issue 2011-11-14 21:36:43 +00:00
tas5086.h ALSA: ASoC: add codec driver for TI TAS5086 2013-03-08 21:06:09 +08:00
tea575x-tuner.h [media] radio-shark: Add support for suspend & resume 2012-09-13 17:42:12 -03:00
tea6330t.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
timer.h
tlv.h ALSA: Add comment for control TLV API 2013-05-08 15:43:56 +02:00
tlv320aic3x.h ASoC: tlv320aic3x: Convert mic bias to a supply widget 2013-02-04 18:35:19 +00:00
tlv320aic32x4.h ASoC: tlv320aic32x4: Add rstn gpio to platform data. 2012-11-01 14:35:56 +00:00
tlv320dac33-plat.h
tpa6130a2-plat.h
uda134x.h
uda1380.h
util_mem.h
voice_params.h msm: ASoC: Implement local call hold 2013-09-04 16:39:00 -07:00
voice_svc.h msm: Add driver to communicate with voice services on DSP over APR 2014-04-11 02:57:58 -07:00
vx_core.h ALSA: vx: hard dependency on the standard fw loader 2012-11-22 17:48:01 +01:00
wavefront.h
wm0010.h ASoC: wm0010: Add initial wm0010 DSP driver 2012-08-23 16:12:12 +01:00
wm1250-ev1.h
wm2000.h ASoC: wm2000: Use clock API integration to configure MCLK divisor 2012-12-24 15:42:35 +00:00
wm2200.h ASoC: wm2200: Provide platform data for MICBIAS configuration 2013-02-05 15:53:07 +00:00
wm5100.h
wm8903.h ASoC: WM8903: Fix platform data gpio_cfg confusion 2011-12-06 10:29:22 +00:00
wm8904.h ASoC: wm8904: Correct number of EQ registers 2015-11-09 10:12:58 -08:00
wm8955.h
wm8960.h ASoC: wm8960: remove 'dres' field from platform data structure 2012-09-21 08:35:06 -04:00
wm8962.h ASoC: wm8962: Optimise power consumption for IN4 DC measurement usage 2012-01-24 21:19:45 +00:00
wm8993.h ASoC: wm_hubs: Allow configuration of MICBIAS power up delay via pdata 2012-08-22 19:00:37 +01:00
wm8996.h
wm9081.h
wm9090.h
wss.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00