1. 06 Nov, 2017 3 commits
  2. 31 Oct, 2017 1 commit
    • Takashi Iwai's avatar
      sound: Retire OSS · 727dede0
      Takashi Iwai authored
      Since no complaints have been raised after disabling the build of OSS
      (Open Sound System) by the commit 31cbee6a ("sound: Disable the
      build of OSS drivers"), let's finally drop the whole code and
      documentation.
      
      Some glue codes are still left intact since sound/oss/dmasound stuff
      remains -- which is an independent implementation solely for m68k, and
      it's not covered by ALSA yet.
      
      Also, a couple of API header files (linux/sound.h and
      linux/soundcard.h) are kept remaining as well, since the OSS API
      itself is still supported by ALSA OSS emulation, and applications can
      refer to these.
      
      Where we're at it, some help texts in the top-level Kconfig are
      adjusted, too (who still needs to specify I/O port in kbuild
      nowadays?).
      Reviewed-by: default avatarJaroslav Kysela <perex@perex.cz>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      727dede0
  3. 30 Oct, 2017 1 commit
  4. 26 Oct, 2017 2 commits
  5. 25 Oct, 2017 2 commits
    • Takashi Iwai's avatar
      ALSA: sb: Minor optimization / fix of timer usage in sb8_midi.c · 20e5f8bf
      Takashi Iwai authored
      Currently the SB8 MIDI code sets up the timer object at each time
      before scheduling it at trigger callback, but basically this is
      superfluous once after set up.  Also, the code misses the
      del_timer_sync() call that may leave a race condition for
      use-after-free.
      
      This patch addresses these issues, moving timer_setup() to
      snd_sb8dsp_midi(), and adding the del_timer_sync() call at
      snd_sb8dsp_midi_output_trigger() to make sure.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      20e5f8bf
    • Kees Cook's avatar
      ALSA: sb: Convert timers to use timer_setup() · 4f928246
      Kees Cook authored
      In preparation for unconditionally passing the struct timer_list pointer to
      all timer callbacks, switch to using the new timer_setup() and from_timer()
      to pass the timer pointer explicitly.
      
      [Re-use the existing chip->midi_substream_output instead of assigning
       a new field to struct snd_sb -- tiwai]
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      4f928246
  6. 24 Oct, 2017 5 commits
  7. 19 Oct, 2017 1 commit
    • Takashi Iwai's avatar
      ALSA: hda: Avoid racy recreation of widget kobjects · 9780ded3
      Takashi Iwai authored
      The refresh of HD-audio widget sysfs kobjects via
      snd_hdac_refresh_widget_sysfs() is slightly racy.
      The driver recreates the whole tree from scratch after deleting the
      whole.  When CONFIG_DEBUG_KOBJECT_RELEASE option is used, kobject
      release doesn't happen immediately but delayed, while the re-creation
      of the same named kobject happens soon after invoking kobject_put().
      This may end up with the conflicts of duplicated kobjects, as found in
      the bug report below.
      
      In this patch, we take another approach to refresh the tree: instead
      of recreating the whole tree, just add the new nodes and delete the
      non-existing nodes.  Since the refresh happens only once at
      initialization, no longer race would happen.
      
      Along with the code change, merge snd_hdac_refresh_widget_sysfs() with
      the existing snd_hdac_refresh_widgets() with an additional bool flag
      for simplifying the code.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=197307Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      9780ded3
  8. 18 Oct, 2017 3 commits
  9. 17 Oct, 2017 4 commits
  10. 16 Oct, 2017 5 commits
  11. 13 Oct, 2017 2 commits
  12. 11 Oct, 2017 11 commits
    • Takashi Iwai's avatar
      ALSA: caiaq: Fix stray URB at probe error path · 99fee508
      Takashi Iwai authored
      caiaq driver doesn't kill the URB properly at its error path during
      the probe, which may lead to a use-after-free error later.  This patch
      addresses it.
      Reported-by: default avatarJohan Hovold <johan@kernel.org>
      Reviewed-by: default avatarJohan Hovold <johan@kernel.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      99fee508
    • Takashi Iwai's avatar
      Merge branch 'topic/usb-ep-check-v2' into for-next · 8ed5d192
      Takashi Iwai authored
      Pulling the EP validity checks in USB audio drivers.
      It also adds a new helper in USB core, which was acked by Greg.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      8ed5d192
    • Takashi Iwai's avatar
      ALSA: line6: Add yet more sanity checks for invalid EPs · 4f95646c
      Takashi Iwai authored
      There are a few other places calling usb_submit_urb() with the URB
      composed from the fixed endpoint without validation.  For avoiding the
      spurious kernel warnings, add the sanity checks to appropriate
      places.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      4f95646c
    • Takashi Iwai's avatar
      ALSA: caiaq: Add yet more sanity checks for invalid EPs · 96cd7962
      Takashi Iwai authored
      A few other places in caiaq driver have the URB handling with the
      fixed endpoints without checking the validity, too.  Add the sanity
      check with the new helper function at each appropriate place for
      avoiding the spurious kernel warnings due to invalid EPs.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      96cd7962
    • Takashi Iwai's avatar
      ALSA: hiface: Add sanity checks for invalid EPs · 5935b952
      Takashi Iwai authored
      hiface usb-audio driver sets up URBs containing the fixed endpoints
      without validation.  This may end up with an oops-like kernel warning
      when submitted.
      
      For avoiding it, this patch adds the calls of the new sanity-check
      helper for URBs.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      5935b952
    • Takashi Iwai's avatar
      ALSA: usx2y: Add sanity checks for invalid EPs · 1f100349
      Takashi Iwai authored
      usx2y driver sets up URBs containing the fixed endpoints without
      validation.  This may end up with an oops-like kernel warning when
      submitted.
      
      For avoiding it, this patch adds the calls of the new sanity-check
      helper for URBs.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      1f100349
    • Takashi Iwai's avatar
      ALSA: usb-audio: Add sanity checks for invalid EPs · 738d9edc
      Takashi Iwai authored
      USB-audio driver may set up a URB containing the fixed EP without
      validating its presence for some non-class-compliant devices.  This
      may end up with an oops-like kernel warning when submitted.
      
      For avoiding it, this patch adds the call of the new sanity-check
      helper for URBs.  The checks are needed only for MIDI I/O as the other
      places have already some other checks.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      738d9edc
    • Takashi Iwai's avatar
      ALSA: line6: Add a sanity check for invalid EPs · 2a4340c5
      Takashi Iwai authored
      As syzkaller spotted, currently line6 drivers submit a URB with the
      fixed EP without checking whether it's actually available, which may
      result in a kernel warning like:
        usb 1-1: BOGUS urb xfer, pipe 3 != type 1
        ------------[ cut here ]------------
        WARNING: CPU: 0 PID: 24 at drivers/usb/core/urb.c:449
        usb_submit_urb+0xf8a/0x11d0
        Modules linked in:
        CPU: 0 PID: 24 Comm: kworker/0:1 Not tainted 4.14.0-rc2-42613-g1488251d1a98 #238
        Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
        Workqueue: usb_hub_wq hub_event
        Call Trace:
         line6_start_listen+0x55f/0x9e0 sound/usb/line6/driver.c:82
         line6_init_cap_control sound/usb/line6/driver.c:690
         line6_probe+0x7c9/0x1310 sound/usb/line6/driver.c:764
         podhd_probe+0x64/0x70 sound/usb/line6/podhd.c:474
         usb_probe_interface+0x35d/0x8e0 drivers/usb/core/driver.c:361
         ....
      
      This patch adds a sanity check of validity of EPs at the device
      initialization phase for avoiding the call with an invalid EP.
      Reported-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Tested-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      2a4340c5
    • Takashi Iwai's avatar
      ALSA: caiaq: Add a sanity check for invalid EPs · 58fc7f73
      Takashi Iwai authored
      As syzkaller spotted, currently caiaq driver submits a URB with the
      fixed EP without checking whether it's actually available, which may
      result in a kernel warning like:
        usb 1-1: BOGUS urb xfer, pipe 3 != type 1
        ------------[ cut here ]------------
        WARNING: CPU: 1 PID: 1150 at drivers/usb/core/urb.c:449
        usb_submit_urb+0xf8a/0x11d0
        Modules linked in:
        CPU: 1 PID: 1150 Comm: kworker/1:1 Not tainted
        4.14.0-rc2-42660-g24b7bd59eec0 #277
        Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
        Workqueue: usb_hub_wq hub_event
        Call Trace:
         init_card sound/usb/caiaq/device.c:467
         snd_probe+0x81c/0x1150 sound/usb/caiaq/device.c:525
         usb_probe_interface+0x35d/0x8e0 drivers/usb/core/driver.c:361
         ....
      
      This patch adds a sanity check of validity of EPs at the device
      initialization phase for avoiding the call with an invalid EP.
      Reported-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Tested-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      58fc7f73
    • Takashi Iwai's avatar
      ALSA: bcd2000: Add a sanity check for invalid EPs · 6815a0b4
      Takashi Iwai authored
      As syzkaller spotted, currently bcd2000 driver submits a URB with the
      fixed EP without checking whether it's actually available, which may
      result in a kernel warning like:
        usb 1-1: BOGUS urb xfer, pipe 1 != type 3
        ------------[ cut here ]------------
        WARNING: CPU: 0 PID: 1846 at drivers/usb/core/urb.c:449
        usb_submit_urb+0xf8a/0x11d0
        Modules linked in:
        CPU: 0 PID: 1846 Comm: kworker/0:2 Not tainted
        4.14.0-rc2-42613-g1488251d1a98 #238
        Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
        Workqueue: usb_hub_wq hub_event
        Call Trace:
         bcd2000_init_device sound/usb/bcd2000/bcd2000.c:289
         bcd2000_init_midi sound/usb/bcd2000/bcd2000.c:345
         bcd2000_probe+0xe64/0x19e0 sound/usb/bcd2000/bcd2000.c:406
         usb_probe_interface+0x35d/0x8e0 drivers/usb/core/driver.c:361
         ....
      
      This patch adds a sanity check of validity of EPs at the device
      initialization phase for avoiding the call with an invalid EP.
      Reported-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Tested-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      6815a0b4
    • Takashi Iwai's avatar
      usb: core: Add a helper function to check the validity of EP type in URB · e901b987
      Takashi Iwai authored
      This patch adds a new helper function to perform a sanity check of the
      given URB to see whether it contains a valid endpoint.  It's a light-
      weight version of what usb_submit_urb() does, but without the kernel
      warning followed by the stack trace, just returns an error code.
      
      Especially for a driver that doesn't parse the descriptor but fills
      the URB with the fixed endpoint (e.g. some quirks for non-compliant
      devices), this kind of check is preferable at the probe phase before
      actually submitting the urb.
      Tested-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e901b987