29 Sep, 2010

1 commit

  • The snd_ctl_new() function in sound/core/control.c allocates space for a
    snd_kcontrol struct by performing arithmetic operations on a
    user-provided size without checking for integer overflow. If a user
    provides a large enough size, an overflow will occur, the allocated
    chunk will be too small, and a second user-influenced value will be
    written repeatedly past the bounds of this chunk. This code is
    reachable by unprivileged users who have permission to open
    a /dev/snd/controlC* device (on many distros, this is group "audio") via
    the SNDRV_CTL_IOCTL_ELEM_ADD and SNDRV_CTL_IOCTL_ELEM_REPLACE ioctls.

    Signed-off-by: Dan Rosenberg
    Cc:
    Signed-off-by: Takashi Iwai

    Dan Rosenberg
     

13 Apr, 2010

1 commit

  • Set no_llseek to llseek file ops of each sound component (but for hwdep).
    This avoids the implicit BKL invocation via generic_file_llseek() used
    as default when fops.llseek is NULL.

    Also call nonseekable_open() at each open ops to ensure the file flags
    have no seek bit.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

01 Feb, 2010

2 commits


04 Dec, 2009

1 commit


18 Nov, 2009

1 commit

  • This function is only called from snd_ctl_ioctl() and the file parameter
    can never be null so there is no need to check it here.

    We dereference file at the start of the function:
    struct snd_card *card = file->card;
    and it confuses static checkers to dereference a pointer before
    checking it.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Takashi Iwai

    Dan Carpenter
     

06 Nov, 2009

2 commits


17 Aug, 2009

4 commits


14 Apr, 2009

1 commit


16 Mar, 2009

1 commit

  • Most fasync implementations do something like:

    return fasync_helper(...);

    But fasync_helper() will return a positive value at times - a feature used
    in at least one place. Thus, a number of other drivers do:

    err = fasync_helper(...);
    if (err < 0)
    return err;
    return 0;

    In the interests of consistency and more concise code, it makes sense to
    map positive return values onto zero where ->fasync() is called.

    Cc: Al Viro
    Signed-off-by: Jonathan Corbet

    Jonathan Corbet
     

02 Nov, 2008

1 commit

  • As it is, all instances of ->release() for files that have ->fasync()
    need to remember to evict file from fasync lists; forgetting that
    creates a hole and we actually have a bunch that *does* forget.

    So let's keep our lives simple - let __fput() check FASYNC in
    file->f_flags and call ->fasync() there if it's been set. And lose that
    crap in ->release() instances - leaving it there is still valid, but we
    don't have to bother anymore.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

29 Oct, 2008

1 commit


09 Sep, 2008

1 commit


13 Aug, 2008

1 commit


13 Jun, 2008

1 commit


01 Feb, 2008

2 commits

  • This header file exists only for some hacks to adapt alsa-driver
    tree. It's useless for building in the kernel. Let's move a few
    lines in it to sound/core.h and remove it.
    With this patch, sound/driver.h isn't removed but has just a single
    compile warning to include it. This should be really killed in
    future.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Jaroslav Kysela

    Takashi Iwai
     
  • This patch removes the indirect control access to the control elements.
    The indirect access has never been used and is even broken on 32bit
    ioctl wrapper. Let's clean it up.
    The pointers still remain in snd_ctl_elem_* structs just to make sure
    that the struct size won't change. Once after checking the size
    consistency, we can get rid of them, too.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Jaroslav Kysela

    Takashi Iwai
     

23 Oct, 2007

1 commit


16 Oct, 2007

3 commits


09 May, 2007

1 commit


13 Feb, 2007

1 commit

  • Many struct file_operations in the kernel can be "const". Marking them const
    moves these to the .rodata section, which avoids false sharing with potential
    dirty data. In addition it'll catch accidental writes at compile time to
    these shared resources.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

09 Feb, 2007

2 commits


20 Dec, 2006

1 commit


22 Oct, 2006

1 commit


23 Sep, 2006

6 commits


23 Jun, 2006

1 commit


31 Mar, 2006

1 commit


22 Mar, 2006

1 commit