summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-04-19ALSA: rawmidi: Fix missing input substream checks in compat ioctlssound-4.17-rc2Takashi Iwai1-6/+12
Some rawmidi compat ioctls lack of the input substream checks (although they do check only for rfile->output). This many eventually lead to an Oops as NULL substream is passed to the rawmidi core functions. Fix it by adding the proper checks before each function call. The bug was spotted by syzkaller. Reported-by: syzbot+f7a0348affc3b67bc617@syzkaller.appspotmail.com Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-19ALSA: hda/realtek - adjust the location of one micHui Wang1-0/+1
There are two front mics on this machine, if we don't adjust the location for one of them, they will have the same mixer name, pulseaudio can't handle this situation. After applying this FIXUP, they will have different mixer name, then pulseaudio can handle them correctly. Cc: <stable@vger.kernel.org> Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-19ALSA: hda/realtek - set PINCFG_HEADSET_MIC to parse_flagsHui Wang1-0/+2
Otherwise, the pin will be regarded as microphone, and the jack name is "Mic Phantom", it is always on in the pulseaudio even nothing is plugged into the jack. So the UI is confusing to users since the microphone always shows up in the UI even there is no microphone plugged. After adding this flag, the jack name is "Headset Mic Phantom", then the pulseaudio can handle its detection correctly. Fixes: f0ba9d699e5c ("ALSA: hda/realtek - Fix Dell headset Mic can't record") Cc: <stable@vger.kernel.org> Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-16ALSA: hda - New VIA controller suppor no-snoop pathDavid Wang1-1/+2
This patch is used to tell kernel that new VIA HDAC controller also support no-snoop path. [ minor coding style fix by tiwai ] Signed-off-by: David Wang <davidwang@zhaoxin.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-12ALSA: line6: Use correct endpoint type for midi outputFabián Inostroza1-1/+1
Sending MIDI messages to a PODxt through the USB connection shows "usb_submit_urb failed" in dmesg and the message is not received by the POD. The error is caused because in the funcion send_midi_async() in midi.c there is a call to usb_sndbulkpipe() for endpoint 3 OUT, but the PODxt USB descriptor shows that this endpoint it's an interrupt endpoint. Patch tested with PODxt only. [ The bug has been present from the very beginning in the staging driver time, but Fixes below points to the commit moving to sound/ directory so that the fix can be cleanly applied -- tiwai ] Fixes: 61864d844c29 ("ALSA: move line6 usb driver into sound/usb") Signed-off-by: Fabián Inostroza <fabianinostroza@udec.cl> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-09ALSA: pcm: Remove WARN_ON() at snd_pcm_hw_params() errorsound-fix-4.17-rc1Takashi Iwai1-1/+1
snd_pcm_hw_params() (more exactly snd_pcm_hw_params_choose()) contains a check of the return error from snd_pcm_hw_param_first() and _last() with snd_BUG_ON() -- i.e. it may trigger WARN_ON() depending on the kconfig. This was a valid check in the past, as these functions shouldn't return any error if the parameters have been already refined via snd_pcm_hw_refine() beforehand. However, the recent rewrite introduced a kmalloc() in snd_pcm_hw_refine() for removing VLA, and this brought a possibility to trigger an error. As a result, syzbot caught lots of superfluous kernel WARN_ON() and paniced via fault injection. As the WARN_ON() is no longer valid with the introduction of kmalloc(), let's drop snd_BUG_ON() check, in order to make the world peaceful place again. Reported-by: syzbot+803e0047ac3a3096bb4f@syzkaller.appspotmail.com Fixes: 5730f9f744cf ("ALSA: pcm: Remove VLA usage") Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-07ALSA: pcm: Fix endless loop for XRUN recovery in OSS emulationTakashi Iwai1-2/+3
The commit 02a5d6925cd3 ("ALSA: pcm: Avoid potential races between OSS ioctls and read/write") split the PCM preparation code to a locked version, and it added a sanity check of runtime->oss.prepare flag along with the change. This leaded to an endless loop when the stream gets XRUN: namely, snd_pcm_oss_write3() and co call snd_pcm_oss_prepare() without setting runtime->oss.prepare flag and the loop continues until the PCM state reaches to another one. As the function is supposed to execute the preparation unconditionally, drop the invalid state check there. The bug was triggered by syzkaller. Fixes: 02a5d6925cd3 ("ALSA: pcm: Avoid potential races between OSS ioctls and read/write") Reported-by: syzbot+150189c103427d31a053@syzkaller.appspotmail.com Reported-by: syzbot+7e3f31a52646f939c052@syzkaller.appspotmail.com Reported-by: syzbot+4f2016cf5185da7759dc@syzkaller.appspotmail.com Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-07ALSA: usb-audio: Add sanity checks in UAC3 clock parsersTakashi Iwai1-3/+4
The UAC3 clock parser codes lack of the sanity checks for malformed descriptors like UAC2 parser does. Without it, the driver may lead to a potential crash. Fixes: 9a2fe9b801f5 ("ALSA: usb: initial USB Audio Device Class 3.0 support") Tested-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> Reviewed-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-07ALSA: usb-audio: More strict sanity checks for clock parsersTakashi Iwai1-3/+3
The sanity checks introduced for malformed descriptors loosely check the given descriptor size, although the size greater than the defined description is invalid. It was due to a concern of any funky firmware in the actual products. But this doesn't look hitting, and any sane products must have the defined descriptors. So in this patch, we make the validators more strict, allowing only with the defined descriptor sizes. The value in clock selector validator is corrected from 5 to 7 to count the two unlisted fields after baCSourceID[]. Suggested-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> Reviewed-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-07ALSA: usb-audio: Refactor clock finder helpersTakashi Iwai1-74/+53
There are lots of open-coded functions to find a clock source, selector and multiplier. Now there are both v2 and v3, so six variants. This patch refactors the code to use a common helper for the main loop, and define each validator function for each target. There is no functional change. Fixes: 9a2fe9b801f5 ("ALSA: usb: initial USB Audio Device Class 3.0 support") Reviewed-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-03ALSA: pcm: Fix UAF at PCM release via PCM timer accesssound-4.17-rc1Takashi Iwai1-1/+7
The PCM runtime object is created and freed dynamically at PCM stream open / close time. This is tracked via substream->runtime, and it's cleared at snd_pcm_detach_substream(). The runtime object assignment is protected by PCM open_mutex, so for all PCM operations, it's safely handled. However, each PCM substream provides also an ALSA timer interface, and user-space can access to this while closing a PCM substream. This may eventually lead to a UAF, as snd_pcm_timer_resolution() tries to access the runtime while clearing it in other side. Fortunately, it's the only concurrent access from the PCM timer, and it merely reads runtime->timer_resolution field. So, we can avoid the race by reordering kfree() and wrapping the substream->runtime clearance with the corresponding timer lock. Reported-by: syzbot+8e62ff4e07aa2ce87826@syzkaller.appspotmail.com Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-02Merge tag 'asoc-v4.17' of ↵Takashi Iwai985-25650/+32364
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v4.17 This is a *very* big release for ASoC. Not much change in the core but there s the transition of all the individual drivers over to components which is intended to support further core work. The goal is to make it easier to do further core work by removing the need to special case all the different driver classes in the core, many of the devices end up being used in multiple roles in modern systems. We also have quite a lot of new drivers added this month of all kinds, quite a few for simple devices but also some more advanced ones with more substantial code. - The biggest thing is the huge series from Morimoto-san which converted everything over to components. This is a huge change by code volume but was fairly mechanical - Many fixes for some of the Realtek based Baytrail systems covering both the CODECs and the CPUs, contributed by Hans de Goode. - Lots of cleanups for Samsung based Odroid systems from Sylwester Nawrocki. - The Freescale SSI driver also got a lot of cleanups from Nicolin Chen. - The Blackfin drivers have been removed as part of the removal of the architecture. - New drivers for AKM AK4458 and AK5558, several AMD based machines, several Intel based machines, Maxim MAX9759, Motorola CPCAP, Socionext Uniphier SoCs, and TI PCM1789 and TDA7419
2018-04-02Merge branch 'for-next' into for-linusTakashi Iwai35-473/+1853
Preparation for 4.17 merge. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-29ALSA: usb-audio: silence a static checker warningDan Carpenter1-1/+1
We recently made "format" a u64 variable so now static checkers complain that this shift will wrap around if format is more than 31. I don't think it makes a difference for runtime, but it's simple to silence the warning. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-28Merge remote-tracking branch 'asoc/topic/zx_aud96p22' into asoc-nextMark Brown1-17/+18
2018-03-28Merge remote-tracking branches 'asoc/topic/wm9090', 'asoc/topic/wm9712', ↵Mark Brown5-75/+87
'asoc/topic/wm9713' and 'asoc/topic/wm_adsp' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/wm8991', 'asoc/topic/wm8994', ↵Mark Brown13-1369/+1342
'asoc/topic/wm8995', 'asoc/topic/wm8996' and 'asoc/topic/wm9081' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/wm8978', 'asoc/topic/wm8983', ↵Mark Brown5-457/+405
'asoc/topic/wm8985', 'asoc/topic/wm8988' and 'asoc/topic/wm8990' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/wm8960', 'asoc/topic/wm8961', ↵Mark Brown7-582/+564
'asoc/topic/wm8962', 'asoc/topic/wm8971' and 'asoc/topic/wm8974' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/wm8900', 'asoc/topic/wm8903', ↵Mark Brown7-599/+576
'asoc/topic/wm8904', 'asoc/topic/wm8940' and 'asoc/topic/wm8955' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/wm8753', 'asoc/topic/wm8770', ↵Mark Brown5-344/+308
'asoc/topic/wm8776', 'asoc/topic/wm8782' and 'asoc/topic/wm8804' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/wm8728', 'asoc/topic/wm8731', ↵Mark Brown5-299/+241
'asoc/topic/wm8737', 'asoc/topic/wm8741' and 'asoc/topic/wm8750' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/wm8523', 'asoc/topic/wm8524', ↵Mark Brown6-246/+205
'asoc/topic/wm8580', 'asoc/topic/wm8711' and 'asoc/topic/wm8727' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/wm2200', 'asoc/topic/wm5100', ↵Mark Brown9-511/+473
'asoc/topic/wm8350', 'asoc/topic/wm8400' and 'asoc/topic/wm8510' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/vc4_hdmi', 'asoc/topic/wl1273', ↵Mark Brown6-228/+200
'asoc/topic/wm0010', 'asoc/topic/wm1250-ev1' and 'asoc/topic/wm2000' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/twl4030', 'asoc/topic/twl6040', ↵Mark Brown18-522/+4622
'asoc/topic/uda134x', 'asoc/topic/uda1380' and 'asoc/topic/uniphier' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/tlv320aic32x4', ↵Mark Brown5-580/+580
'asoc/topic/tlv320aic3x', 'asoc/topic/tlv320dac33', 'asoc/topic/topology' and 'asoc/topic/tscs42xx' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/tda7419', 'asoc/topic/tfa9879', ↵Mark Brown11-277/+1030
'asoc/topic/tlv320aic23', 'asoc/topic/tlv320aic26' and 'asoc/topic/tlv320aic31xx' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/tas2552', 'asoc/topic/tas5086', ↵Mark Brown5-298/+279
'asoc/topic/tas571x', 'asoc/topic/tas5720' and 'asoc/topic/tas6424' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/sta529', 'asoc/topic/sti-sas', ↵Mark Brown9-155/+262
'asoc/topic/stm32', 'asoc/topic/sun4i' and 'asoc/topic/sun8i' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/ssm2518', 'asoc/topic/ssm2602', ↵Mark Brown7-239/+204
'asoc/topic/ssm4567', 'asoc/topic/sta32x' and 'asoc/topic/sta350' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/sirf-audio', ↵Mark Brown5-63/+52
'asoc/topic/sn95031', 'asoc/topic/soc-dapm', 'asoc/topic/spdif_receiver' and 'asoc/topic/spdif_transmitter' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/rt5670', 'asoc/topic/sgtl5000', ↵Mark Brown8-290/+362
'asoc/topic/si476x' and 'asoc/topic/sirf' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/rt5645', 'asoc/topic/rt5651', ↵Mark Brown20-638/+729
'asoc/topic/rt5659' and 'asoc/topic/rt5660' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/rt298', 'asoc/topic/rt5514', ↵Mark Brown10-488/+474
'asoc/topic/rt5616', 'asoc/topic/rt5631' and 'asoc/topic/rt5640' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/pistachio', 'asoc/topic/pxa', ↵Mark Brown9-131/+190
'asoc/topic/rsnd', 'asoc/topic/rt274' and 'asoc/topic/rt286' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/msm8916-wcd-digital', ↵Mark Brown6-202/+223
'asoc/topic/mtk', 'asoc/topic/nau8540', 'asoc/topic/nau8810' and 'asoc/topic/nau8824' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/max98927', 'asoc/topic/mc13783', ↵Mark Brown7-238/+228
'asoc/topic/mediatek', 'asoc/topic/ml26124' and 'asoc/topic/msm8916-wcd-analog' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/max9850', 'asoc/topic/max9860', ↵Mark Brown9-200/+177
'asoc/topic/max9867', 'asoc/topic/max98925' and 'asoc/topic/max98926' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/max98090', 'asoc/topic/max98095', ↵Mark Brown10-471/+456
'asoc/topic/max98357a', 'asoc/topic/max98371' and 'asoc/topic/max98373' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/isabelle', 'asoc/topic/jz4740', ↵Mark Brown8-254/+464
'asoc/topic/lm49453', 'asoc/topic/max9759' and 'asoc/topic/max98088' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/hdmi-codec', ↵Mark Brown8-441/+54
'asoc/topic/ics43432', 'asoc/topic/imx-wm8962' and 'asoc/topic/inno_rk3036' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/fsl_esai', 'asoc/topic/fsl_ssi', ↵Mark Brown8-388/+481
'asoc/topic/fsl_utils', 'asoc/topic/generic-dmaengine' and 'asoc/topic/gtm601' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/dwc', 'asoc/topic/es7134', ↵Mark Brown7-151/+127
'asoc/topic/es8316', 'asoc/topic/es8328' and 'asoc/topic/fsl' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/da7219', 'asoc/topic/da732x', ↵Mark Brown8-269/+400
'asoc/topic/da9055' and 'asoc/topic/dmic' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/cx20442', 'asoc/topic/cygnus', ↵Mark Brown7-577/+543
'asoc/topic/da7210', 'asoc/topic/da7213' and 'asoc/topic/da7218' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/cs42l73', 'asoc/topic/cs42xx8', ↵Mark Brown7-265/+256
'asoc/topic/cs43130', 'asoc/topic/cs4349' and 'asoc/topic/cs53l30' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/cs4271', 'asoc/topic/cs42l42', ↵Mark Brown9-352/+316
'asoc/topic/cs42l51', 'asoc/topic/cs42l52' and 'asoc/topic/cs42l56' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/cs35l33', 'asoc/topic/cs35l34', ↵Mark Brown5-336/+303
'asoc/topic/cs35l35', 'asoc/topic/cs4265' and 'asoc/topic/cs4270' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/cpcap', 'asoc/topic/cq93vc' and ↵Mark Brown5-39/+1607
'asoc/topic/cs35l32' into asoc-next