05 Jun, 2018

1 commit

  • commit 271ef65b5882425d500e969e875c98e47a6b0c86 upstream.

    The pointer dma_dev_name is assigned but never read, it is redundant
    and can therefore be removed.

    Cleans up clang warning:
    sound/soc/intel/common/sst-firmware.c:288:3: warning: Value stored to
    'dma_dev_name' is never read

    Signed-off-by: Colin Ian King
    Acked-by: Pierre-Louis Bossart
    Signed-off-by: Mark Brown
    Cc: Guenter Roeck
    Signed-off-by: Greg Kroah-Hartman

    Colin Ian King
     

30 May, 2018

2 commits

  • [ Upstream commit 2e2c177ca84aff092c3c96714b0f6a12900f3946 ]

    In slave_update() of vmaster code ignores the error from the slave
    get() callback and copies the values. It's not only about the missing
    error code but also that this may potentially lead to a leak of
    uninitialized variables when the slave get() don't clear them.

    This patch fixes slave_update() not to copy the potentially
    uninitialized values when an error is returned from the slave get()
    callback, and to propagate the error value properly.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 3ae180972564846e6d794e3615e1ab0a1e6c4ef9 upstream.

    Commit f65e0d299807 ("ALSA: timer: Call notifier in the same spinlock")
    combined the start/continue and stop/pause functions, and in doing so
    changed the event code for the pause case to SNDRV_TIMER_EVENT_CONTINUE.
    Change it back to SNDRV_TIMER_EVENT_PAUSE.

    Fixes: f65e0d299807 ("ALSA: timer: Call notifier in the same spinlock")
    Signed-off-by: Ben Hutchings
    Cc: stable@vger.kernel.org
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Ben Hutchings
     

25 May, 2018

6 commits

  • [ Upstream commit 647d04f8e07afc7c3b7a42b3ee01a8b28db29631 ]

    If the RCLK mux clock configuration is specified in DT and no set_sysclk()
    callback is used in the sound card driver the sclk_srcrate field will remain
    set to 0, leading to an incorrect PSR divider setting.
    To fix this the frequency value is retrieved from the CLK_I2S_RCLK_SRC clock,
    so the actual RCLK mux selection is taken into account.

    Signed-off-by: Sylwester Nawrocki
    Acked-by: Krzysztof Kozlowski
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Sylwester Nawrocki
     
  • [ Upstream commit bde8b3887add8368ecf0ca71117baf2fd56a6fc9 ]

    This patch adds the change required to create the TLV data
    for dapm widget kcontrols from topology. This also fixes the following
    TLV read error shown in amixer while showing the card control contents.
    "amixer: Control hw:1 element TLV read error: No such device or address"

    Signed-off-by: Ranjani Sridharan
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Ranjani Sridharan
     
  • [ Upstream commit 1d22c337dc8f3a25638f7262e7bcb5729a34d140 ]

    In case of sample rates lower than 44100 currently there is too low MCLK
    frequency set for the CODEC. Playback fails with following errors:

    $ speaker-test -c2 -t sine -f 1500 -l2 -r 32000

    Sine wave rate is 1500.0000Hz
    Rate set to 32000Hz (requested 32000Hz)
    Buffer size range from 128 to 131072
    Period size range from 64 to 65536
    Using max buffer size 131072
    Periods = 4
    Unable to set hw params for playback: Invalid argument
    Setting of hwparams failed: Invalid argument

    [ 497.883700] max98090 1-0010: Invalid master clock frequency

    To fix this the I2S root clock's frequency is increased, depending
    on sampling rate.

    Signed-off-by: Sylwester Nawrocki
    Acked-by: Krzysztof Kozlowski
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Sylwester Nawrocki
     
  • [ Upstream commit b1d0db067fbe2598d62b248beea5d705a0ea7642 ]

    The driver does not select all the codec drivers that needs.
    Fix it by selecting the analog and HDMI codecs.

    Cc: Sjoerd Simons
    Signed-off-by: Ezequiel Garcia
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Ezequiel Garcia
     
  • [ Upstream commit 5e558f8afaec8957932b1dbe5aeff800f9fc6957 ]

    The hcp->chmap_info must not be freed up in the hdmi_codec_remove()
    function as it leads to kernel crash due ALSA core's
    pcm_chmap_ctl_private_free() is trying to free it up again when the card
    destroyed via snd_card_free.

    Commit cd6111b26280a ("ASoC: hdmi-codec: add channel mapping control")
    should not have added the kfree(hcp->chmap_info); to the hdmi_codec_remove
    function.

    Signed-off-by: Peter Ujfalusi
    Reviewed-by: Jyri Sarha
    Tested-by: Jyri Sarha
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Peter Ujfalusi
     
  • [ Upstream commit 71426535f49fe6034d0e0db77608b91a0c1a022d ]

    Add native DSD support quirk for Luxman DA-06 DAC, by adding the
    PID/VID 1852:5065.

    Rename "is_marantz_denon_dac()" function to "is_itf_usb_dsd_2alts_dac()"
    to cover broader device family sharing the same USB audio
    implementation(*).
    For the same reason, rename "is_teac_dsd_dac()" function to
    "is_itf_usb_dsd_3alts_dac()".

    (*)
    These devices have the same USB controller "ITF-USB DSD", supplied by
    INTERFACE Co., Ltd.
    "ITF-USB DSD" USB controller has two patterns,

    Pattern 1. (2 altsets version)
    - Altset 0: for control
    - Altset 1: for stream (S32)
    - Altset 2: for stream (S32, DSD_U32)

    Pattern 2. (3 altsets version)
    - Altset 0: for control
    - Altset 1: for stream (S16)
    - Altset 2: for stream (S32)
    - Altset 3: for stream (S32, DSD_U32)

    "is_itf_usb_dsd_2alts_dac()" returns true, if the DAC has "Pattern 1"
    USB controller, and "is_itf_usb_dsd_3alts_dac()" returns true, if
    "Pattern2".

    Signed-off-by: Nobutaka Okabe
    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Nobutaka Okabe
     

23 May, 2018

3 commits

  • commit 3f12888dfae2a48741c4caa9214885b3aaf350f9 upstream.

    In snd_ctl_elem_add_compat(), the fields of the struct 'data' need to be
    copied from the corresponding fields of the struct 'data32' in userspace.
    This is achieved by invoking copy_from_user() and get_user() functions. The
    problem here is that the 'type' field is copied twice. One is by
    copy_from_user() and one is by get_user(). Given that the 'type' field is
    not used between the two copies, the second copy is *completely* redundant
    and should be removed for better performance and cleanup. Also, these two
    copies can cause inconsistent data: as the struct 'data32' resides in
    userspace and a malicious userspace process can race to change the 'type'
    field between the two copies to cause inconsistent data. Depending on how
    the data is used in the future, such an inconsistency may cause potential
    security risks.

    For above reasons, we should take out the second copy.

    Signed-off-by: Wenwen Wang
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Wenwen Wang
     
  • commit c8beccc19b92f5172994c0732db689c08f4f98e5 upstream.

    Power-saving is causing loud plops on the Lenovo C50 All in one, add it
    to the blacklist.

    BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1572975
    Signed-off-by: Hans de Goede
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     
  • commit 21493316a3c4598f308d5a9fa31cc74639c4caff upstream.

    Currently it's not possible to set volume lower than 26% (it just mutes).

    Also fixes this warning:

    Warning! Unlikely big volume range (=9472), cval->res is probably wrong.
    [13] FU [PCM Playback Volume] ch = 2, val = -9473/-1/1

    , and volume works fine for full range.

    Signed-off-by: Federico Cuello
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Federico Cuello
     

09 May, 2018

6 commits

  • commit 76b3421b39bd610546931fc923edcf90c18fa395 upstream.

    Some control API callbacks in aloop driver are too lazy to take the
    loopback->cable_lock and it results in possible races of cable access
    while it's being freed. It eventually lead to a UAF, as reported by
    fuzzer recently.

    This patch covers such control API callbacks and add the proper mutex
    locks.

    Reported-by: DaeRyong Jeong
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 306a4f3ca7f3c7dfa473ebd19d66e40e59d99734 upstream.

    Show paused ALSA aloop device as inactive, i.e. the control
    "PCM Slave Active" set as false. Notification sent upon state change.

    This makes it possible for client capturing from aloop device to know if
    data is expected. Without it the client expects data even if playback
    is paused.

    Signed-off-by: Robert Rosengren
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Robert Rosengren
     
  • commit 52759c0963510a2843774aac9b65ccaed3308dc0 upstream.

    At a commit f91c9d7610a ('ALSA: firewire-lib: cache maximum length of
    payload to reduce function calls'), maximum size of payload for tx
    isochronous packet is cached to reduce the number of function calls.

    This cache was programmed to updated at a first callback of ohci1394 IR
    context. However, the maximum size is required to queueing packets before
    starting the isochronous context.

    As a result, the cached value is reused to queue packets in next time to
    starting the isochronous context. Then the cache is updated in a first
    callback of the isochronous context. This can cause kernel NULL pointer
    dereference in a below call graph:

    (sound/firewire/amdtp-stream.c)
    amdtp_stream_start()
    ->queue_in_packet()
    ->queue_packet()
    (drivers/firewire/core-iso.c)
    ->fw_iso_context_queue()
    ->struct fw_card_driver.queue_iso()
    (drivers/firewire/ohci.c)
    = ohci_queue_iso()
    ->queue_iso_packet_per_buffer()
    buffer->pages[page]

    The issued dereference occurs in a case that:
    - target unit supports different stream formats for sampling transmission
    frequency.
    - maximum length of payload for tx stream in a first trial is bigger
    than the length in a second trial.

    In this case, correct number of pages are allocated for DMA and the 'pages'
    array has enough elements, while index of the element is wrongly calculated
    according to the old value of length of payload in a call of
    'queue_in_packet()'. Then it causes the issue.

    This commit fixes the critical bug. This affects all of drivers in ALSA
    firewire stack in Linux kernel v4.12 or later.

    [12665.302360] BUG: unable to handle kernel NULL pointer dereference at 0000000000000030
    [12665.302415] IP: ohci_queue_iso+0x47c/0x800 [firewire_ohci]
    [12665.302439] PGD 0
    [12665.302440] P4D 0
    [12665.302450]
    [12665.302470] Oops: 0000 [#1] SMP PTI
    [12665.302487] Modules linked in: ...
    [12665.303096] CPU: 1 PID: 12760 Comm: jackd Tainted: P OE 4.13.0-38-generic #43-Ubuntu
    [12665.303154] Hardware name: /DH77DF, BIOS KCH7710H.86A.0069.2012.0224.1825 02/24/2012
    [12665.303215] task: ffff9ce87da2ae80 task.stack: ffffb5b8823d0000
    [12665.303258] RIP: 0010:ohci_queue_iso+0x47c/0x800 [firewire_ohci]
    [12665.303301] RSP: 0018:ffffb5b8823d3ab8 EFLAGS: 00010086
    [12665.303337] RAX: ffff9ce4f4876930 RBX: 0000000000000008 RCX: ffff9ce88a3955e0
    [12665.303384] RDX: 0000000000000000 RSI: 0000000034877f00 RDI: 0000000000000000
    [12665.303427] RBP: ffffb5b8823d3b68 R08: ffff9ce8ccb390a0 R09: ffff9ce877639ab0
    [12665.303475] R10: 0000000000000108 R11: 0000000000000000 R12: 0000000000000003
    [12665.303513] R13: 0000000000000000 R14: ffff9ce4f4876950 R15: 0000000000000000
    [12665.303554] FS: 00007f2ec467f8c0(0000) GS:ffff9ce8df280000(0000) knlGS:0000000000000000
    [12665.303600] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [12665.303633] CR2: 0000000000000030 CR3: 00000002dcf90004 CR4: 00000000000606e0
    [12665.303674] Call Trace:
    [12665.303698] fw_iso_context_queue+0x18/0x20 [firewire_core]
    [12665.303735] queue_packet+0x88/0xe0 [snd_firewire_lib]
    [12665.303770] amdtp_stream_start+0x19b/0x270 [snd_firewire_lib]
    [12665.303811] start_streams+0x276/0x3c0 [snd_dice]
    [12665.303840] snd_dice_stream_start_duplex+0x1bf/0x480 [snd_dice]
    [12665.303882] ? vma_gap_callbacks_rotate+0x1e/0x30
    [12665.303914] ? __rb_insert_augmented+0xab/0x240
    [12665.303936] capture_prepare+0x3c/0x70 [snd_dice]
    [12665.303961] snd_pcm_do_prepare+0x1d/0x30 [snd_pcm]
    [12665.303985] snd_pcm_action_single+0x3b/0x90 [snd_pcm]
    [12665.304009] snd_pcm_action_nonatomic+0x68/0x70 [snd_pcm]
    [12665.304035] snd_pcm_prepare+0x68/0x90 [snd_pcm]
    [12665.304058] snd_pcm_common_ioctl1+0x4c0/0x940 [snd_pcm]
    [12665.304083] snd_pcm_capture_ioctl1+0x19b/0x250 [snd_pcm]
    [12665.304108] snd_pcm_capture_ioctl+0x27/0x40 [snd_pcm]
    [12665.304131] do_vfs_ioctl+0xa8/0x630
    [12665.304148] ? entry_SYSCALL_64_after_hwframe+0xe9/0x139
    [12665.304172] ? entry_SYSCALL_64_after_hwframe+0xe2/0x139
    [12665.304195] ? entry_SYSCALL_64_after_hwframe+0xdb/0x139
    [12665.304218] ? entry_SYSCALL_64_after_hwframe+0xd4/0x139
    [12665.304242] ? entry_SYSCALL_64_after_hwframe+0xcd/0x139
    [12665.304265] ? entry_SYSCALL_64_after_hwframe+0xc6/0x139
    [12665.304288] ? entry_SYSCALL_64_after_hwframe+0xbf/0x139
    [12665.304312] ? entry_SYSCALL_64_after_hwframe+0xb8/0x139
    [12665.304335] ? entry_SYSCALL_64_after_hwframe+0xb1/0x139
    [12665.304358] SyS_ioctl+0x79/0x90
    [12665.304374] ? entry_SYSCALL_64_after_hwframe+0x72/0x139
    [12665.304397] entry_SYSCALL_64_fastpath+0x24/0xab
    [12665.304417] RIP: 0033:0x7f2ec3750ef7
    [12665.304433] RSP: 002b:00007fff99e31388 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
    [12665.304465] RAX: ffffffffffffffda RBX: 00007fff99e312f0 RCX: 00007f2ec3750ef7
    [12665.304494] RDX: 0000000000000000 RSI: 0000000000004140 RDI: 0000000000000007
    [12665.304522] RBP: 0000556ebc63fd60 R08: 0000556ebc640560 R09: 0000000000000000
    [12665.304553] R10: 0000000000000001 R11: 0000000000000246 R12: 0000556ebc63fcf0
    [12665.304584] R13: 0000000000000000 R14: 0000000000000007 R15: 0000000000000000
    [12665.304612] Code: 01 00 00 44 89 eb 45 31 ed 45 31 db 66 41 89 1e 66 41 89 5e 0c 66 45 89 5e 0e 49 8b 49 08 49 63 d4 4d 85 c0 49 63 ff 48 8b 14 d1 8b 72 30 41 8d 14 37 41 89 56 04 48 63 d3 0f 84 ce 00 00 00
    [12665.304713] RIP: ohci_queue_iso+0x47c/0x800 [firewire_ohci] RSP: ffffb5b8823d3ab8
    [12665.304743] CR2: 0000000000000030
    [12665.317701] ---[ end trace 9d55b056dd52a19f ]---

    Fixes: f91c9d7610a ('ALSA: firewire-lib: cache maximum length of payload to reduce function calls')
    Cc: # v4.12+
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Sakamoto
     
  • commit 8f22e52528cc372b218b5f100457469615c733ce upstream.

    The sequencer virmidi code has an open race at its output trigger
    callback: namely, virmidi keeps only one event packet for processing
    while it doesn't protect for concurrent output trigger calls.

    snd_virmidi_output_trigger() tries to process the previously
    unfinished event before starting encoding the given MIDI stream, but
    this is done without any lock. Meanwhile, if another rawmidi stream
    starts the output trigger, this proceeds further, and overwrites the
    event package that is being processed in another thread. This
    eventually corrupts and may lead to the invalid memory access if the
    event type is like SYSEX.

    The fix is just to move the spinlock to cover both the pending event
    and the new stream.

    The bug was spotted by a new fuzzer, RaceFuzzer.

    BugLink: http://lkml.kernel.org/r/20180426045223.GA15307@dragonet.kaist.ac.kr
    Reported-by: DaeRyong Jeong
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit f13876e2c33a657a71bcbb10f767c0951b165020 upstream.

    Since snd_pcm_ioctl_xfern_compat() has no PCM state check, it may go
    further and hit the sanity check pcm_sanity_check() when the ioctl is
    called right after open. It may eventually spew a kernel warning, as
    triggered by syzbot, depending on kconfig.

    The lack of PCM state check there was just an oversight. Although
    it's no real crash, the spurious kernel warning is annoying, so let's
    add the proper check.

    Reported-by: syzbot+1dac3a4f6bc9c1c675d4@syzkaller.appspotmail.com
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 6a30abaa40b62aed46ef12ea4c16c48565bdb376 upstream.

    The commit c469652bb5e8 ("ALSA: hda - Use IS_REACHABLE() for
    dependency on input") simplified the dependencies with IS_REACHABLE()
    macro, but it broke due to its incorrect usage: it should have been
    IS_REACHABLE(CONFIG_INPUT) instead of IS_REACHABLE(INPUT).

    Fixes: c469652bb5e8 ("ALSA: hda - Use IS_REACHABLE() for dependency on input")
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

02 May, 2018

17 commits

  • commit c656941df9bc80f7ec65b92ca73c42f8b0b62628 upstream.

    When the desired ratio is less than 256, the savesub (tolerance)
    in the calculation would become 0. This will then fail the loop-
    search immediately without reporting any errors.

    But if the ratio is smaller enough, there is no need to calculate
    the tolerance because PM divisor alone is enough to get the ratio.

    So a simple fix could be just to set PM directly instead of going
    into the loop-search.

    Reported-by: Marek Vasut
    Signed-off-by: Nicolin Chen
    Tested-by: Marek Vasut
    Reviewed-by: Fabio Estevam
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Nicolin Chen
     
  • commit 65811834ba56e9ed88117cf6c09880416c9951ab upstream.

    On this Lenovo ThinkCentre machine. There are two front mics,
    we change the location for one of them.

    Relation: f33f79f3d0e5 ("ALSA: hda/realtek - change the location for
    one of two front microphones")

    Signed-off-by: Kailang Yang
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Kailang Yang
     
  • commit ab3b8e5159b5335c81ba2d09ee5054d4a1b5a7a6 upstream.

    Add ALC255 its own depop functions for alc_init and alc_shutup.
    Assign it to ALC256 usage.

    Signed-off-by: Kailang Yang
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Kailang Yang
     
  • commit ea04a1dbf8b1d6af759d58e705636fde48583f8f upstream.

    Fill COEF to change EAPD to verb control.
    Assigned codec type.

    This is an additional fix over 92f974df3460 ("ALSA: hda/realtek - New
    vendor ID for ALC233").

    [ More notes:
    according to Kailang, the chip is 10ec:0235 bonding for ALC233b,
    which is equivalent with ALC255. It's only used for Lenovo.
    The chip needs no alc_process_coef_fw() for headset unlike ALC255. ]

    Signed-off-by: Kailang Yang
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Kailang Yang
     
  • commit 69fa6f19b95597618ab30438a27b67ad93daa7c7 upstream.

    As recently Smatch suggested, one place in HD-audio hwdep ioctl codes
    may expand the array directly from the user-space value with
    speculation:
    sound/pci/hda/hda_local.h:467 get_wcaps() warn: potential spectre issue 'codec->wcaps'

    As get_wcaps() itself is a fairly frequently called inline function,
    and there is only one single call with a user-space value, we replace
    only the latter one to open-code locally with array_index_nospec()
    hardening in this patch.

    BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2
    Reported-by: Dan Carpenter
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 8d218dd8116695ecda7164f97631c069938aa22e upstream.

    As Smatch recently suggested, a few places in OSS sequencer codes may
    expand the array directly from the user-space value with speculation,
    namely there are a significant amount of references to either
    info->ch[] or dp->synths[] array:

    sound/core/seq/oss/seq_oss_event.c:315 note_on_event() warn: potential spectre issue 'info->ch' (local cap)
    sound/core/seq/oss/seq_oss_event.c:362 note_off_event() warn: potential spectre issue 'info->ch' (local cap)
    sound/core/seq/oss/seq_oss_synth.c:470 snd_seq_oss_synth_load_patch() warn: potential spectre issue 'dp->synths' (local cap)
    sound/core/seq/oss/seq_oss_event.c:293 note_on_event() warn: potential spectre issue 'dp->synths'
    sound/core/seq/oss/seq_oss_event.c:353 note_off_event() warn: potential spectre issue 'dp->synths'
    sound/core/seq/oss/seq_oss_synth.c:506 snd_seq_oss_synth_sysex() warn: potential spectre issue 'dp->synths'
    sound/core/seq/oss/seq_oss_synth.c:580 snd_seq_oss_synth_ioctl() warn: potential spectre issue 'dp->synths'

    Although all these seem doing only the first load without further
    reference, we may want to stay in a safer side, so hardening with
    array_index_nospec() would still make sense.

    We may put array_index_nospec() at each place, but here we take a
    different approach:

    - For dp->synths[], change the helpers to retrieve seq_oss_synthinfo
    pointer directly instead of the array expansion at each place

    - For info->ch[], harden in a normal way, as there are only a couple
    of places

    As a result, the existing helper, snd_seq_oss_synth_is_valid() is
    replaced with snd_seq_oss_synth_info(). Also, we cover MIDI device
    where a similar array expansion is done, too, although it wasn't
    reported by Smatch.

    BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2
    Reported-by: Dan Carpenter
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit f5e94b4c6ebdabe0f602d796e0430180927521a0 upstream.

    When get_synthdev() is called for a MIDI device, it returns the fixed
    midi_synth_dev without the use refcounting. OTOH, the caller is
    supposed to unreference unconditionally after the usage, so this would
    lead to unbalanced refcount.

    This patch corrects the behavior and keep up the refcount balance also
    for the MIDI synth device.

    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit f853dcaae2f5bbe021161e421bd1576845bae8f6 upstream.

    It looks like a simple mistake that this struct member
    was forgotten.

    Audio_tstamp isn't used much, and on some archs (such as x86) this
    ioctl is not used by default, so that might be the reason why this
    has slipped for so long.

    Fixes: 4eeaaeaea1ce ("ALSA: core: add hooks for audio timestamps")
    Signed-off-by: David Henningsson
    Reviewed-by: Takashi Sakamoto
    Cc: # v3.8+
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    David Henningsson
     
  • commit 912e4c332037e7ed063c164985c36fb2b549ea3a upstream.

    The commit c2c86a97175f ("ALSA: pcm: Remove set_fs() in PCM core code")
    changed SNDRV_PCM_IOCTL_DELAY to return an inconsistent error instead of a
    negative delay. Originally the call would succeed and return the negative
    delay. The Chromium OS Audio Server (CRAS) gets confused and hangs when
    the error is returned instead of the negative delay.

    Help CRAS avoid the issue by rolling back the behavior to return a
    negative delay instead of an error.

    Fixes: c2c86a97175f ("ALSA: pcm: Remove set_fs() in PCM core code")
    Signed-off-by: Jeffery Miller
    Cc: # v4.13+
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Jeffery Miller
     
  • commit f526afcd8f71945c23ce581d7864ace93de8a4f7 upstream.

    As recently Smatch suggested, one place in RME9652 driver may expand
    the array directly from the user-space value with speculation:
    sound/pci/rme9652/rme9652.c:2074 snd_rme9652_channel_info() warn: potential spectre issue 'rme9652->channel_map' (local cap)

    This patch puts array_index_nospec() for hardening against it.

    BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2
    Reported-by: Dan Carpenter
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 10513142a7114d251670361ad40cba2c61403406 upstream.

    As recently Smatch suggested, a couple of places in HDSP MADI driver
    may expand the array directly from the user-space value with
    speculation:
    sound/pci/rme9652/hdspm.c:5717 snd_hdspm_channel_info() warn: potential spectre issue 'hdspm->channel_map_out' (local cap)
    sound/pci/rme9652/hdspm.c:5734 snd_hdspm_channel_info() warn: potential spectre issue 'hdspm->channel_map_in' (local cap)

    This patch puts array_index_nospec() for hardening against them.

    BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2
    Reported-by: Dan Carpenter
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit f9d94b57e30fd1575b4935045b32d738668aa74b upstream.

    As recently Smatch suggested, a couple of places in ASIHPI driver may
    expand the array directly from the user-space value with speculation:
    sound/pci/asihpi/hpimsginit.c:70 hpi_init_response() warn: potential spectre issue 'res_size' (local cap)
    sound/pci/asihpi/hpioctl.c:189 asihpi_hpi_ioctl() warn: potential spectre issue 'adapters'

    This patch puts array_index_nospec() for hardening against them.

    BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2
    Reported-by: Dan Carpenter
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 7f054a5bee0987f1e2d4e59daea462421c76f2cb upstream.

    As recently Smatch suggested, one place in OPL3 driver may expand the
    array directly from the user-space value with speculation:
    sound/drivers/opl3/opl3_synth.c:476 snd_opl3_set_voice() warn: potential spectre issue 'snd_opl3_regmap'

    This patch puts array_index_nospec() for hardening against it.

    BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2
    Reported-by: Dan Carpenter
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 8a7d6003df41cb16f6b3b620da044fbd92d2f5ee upstream.

    When CONFIG_SND_DYNAMIC_MINORS isn't set, there are only limited
    number of devices available, and HD-audio, especially with HDMI/DP
    codec, will fail to create more than two devices.

    The driver warns about the lack of such devices and skips the PCM
    device creations, but the HDMI driver still tries to create the
    corresponding JACK, SPDIF and ELD controls even for the non-existing
    PCM substreams. This results in confusion on user-space, and even may
    break the operation.

    Similarly, Intel HDMI/DP codec builds the ELD notification from i915
    graphics driver, and this may be broken if a notification is sent for
    the non-existing PCM stream.

    This patch adds the check of the existence of the assigned PCM
    substream in the both scenarios above, and skips the further operation
    if the PCM substream is not assigned.

    Fixes: 9152085defb6 ("ALSA: hda - add DP MST audio support")
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 0f925660a7bc49b269c163249a5d06da3a0c7b0a upstream.

    In error path of snd_dice_stream_init_duplex(), stream data for incoming
    packet can be left to be initialized.

    This commit fixes it.

    Fixes: 436b5abe2224 ('ALSA: dice: handle whole available isochronous streams')
    Cc: # v4.6+
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Sakamoto
     
  • commit 10412c420af9ba1f3de8483a95d360e5eb5bfc84 upstream.

    OUI for TC Electronic is 0x000166, for TC GROUP A/S. 0x001486 is for Echo
    Digital Audio Corporation.

    Fixes: 7cafc65b3aa1 ('ALSA: dice: force to add two pcm devices for listed models')
    Cc: # v4.6+
    Reference: http://standards-oui.ieee.org/oui/oui.txt
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Sakamoto
     
  • commit 1d8d6428d1da642ddd75b0be2d1bb1123ff8e017 upstream.

    The Dell Dock USB-audio device with 0bda:4014 is behaving notoriously
    bad, and we have already applied some workaround to avoid the firmware
    hiccup. Yet we still need to skip one thing, the Extension Unit at ID
    4, which doesn't react correctly to the mixer ctl access.

    Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1090658
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

26 Apr, 2018

3 commits

  • [ Upstream commit fde7f9dbc71365230eeb8c8ea97ce9b552c8e5bd ]

    The rt5514 dsp captures pcm data through spi directly, so we should not
    use rockchip-i2s as it's cpu dai like other codecs.

    Use dummy_dai for rt5514 dsp dailink to make voice wakeup work again.

    Reported-by: Jimmy Cheng-Yi Chiang
    Fixes: (72cfb0f20c75 ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp)
    Signed-off-by: Jeffy Chen
    Tested-by: Brian Norris
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Jeffy Chen
     
  • [ Upstream commit 123af9043e93cb6f235207d260d50f832cdb5439 ]

    The loop timeout doesn't work because it's a post op and ends with "tmo"
    set to -1. I changed it from a post-op to a pre-op and I changed the
    initial the starting value from 5 to 6 so we still iterate 5 times. I
    left the other as it was because it's a large number.

    Fixes: b3c70c9ea62a ("ASoC: Alchemy AC97C/I2SC audio support")
    Signed-off-by: Dan Carpenter
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • [ Upstream commit c469652bb5e8fb715db7d152f46d33b3740c9b87 ]

    The commit ffcd28d88e4f ("ALSA: hda - Select INPUT for Realtek
    HD-audio codec") introduced the reverse-selection of CONFIG_INPUT for
    Realtek codec in order to avoid the mess with dependency between
    built-in and modules. Later on, we obtained IS_REACHABLE() macro
    exactly for this kind of problems, and now we can remove th INPUT
    selection in Kconfig and put IS_REACHABLE(INPUT) to the appropriate
    places in the code, so that the driver doesn't need to select other
    subsystem forcibly.

    Fixes: ffcd28d88e4f ("ALSA: hda - Select INPUT for Realtek HD-audio codec")
    Reported-by: Randy Dunlap
    Acked-by: Randy Dunlap # and build-tested
    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

24 Apr, 2018

2 commits

  • commit a3dafb2200bf3c13905a088e82ae11f1eb275a83 upstream.

    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:
    Signed-off-by: Hui Wang
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Hui Wang
     
  • commit 3ce0d5aa265bcc0a4b281cb0cabf92491276101b upstream.

    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:
    Signed-off-by: Hui Wang
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Hui Wang