08 Jan, 2012

1 commit

  • A malicious USB device may feed in carefully crafted min/max/res values,
    so that the inner loop in parse_uac2_sample_rate_range() could run for
    a long time or even never terminate, e.g., given max = INT_MAX.

    Also nr_rates could be a large integer, which causes an integer overflow
    in the subsequent call to kmalloc() in parse_audio_format_rates_v2().
    Thus, kmalloc() would allocate a smaller buffer than expected, leading
    to a memory corruption.

    To exploit the two vulnerabilities, an attacker needs physical access
    to the machine to plug in a malicious USB device.

    This patch makes two changes.

    1) The type of "rate" is changed to unsigned int, so that the loop could
    stop once "rate" is larger than INT_MAX.

    2) Limit nr_rates to 1024.

    Suggested-by: Takashi Iwai
    Signed-off-by: Xi Wang
    Signed-off-by: Takashi Iwai

    Xi Wang
     

27 Sep, 2011

1 commit

  • There are certain devices that are reportedly so slow that they need
    more than 100 ms to handle control transfers. Therefore, increase the
    timeout in mixer(_quirks).c to 1000 ms.

    The timeout parameter of snd_usb_ctl_msg() is now constant, so we can
    drop it.

    Reported-by: Felipe Balbi
    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     

22 May, 2011

1 commit


18 May, 2011

1 commit


29 Apr, 2011

1 commit


10 Jan, 2011

1 commit


04 Sep, 2010

1 commit

  • The Audio Class v2 support code in 2.6.35 added checks for the
    bInterfaceProtocol field. However, there are devices (usually those
    detected by vendor-specific quirks) that do not have one of the
    predefined values in this field, which made the driver reject them.

    To fix this regression, restore the old behaviour, i.e., assume that
    a device with an unknown bInterfaceProtocol field (other than
    UAC_VERSION_2) has more or less UAC-v1-compatible descriptors.

    [compile warning fixes by tiwai]

    Signed-off-by: Clemens Ladisch
    Cc: Daniel Mack
    Cc:
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     

15 Aug, 2010

1 commit

  • Gcc complains that ret might be used uninitialized:

    sound/usb/format.c: In function ‘snd_usb_parse_audio_format’:
    sound/usb/format.c:354: warning: ‘ret’ may be used uninitialized in this function
    sound/usb/format.c:354: note: ‘ret’ was declared here
    sound/usb/format.c:414: warning: ‘ret’ may be used uninitialized in this function
    sound/usb/format.c:414: note: ‘ret’ was declared here

    I suppose it could be uninitialized if there is ever a UAC_VERSION_3
    released. Anyway this patch is worthwhile if only to silence the gcc
    warning.

    Signed-off-by: Dan Carpenter
    Acked-by: Daniel Mack
    Signed-off-by: Takashi Iwai

    Dan Carpenter
     

23 Jun, 2010

1 commit


12 Jun, 2010

3 commits


01 Jun, 2010

1 commit

  • Audio devices which comply to the UAC2 standard can export complex clock
    topologies in its descriptors and set up links between them.

    The entities that are defined are

    - clock sources, which define the end-leafs.
    - clock selectors, which act as switch to select one out of many
    possible clocks sources.
    - clock multipliers, which have an input clock source, and act as clock
    source again. They can be used to derive one clock from another.

    All sample rate changes, clock validity queries and the like must go to
    clock source elements, while clock selectors and multipliers can be used
    as terminal clock source.

    The following patch adds a parser for these elements and functions to
    iterate over the tree and find the leaf nodes (clock sources).

    The samplerate set functions were moved to the new clock.c file.

    Signed-off-by: Daniel Mack
    Signed-off-by: Takashi Iwai

    Daniel Mack
     

27 May, 2010

2 commits


29 Mar, 2010

1 commit


12 Mar, 2010

2 commits


05 Mar, 2010

3 commits

  • Change the parser to correctly handle v2 descriptors with multiple
    format bits set.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     
  • In preparation for USB audio 2.0 support, change the audioformat
    structure so that it uses a bitmask to specify possible formats.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     
  • Clean up the usb audio driver by factoring out a lot of functions to
    separate files. Code for procfs, quirks, urbs, format parsers etc all
    got a new home now.

    Moved almost all special quirk handling to quirks.c and introduced new
    generic functions to handle them, so the exceptions do not pollute the
    whole driver.

    Renamed usbaudio.c to card.c because this is what it actually does now.
    Renamed usbmidi.c to midi.c for namespace clarity.
    Removed more things from usbaudio.h.

    The non-standard drivers were adopted accordingly.

    Signed-off-by: Daniel Mack
    Cc: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Daniel Mack