14 Dec, 2017

5 commits

  • commit 89b89d121ffcf8d9546633b98ded9d18b8f75891 upstream.

    snd_usb_copy_string_desc() returns zero if usb_string() fails.
    In case of failure, we need to check the snd_usb_copy_string_desc()'s
    return value and add an exception case

    Signed-off-by: Jaejoong Kim
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Jaejoong Kim
     
  • commit 251552a2b0d454badc8f486e6d79100970c744b0 upstream.

    The snd_usb_copy_string_desc() retrieves the usb string corresponding to
    the index number through the usb_string(). The problem is that the
    usb_string() returns the length of the string (>= 0) when successful, but
    it can also return a negative value about the error case or status of
    usb_control_msg().

    If iClockSource is '0' as shown below, usb_string() will returns -EINVAL.
    This will result in '0' being inserted into buf[-22], and the following
    KASAN out-of-bound error message will be output.

    AudioControl Interface Descriptor:
    bLength 8
    bDescriptorType 36
    bDescriptorSubtype 10 (CLOCK_SOURCE)
    bClockID 1
    bmAttributes 0x07 Internal programmable Clock (synced to SOF)
    bmControls 0x07
    Clock Frequency Control (read/write)
    Clock Validity Control (read-only)
    bAssocTerminal 0
    iClockSource 0

    To fix it, check usb_string()'return value and bail out.

    ==================================================================
    BUG: KASAN: stack-out-of-bounds in parse_audio_unit+0x1327/0x1960 [snd_usb_audio]
    Write of size 1 at addr ffff88007e66735a by task systemd-udevd/18376

    CPU: 0 PID: 18376 Comm: systemd-udevd Not tainted 4.13.0+ #3
    Hardware name: LG Electronics 15N540-RFLGL/White Tip Mountain, BIOS 15N5
    Call Trace:
    dump_stack+0x63/0x8d
    print_address_description+0x70/0x290
    ? parse_audio_unit+0x1327/0x1960 [snd_usb_audio]
    kasan_report+0x265/0x350
    __asan_store1+0x4a/0x50
    parse_audio_unit+0x1327/0x1960 [snd_usb_audio]
    ? save_stack+0xb5/0xd0
    ? save_stack_trace+0x1b/0x20
    ? save_stack+0x46/0xd0
    ? kasan_kmalloc+0xad/0xe0
    ? kmem_cache_alloc_trace+0xff/0x230
    ? snd_usb_create_mixer+0xb0/0x4b0 [snd_usb_audio]
    ? usb_audio_probe+0x4de/0xf40 [snd_usb_audio]
    ? usb_probe_interface+0x1f5/0x440
    ? driver_probe_device+0x3ed/0x660
    ? build_feature_ctl+0xb10/0xb10 [snd_usb_audio]
    ? save_stack_trace+0x1b/0x20
    ? init_object+0x69/0xa0
    ? snd_usb_find_csint_desc+0xa8/0xf0 [snd_usb_audio]
    snd_usb_mixer_controls+0x1dc/0x370 [snd_usb_audio]
    ? build_audio_procunit+0x890/0x890 [snd_usb_audio]
    ? snd_usb_create_mixer+0xb0/0x4b0 [snd_usb_audio]
    ? kmem_cache_alloc_trace+0xff/0x230
    ? usb_ifnum_to_if+0xbd/0xf0
    snd_usb_create_mixer+0x25b/0x4b0 [snd_usb_audio]
    ? snd_usb_create_stream+0x255/0x2c0 [snd_usb_audio]
    usb_audio_probe+0x4de/0xf40 [snd_usb_audio]
    ? snd_usb_autosuspend.part.7+0x30/0x30 [snd_usb_audio]
    ? __pm_runtime_idle+0x90/0x90
    ? kernfs_activate+0xa6/0xc0
    ? usb_match_one_id_intf+0xdc/0x130
    ? __pm_runtime_set_status+0x2d4/0x450
    usb_probe_interface+0x1f5/0x440

    Signed-off-by: Jaejoong Kim
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Jaejoong Kim
     
  • commit 43a3542870328601be02fcc9d27b09db467336ef upstream.

    The use of snd_BUG_ON() in ALSA sequencer timer may lead to a spurious
    WARN_ON() when a slave timer is deployed as its backend and a
    corresponding master timer stops meanwhile. The symptom was triggered
    by syzkaller spontaneously.

    Since the NULL timer is valid there, rip off snd_BUG_ON().

    Reported-by: syzbot
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 362bca57f5d78220f8b5907b875961af9436e229 upstream.

    When the device descriptor is closed, the `substream->runtime` pointer
    is freed. But another thread may be in the ioctl handler, case
    SNDRV_CTL_IOCTL_PCM_INFO. This case calls snd_pcm_info_user() which
    calls snd_pcm_info() which accesses the now freed `substream->runtime`.

    Note: this fixes CVE-2017-0861

    Signed-off-by: Robb Glasser
    Signed-off-by: Nick Desaulniers
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Robb Glasser
     
  • commit f429e7e494afaded76e62c6f98211a635aa03098 upstream.

    Add new support for ALC257 codec.

    [ It's supposed to be almost equivalent with other ALC25x variants,
    just adding another type and id -- tiwai ]

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

    Kailang Yang
     

30 Nov, 2017

13 commits

  • commit 316b7758c998fb13371d14bb6c9e45ab129c19a7 upstream.

    While the current code was reporting to be able to work in master mode, it
    failed to do so because the BCLK divider wasn't programmed, meaning that
    the BCLK would run at the PLL's frequency no matter the sample rate.

    It was obviously a bit too fast.

    Add support to retrieve the divider to use, and set it. Since our PLL is
    not always able to generate a perfect multiple of the sample rate, we'll
    have to choose the closest divider that matches our setup.

    Fixes: 36c684936fae ("ASoC: Add sun8i digital audio codec")
    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Maxime Ripard
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Maxime Ripard
     
  • commit 18c1bf35c1c09bca05cf70bc984a4764e0b0372b upstream.

    Since its introduction, the codec had an inversion of the left and right
    channels. It turned out to be pretty simple as it appears that the codec
    doesn't have the same polarity on the LRCK signal than the I2S block.

    Fix this by inverting our bit value for the LRCK inversion.

    Fixes: 36c684936fae ("ASoC: Add sun8i digital audio codec")
    Signed-off-by: Maxime Ripard
    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Maxime Ripard
     
  • commit 560bfe774f058e97596f30ff71cffdac52b72914 upstream.

    The current code had the condition backward when checking if the codec
    should be running in slave or master mode.

    Fix it, and make the comment a bit more readable.

    Fixes: 36c684936fae ("ASoC: Add sun8i digital audio codec")
    Signed-off-by: Maxime Ripard
    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Maxime Ripard
     
  • commit 2d7fe6185722b0817bb345f62ab06b76a7b26542 upstream.

    It maybe the typo for ALC700 support patch.
    To fix the bit value on this patch.

    Fixes: 6fbae35a3170 ("ALSA: hda/realtek - Add support for new codecs ALC700/ALC701/ALC703")
    Signed-off-by: Kailang Yang
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Kailang Yang
     
  • commit d6c0615f510bc1ee26cfb2b9a3343ac99b9c46fb upstream.

    The previous fix for addressing the breakage in vmaster slave
    initialization, commit a91d66129fb9 ("ALSA: hda - Fix incorrect TLV
    callback check introduced during set_fs() removal"), introduced a new
    helper to process over each slave kctl. However, this helper passes
    only the original kctl, not the virtual slave kctl. As a result,
    HD-audio driver (which is the only user so far) couldn't initialize
    the slave correctly because it's trying to update the value directly
    with the original kctl, not with the mapped kctl.

    This patch fixes the situation again by passing both the mapped slaved
    and original slave kctls to the function. Luckily there is a single
    caller as of now, so changing the call signature is no big matter.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=197959
    Fixes: a91d66129fb9 ("ALSA: hda - Fix incorrect TLV callback check introduced during set_fs() removal")
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit c2432466f583cb719b35a41e757da587d9ab1d00 upstream.

    We got a regression report about the HD-audio HDMI chmap, where some
    surround channels are reported as UNKNOWN. The git bisection pointed
    the culprit at the commit 9b3dc8aa3fb1 ("ALSA: hda - Register chmap
    obj as priv data instead of codec"). The story behind scene is like
    this:

    - While moving the code out of the legacy HDA to the HDA common place,
    the patch modifies the code to obtain the chmap array indirectly in
    a byte array, and it expands it to kctl value array.
    - At the latter operation, the size of the array is wrongly passed by
    sizeof() to the pointer.
    - It can be 4 on 32bit arch, thus too short for 6+ channels.
    (And that's the reason why it didn't hit other persons; it's 8 on
    64bit arch, thus it's usually enough.)

    The code was further changed meanwhile, but the problem persisted.
    Let's fix it by correctly evaluating the array size.

    Fixes: 9b3dc8aa3fb1 ("ALSA: hda - Register chmap obj as priv data instead of codec")
    Reported-by: VDR User
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 3aabf94c2d95fe465d5fa8590113d1c1f7d8333d upstream.

    Sound works after a cold boot but not after a reboot from windows.
    This patch will solve this issue. This is relation with Class-D power control.

    [ The bug was reported in Bugzilla below for Sony VAIO SVS13A1C5E
    -- tiwai]

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=197737
    Signed-off-by: Kailang Yang
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Kailang Yang
     
  • commit 3d4e8303f2c747c8540a0a0126d0151514f6468b upstream.

    Some timer compat ioctls have NULL checks of timer instance with
    snd_BUG_ON() that bring up WARN_ON() when the debug option is set.
    Actually the condition can be met in the normal situation and it's
    confusing and bad to spew kernel warnings with stack trace there.
    Let's remove snd_BUG_ON() invocation and replace with the simple
    checks. Also, correct the error code to EBADFD to follow the native
    ioctl error handling.

    Reported-by: syzbot
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 0a62d6c966956d77397c32836a5bbfe3af786fc1 upstream.

    The helper functions to parse and look for the clock source, selector
    and multiplier unit may return the descriptor with a too short length
    than required, while there is no sanity check in the caller side.
    Add some sanity checks in the parsers, at least, to guarantee the
    given descriptor size, for avoiding the potential crashes.

    Fixes: 79f920fbff56 ("ALSA: usb-audio: parse clock topology of UAC2 devices")
    Reported-by: Andrey Konovalov
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit f658f17b5e0e339935dca23e77e0f3cad591926b upstream.

    The usb-audio driver may trigger an out-of-bound access at parsing a
    malformed selector unit, as it checks the header length only after
    evaluating bNrInPins field, which can be already above the given
    length. Fix it by adding the length check beforehand.

    Fixes: 99fc86450c43 ("ALSA: usb-mixer: parse descriptors with structs")
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit d937cd6790a2bef2d07b500487646bd794c039bb upstream.

    When the usb-audio descriptor contains the malformed feature unit
    description with a too short length, the driver may access
    out-of-bounds. Add a sanity check of the header size at the beginning
    of parse_audio_feature_unit().

    Fixes: 23caaf19b11e ("ALSA: usb-mixer: Add support for Audio Class v2.0")
    Reported-by: Andrey Konovalov
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 20e3f985bb875fea4f86b04eba4b6cc29bfd6b71 upstream.

    commit 3179f6200188 ("ALSA: core: add .get_time_info") had a side effect
    of changing the behaviour of the PCM runtime tstamp. Prior to this
    change tstamp was not updated by snd_pcm_update_hw_ptr0() unless the
    hw_ptr had moved, after this change tstamp was always updated.

    For an application using alsa-lib, doing snd_pcm_readi() followed by
    snd_pcm_status() to estimate the age of the read samples by subtracting
    status->avail * [sample rate] from status->tstamp this change degraded
    the accuracy of the estimate on devices where the pcm hw does not
    provide a granular hw_ptr, e.g., devices using
    soc-generic-dmaengine-pcm.c and a dma-engine with residue_granularity
    DMA_RESIDUE_GRANULARITY_DESCRIPTOR. The accuracy of the estimate
    depended on the latency between the PCM hw completing a period and the
    driver called snd_pcm_period_elapsed() to notify ALSA core, typically
    determined by interrupt handling latency. After the change the accuracy
    of the estimate depended on the latency between the PCM hw completing a
    period and the application calling snd_pcm_status(), determined by the
    scheduling of the application process. The maximum error of the
    estimate is one period length in both cases, but the error average and
    variance is smaller when it depends on interrupt latency.

    Instead of always updating tstamp, update it only if audio_tstamp
    changed.

    Fixes: 3179f6200188 ("ALSA: core: add .get_time_info")
    Suggested-by: Pierre-Louis Bossart
    Signed-off-by: Henrik Eriksson
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Henrik Eriksson
     
  • commit 9ceace3c9c18c67676e75141032a65a8e01f9a7a upstream.

    This commit adds PCI ID for Raven platform

    Signed-off-by: Vijendar Mukunda
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Vijendar Mukunda
     

10 Nov, 2017

1 commit

  • Pull sound fixes from Takashi Iwai:
    "The amount of the changes isn't as quite small as wished, nevertheless
    they are straight fixes that deserve merging to 4.14 final.

    Most of fixes are about ALSA core bugs spotted by fuzzer: a follow-up
    fix for the previous nested rwsem patch, a fix to avoid the resource
    hogs due to too many concurrent ALSA timer invocations, and a fix for
    a crash with SYSEX MIDI transfer over OSS sequencer emulation that is
    used by none but fuzzer.

    The rest are usual HD-audio and USB-audio device-specific quirks,
    which are safe to apply"

    * tag 'sound-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
    ALSA: hda - fix headset mic problem for Dell machines with alc274
    ALSA: seq: Fix OSS sysex delivery in OSS emulation
    ALSA: seq: Avoid invalid lockdep class warning
    ALSA: timer: Limit max instances per timer
    ALSA: usb-audio: support new Amanero Combo384 firmware version

    Linus Torvalds
     

09 Nov, 2017

1 commit


07 Nov, 2017

1 commit

  • The SYSEX event delivery in OSS sequencer emulation assumed that the
    event is encoded in the variable-length data with the straight
    buffering. This was the normal behavior in the past, but during the
    development, the chained buffers were introduced for carrying more
    data, while the OSS code was left intact. As a result, when a SYSEX
    event with the chained buffer data is passed to OSS sequencer port,
    it may end up with the wrong memory access, as if it were having a too
    large buffer.

    This patch addresses the bug, by applying the buffer data expansion by
    the generic snd_seq_dump_var_event() helper function.

    Reported-by: syzbot
    Reported-by: Mark Salyzyn
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

06 Nov, 2017

1 commit

  • Currently we allow unlimited number of timer instances, and it may
    bring the system hogging way too much CPU when too many timer
    instances are opened and processed concurrently. This may end up with
    a soft-lockup report as triggered by syzkaller, especially when
    hrtimer backend is deployed.

    Since such insane number of instances aren't demanded by the normal
    use case of ALSA sequencer and it merely opens a risk only for abuse,
    this patch introduces the upper limit for the number of instances per
    timer backend. As default, it's set to 1000, but for the fine-grained
    timer like hrtimer, it's set to 100.

    Reported-by: syzbot
    Tested-by: Jérôme Glisse
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

03 Nov, 2017

1 commit

  • …el/git/gregkh/driver-core

    Pull initial SPDX identifiers from Greg KH:
    "License cleanup: add SPDX license identifiers to some files

    Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the
    'GPL-2.0' SPDX license identifier. The SPDX identifier is a legally
    binding shorthand, which can be used instead of the full boiler plate
    text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart
    and Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset
    of the use cases:

    - file had no licensing information it it.

    - file was a */uapi/* one with no licensing information in it,

    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to
    license had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied
    to a file was done in a spreadsheet of side by side results from of
    the output of two independent scanners (ScanCode & Windriver)
    producing SPDX tag:value files created by Philippe Ombredanne.
    Philippe prepared the base worksheet, and did an initial spot review
    of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537
    files assessed. Kate Stewart did a file by file comparison of the
    scanner results in the spreadsheet to determine which SPDX license
    identifier(s) to be applied to the file. She confirmed any
    determination that was not immediately clear with lawyers working with
    the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:

    - Files considered eligible had to be source code files.

    - Make and config files were included as candidates if they contained
    >5 lines of source

    - File already had some variant of a license header in it (even if <5
    lines).

    All documentation files were explicitly excluded.

    The following heuristics were used to determine which SPDX license
    identifiers to apply.

    - when both scanners couldn't find any license traces, file was
    considered to have no license information in it, and the top level
    COPYING file license applied.

    For non */uapi/* files that summary was:

    SPDX license identifier # files
    ---------------------------------------------------|-------
    GPL-2.0 11139

    and resulted in the first patch in this series.

    If that file was a */uapi/* path one, it was "GPL-2.0 WITH
    Linux-syscall-note" otherwise it was "GPL-2.0". Results of that
    was:

    SPDX license identifier # files
    ---------------------------------------------------|-------
    GPL-2.0 WITH Linux-syscall-note 930

    and resulted in the second patch in this series.

    - if a file had some form of licensing information in it, and was one
    of the */uapi/* ones, it was denoted with the Linux-syscall-note if
    any GPL family license was found in the file or had no licensing in
    it (per prior point). Results summary:

    SPDX license identifier # files
    ---------------------------------------------------|------
    GPL-2.0 WITH Linux-syscall-note 270
    GPL-2.0+ WITH Linux-syscall-note 169
    ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
    ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
    LGPL-2.1+ WITH Linux-syscall-note 15
    GPL-1.0+ WITH Linux-syscall-note 14
    ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
    LGPL-2.0+ WITH Linux-syscall-note 4
    LGPL-2.1 WITH Linux-syscall-note 3
    ((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
    ((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1

    and that resulted in the third patch in this series.

    - when the two scanners agreed on the detected license(s), that
    became the concluded license(s).

    - when there was disagreement between the two scanners (one detected
    a license but the other didn't, or they both detected different
    licenses) a manual inspection of the file occurred.

    - In most cases a manual inspection of the information in the file
    resulted in a clear resolution of the license that should apply
    (and which scanner probably needed to revisit its heuristics).

    - When it was not immediately clear, the license identifier was
    confirmed with lawyers working with the Linux Foundation.

    - If there was any question as to the appropriate license identifier,
    the file was flagged for further research and to be revisited later
    in time.

    In total, over 70 hours of logged manual review was done on the
    spreadsheet to determine the SPDX license identifiers to apply to the
    source files by Kate, Philippe, Thomas and, in some cases,
    confirmation by lawyers working with the Linux Foundation.

    Kate also obtained a third independent scan of the 4.13 code base from
    FOSSology, and compared selected files where the other two scanners
    disagreed against that SPDX file, to see if there was new insights.
    The Windriver scanner is based on an older version of FOSSology in
    part, so they are related.

    Thomas did random spot checks in about 500 files from the spreadsheets
    for the uapi headers and agreed with SPDX license identifier in the
    files he inspected. For the non-uapi files Thomas did random spot
    checks in about 15000 files.

    In initial set of patches against 4.14-rc6, 3 files were found to have
    copy/paste license identifier errors, and have been fixed to reflect
    the correct identifier.

    Additionally Philippe spent 10 hours this week doing a detailed manual
    inspection and review of the 12,461 patched files from the initial
    patch version early this week with:

    - a full scancode scan run, collecting the matched texts, detected
    license ids and scores

    - reviewing anything where there was a license detected (about 500+
    files) to ensure that the applied SPDX license was correct

    - reviewing anything where there was no detection but the patch
    license was not GPL-2.0 WITH Linux-syscall-note to ensure that the
    applied SPDX license was correct

    This produced a worksheet with 20 files needing minor correction. This
    worksheet was then exported into 3 different .csv files for the
    different types of files to be modified.

    These .csv files were then reviewed by Greg. Thomas wrote a script to
    parse the csv files and add the proper SPDX tag to the file, in the
    format that the file expected. This script was further refined by Greg
    based on the output to detect more types of files automatically and to
    distinguish between header and source .c files (which need different
    comment types.) Finally Greg ran the script using the .csv files to
    generate the patches.

    Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
    Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
    Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

    * tag 'spdx_identifiers-4.14-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    License cleanup: add SPDX license identifier to uapi header files with a license
    License cleanup: add SPDX license identifier to uapi header files with no license
    License cleanup: add SPDX GPL-2.0 license identifier to files with no license

    Linus Torvalds
     

02 Nov, 2017

3 commits

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Support DSD_U32_BE sample format on new Amanero Combo384 firmware
    version on older VID/PID.

    Fixes: 3eff682d765b ("ALSA: usb-audio: Support both DSD LE/BE Amanero firmware versions")
    Signed-off-by: Jussi Laako
    Cc:
    Signed-off-by: Takashi Iwai

    Jussi Laako
     
  • …t/broonie/sound into for-linus

    ASoC: Fixes for v4.14

    A bunch of fixes here, mostly device specific ones (the biggest one
    being the revert of the hotword support for rt5514), with a couple of
    core fixes for potential issues with corrupted or otherwise invalid
    topology files.

    Takashi Iwai
     

01 Nov, 2017

1 commit


31 Oct, 2017

2 commits

  • syzkaller reported the lockdep splat due to the possible deadlock of
    grp->list_mutex of each sequencer client object. Actually this is
    rather a false-positive report due to the missing nested lock
    annotations. The sequencer client may deliver the event directly to
    another client which takes another own lock.

    For addressing this issue, this patch replaces the simple down_read()
    with down_read_nested(). As a lock subclass, the already existing
    "hop" can be re-used, which indicates the depth of the call.

    Reference: http://lkml.kernel.org/r/089e082686ac9b482e055c832617@google.com
    Reported-by: syzbot
    Reported-by: Dmitry Vyukov
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The races among ioctl and other operations were protected by the
    commit af368027a49a ("ALSA: timer: Fix race among timer ioctls") and
    later fixes, but one code path was forgotten in the scenario: the
    32bit compat ioctl. As syzkaller recently spotted, a very similar
    use-after-free may happen with the combination of compat ioctls.

    The fix is simply to apply the same ioctl_lock to the compat_ioctl
    callback, too.

    Fixes: af368027a49a ("ALSA: timer: Fix race among timer ioctls")
    Reference: http://lkml.kernel.org/r/089e082686ac9b482e055c832617@google.com
    Reported-by: syzbot
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

24 Oct, 2017

1 commit


21 Oct, 2017

1 commit


20 Oct, 2017

1 commit


18 Oct, 2017

6 commits

  • "Charge Pump" is necessary for "LOUT Amp".

    Signed-off-by: Bard Liao
    Signed-off-by: Mark Brown

    Bard Liao
     
  • There is a power bit for LOUT Amp.

    Signed-off-by: Bard Liao
    Signed-off-by: Mark Brown

    Bard Liao
     
  • The commit 99b5c5bb9a54 ("ALSA: hda - Remove the use of set_fs()")
    converted the get_kctl_0dB_offset() call for killing set_fs() usage in
    HD-audio codec code. The conversion assumed that the TLV callback
    used in HD-audio code is only snd_hda_mixer_amp() and applies the TLV
    calculation locally.

    Although this assumption is correct, and all slave kctls are actually
    with that callback, the current code is still utterly buggy; it
    doesn't hit this condition and falls back to the next check. It's
    because the function gets called after adding slave kctls to vmaster.
    By assigning a slave kctl, the slave kctl object is faked inside
    vmaster code, and the whole kctl ops are overridden. Thus the
    callback op points to a different value from what we've assumed.

    More badly, as reported by the KERNEXEC and UDEREF features of PaX,
    the code flow turns into the unexpected pitfall. The next fallback
    check is SNDRV_CTL_ELEM_ACCESS_TLV_READ access bit, and this always
    hits for each kctl with TLV. Then it evaluates the callback function
    pointer wrongly as if it were a TLV array. Although currently its
    side-effect is fairly limited, this incorrect reference may lead to an
    unpleasant result.

    For addressing the regression, this patch introduces a new helper to
    vmaster code, snd_ctl_apply_vmaster_slaves(). This works similarly
    like the existing map_slaves() in hda_codec.c: it loops over the slave
    list of the given master, and applies the given function to each
    slave. Then the initializer function receives the right kctl object
    and we can compare the correct pointer instead of the faked one.

    Also, for catching the similar breakage in future, give an error
    message when the unexpected TLV callback is found and bail out
    immediately.

    Fixes: 99b5c5bb9a54 ("ALSA: hda - Remove the use of set_fs()")
    Reported-by: PaX Team
    Cc: # v4.13
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • While converting the error messages to the standard macros in the
    commit 4e76a8833fac ("ALSA: hda - Replace with standard printk"), a
    superfluous '-' slipped in the code mistakenly. Its influence is
    almost negligible, merely shows a dB value as negative integer instead
    of positive integer (or vice versa) in the rare error message.
    So let's kill this embarrassing byte to show more correct value.

    Fixes: 4e76a8833fac ("ALSA: hda - Replace with standard printk")
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The loop in snd_hdac_bus_parse_capabilities() may go to nirvana when
    it hits an invalid register value read:

    BUG: unable to handle kernel paging request at ffffad5dc41f3fff
    IP: pci_azx_readl+0x5/0x10 [snd_hda_intel]
    Call Trace:
    snd_hdac_bus_parse_capabilities+0x3c/0x1f0 [snd_hda_core]
    azx_probe_continue+0x7d5/0x940 [snd_hda_intel]
    .....

    This happened on a new Intel machine, and we need to check the value
    and abort the loop accordingly.

    [Note: the fixes tag below indicates only the commit where this patch
    can be applied; the original problem was introduced even before that
    commit]

    Fixes: 6720b38420a0 ("ALSA: hda - move bus_parse_capabilities to core")
    Cc:
    Acked-by: Vinod Koul
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The 'use' locking macros are no-ops if neither SMP or SND_DEBUG is
    enabled. This might once have been OK in non-preemptible
    configurations, but even in that case snd_seq_read() may sleep while
    relying on a 'use' lock. So always use the proper implementations.

    Cc: stable@vger.kernel.org
    Signed-off-by: Ben Hutchings
    Signed-off-by: Takashi Iwai

    Ben Hutchings
     

16 Oct, 2017

1 commit


11 Oct, 2017

1 commit