1. 02 4月, 2013 1 次提交
  2. 15 3月, 2013 1 次提交
  3. 23 2月, 2013 1 次提交
  4. 04 1月, 2013 1 次提交
  5. 07 12月, 2012 1 次提交
  6. 18 11月, 2012 1 次提交
  7. 07 10月, 2012 1 次提交
    • A
      ARM: footbridge: nw_gpio_lock is raw_spin_lock · 45ef6ac6
      Arnd Bergmann 提交于
      bd31b859 "locking, ARM: Annotate low level hw locks as raw"
      made nw_gpio_lock a raw spinlock, but did not change all the
      users in device drivers. This fixes the remaining ones.
      
      sound/oss/waveartist.c: In function 'vnc_mute_spkr':
      sound/oss/waveartist.c:1485:2: warning: passing argument 1 of 'spinlock_check' from incompatible pointer type [enabled by default]
      include/linux/spinlock.h:272:102: note: expected 'struct spinlock_t *' but argument is of type 'struct raw_spinlock_t *'
      drivers/char/ds1620.c: In function 'netwinder_lock':
      drivers/char/ds1620.c:77:2: warning: passing argument 1 of 'spinlock_check' from incompatible pointer type [enabled by default]
      include/linux/spinlock.h:272:102: note: expected 'struct spinlock_t *' but argument is of type 'struct raw_spinlock_t *'
      drivers/char/nwflash.c: In function 'kick_open':
      drivers/char/nwflash.c:620:2: warning: passing argument 1 of 'spinlock_check' from incompatible pointer type [enabled by default]
      include/linux/spinlock.h:272:102: note: expected 'struct spinlock_t *' but argument is of type 'struct raw_spinlock_t *'
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      45ef6ac6
  8. 06 10月, 2012 1 次提交
  9. 01 9月, 2012 1 次提交
  10. 20 8月, 2012 1 次提交
  11. 20 6月, 2012 1 次提交
  12. 03 6月, 2012 1 次提交
  13. 10 4月, 2012 1 次提交
  14. 29 3月, 2012 2 次提交
  15. 19 12月, 2011 1 次提交
  16. 23 11月, 2011 1 次提交
  17. 29 9月, 2011 1 次提交
  18. 28 9月, 2011 1 次提交
    • P
      doc: fix broken references · 395cf969
      Paul Bolle 提交于
      There are numerous broken references to Documentation files (in other
      Documentation files, in comments, etc.). These broken references are
      caused by typo's in the references, and by renames or removals of the
      Documentation files. Some broken references are simply odd.
      
      Fix these broken references, sometimes by dropping the irrelevant text
      they were part of.
      Signed-off-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      395cf969
  19. 08 8月, 2011 1 次提交
  20. 04 8月, 2011 1 次提交
  21. 28 7月, 2011 1 次提交
  22. 20 5月, 2011 1 次提交
  23. 31 3月, 2011 1 次提交
  24. 24 3月, 2011 2 次提交
    • D
      sound/oss/opl3: validate voice and channel indexes · 4d00135a
      Dan Rosenberg 提交于
      User-controllable indexes for voice and channel values may cause reading
      and writing beyond the bounds of their respective arrays, leading to
      potentially exploitable memory corruption.  Validate these indexes.
      Signed-off-by: NDan Rosenberg <drosenberg@vsecurity.com>
      Cc: stable@kernel.org
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4d00135a
    • D
      sound/oss: remove offset from load_patch callbacks · b769f494
      Dan Rosenberg 提交于
      Was: [PATCH] sound/oss/midi_synth: prevent underflow, use of
      uninitialized value, and signedness issue
      
      The offset passed to midi_synth_load_patch() can be essentially
      arbitrary.  If it's greater than the header length, this will result in
      a copy_from_user(dst, src, negative_val).  While this will just return
      -EFAULT on x86, on other architectures this may cause memory corruption.
      Additionally, the length field of the sysex_info structure may not be
      initialized prior to its use.  Finally, a signed comparison may result
      in an unintentionally large loop.
      
      On suggestion by Takashi Iwai, version two removes the offset argument
      from the load_patch callbacks entirely, which also resolves similar
      issues in opl3.  Compile tested only.
      
      v3 adjusts comments and hopefully gets copy offsets right.
      Signed-off-by: NDan Rosenberg <drosenberg@vsecurity.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      b769f494
  25. 10 3月, 2011 1 次提交
    • T
      sound: Use sound_register_*() for additional OSS minor devices · 848669da
      Takashi Iwai 提交于
      Since OSS driver creates the device entries for /dev/audio* and
      /dev/dspW* by itself without coping with sound_core, it leads to
      conflicts with others and let sysfs spewing warnings.
      
      This patch rewrites the registration part of OSS driver to use
      the standard method also for additional minor devices.
      
      Reported-by: Steven Rostedt <rostedt@goodmis.org> (with ktest.pl)
      Tested-by: Steven Rostedt <rostedt@goodmis.org> (with ktest.pl)
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      848669da
  26. 31 1月, 2011 1 次提交
  27. 30 12月, 2010 1 次提交
    • D
      sound: Prevent buffer overflow in OSS load_mixer_volumes · d81a12bc
      Dan Rosenberg 提交于
      The load_mixer_volumes() function, which can be triggered by
      unprivileged users via the SOUND_MIXER_SETLEVELS ioctl, is vulnerable to
      a buffer overflow.  Because the provided "name" argument isn't
      guaranteed to be NULL terminated at the expected 32 bytes, it's possible
      to overflow past the end of the last element in the mixer_vols array.
      Further exploitation can result in an arbitrary kernel write (via
      subsequent calls to load_mixer_volumes()) leading to privilege
      escalation, or arbitrary kernel reads via get_mixer_levels().  In
      addition, the strcmp() may leak bytes beyond the mixer_vols array.
      Signed-off-by: NDan Rosenberg <drosenberg@vsecurity.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d81a12bc
  28. 11 11月, 2010 2 次提交
  29. 27 10月, 2010 1 次提交
  30. 18 10月, 2010 1 次提交
  31. 15 10月, 2010 1 次提交
    • A
      llseek: automatically add .llseek fop · 6038f373
      Arnd Bergmann 提交于
      All file_operations should get a .llseek operation so we can make
      nonseekable_open the default for future file operations without a
      .llseek pointer.
      
      The three cases that we can automatically detect are no_llseek, seq_lseek
      and default_llseek. For cases where we can we can automatically prove that
      the file offset is always ignored, we use noop_llseek, which maintains
      the current behavior of not returning an error from a seek.
      
      New drivers should normally not use noop_llseek but instead use no_llseek
      and call nonseekable_open at open time.  Existing drivers can be converted
      to do the same when the maintainer knows for certain that no user code
      relies on calling seek on the device file.
      
      The generated code is often incorrectly indented and right now contains
      comments that clarify for each added line why a specific variant was
      chosen. In the version that gets submitted upstream, the comments will
      be gone and I will manually fix the indentation, because there does not
      seem to be a way to do that using coccinelle.
      
      Some amount of new code is currently sitting in linux-next that should get
      the same modifications, which I will do at the end of the merge window.
      
      Many thanks to Julia Lawall for helping me learn to write a semantic
      patch that does all this.
      
      ===== begin semantic patch =====
      // This adds an llseek= method to all file operations,
      // as a preparation for making no_llseek the default.
      //
      // The rules are
      // - use no_llseek explicitly if we do nonseekable_open
      // - use seq_lseek for sequential files
      // - use default_llseek if we know we access f_pos
      // - use noop_llseek if we know we don't access f_pos,
      //   but we still want to allow users to call lseek
      //
      @ open1 exists @
      identifier nested_open;
      @@
      nested_open(...)
      {
      <+...
      nonseekable_open(...)
      ...+>
      }
      
      @ open exists@
      identifier open_f;
      identifier i, f;
      identifier open1.nested_open;
      @@
      int open_f(struct inode *i, struct file *f)
      {
      <+...
      (
      nonseekable_open(...)
      |
      nested_open(...)
      )
      ...+>
      }
      
      @ read disable optional_qualifier exists @
      identifier read_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      expression E;
      identifier func;
      @@
      ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
      {
      <+...
      (
         *off = E
      |
         *off += E
      |
         func(..., off, ...)
      |
         E = *off
      )
      ...+>
      }
      
      @ read_no_fpos disable optional_qualifier exists @
      identifier read_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      @@
      ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
      {
      ... when != off
      }
      
      @ write @
      identifier write_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      expression E;
      identifier func;
      @@
      ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
      {
      <+...
      (
        *off = E
      |
        *off += E
      |
        func(..., off, ...)
      |
        E = *off
      )
      ...+>
      }
      
      @ write_no_fpos @
      identifier write_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      @@
      ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
      {
      ... when != off
      }
      
      @ fops0 @
      identifier fops;
      @@
      struct file_operations fops = {
       ...
      };
      
      @ has_llseek depends on fops0 @
      identifier fops0.fops;
      identifier llseek_f;
      @@
      struct file_operations fops = {
      ...
       .llseek = llseek_f,
      ...
      };
      
      @ has_read depends on fops0 @
      identifier fops0.fops;
      identifier read_f;
      @@
      struct file_operations fops = {
      ...
       .read = read_f,
      ...
      };
      
      @ has_write depends on fops0 @
      identifier fops0.fops;
      identifier write_f;
      @@
      struct file_operations fops = {
      ...
       .write = write_f,
      ...
      };
      
      @ has_open depends on fops0 @
      identifier fops0.fops;
      identifier open_f;
      @@
      struct file_operations fops = {
      ...
       .open = open_f,
      ...
      };
      
      // use no_llseek if we call nonseekable_open
      ////////////////////////////////////////////
      @ nonseekable1 depends on !has_llseek && has_open @
      identifier fops0.fops;
      identifier nso ~= "nonseekable_open";
      @@
      struct file_operations fops = {
      ...  .open = nso, ...
      +.llseek = no_llseek, /* nonseekable */
      };
      
      @ nonseekable2 depends on !has_llseek @
      identifier fops0.fops;
      identifier open.open_f;
      @@
      struct file_operations fops = {
      ...  .open = open_f, ...
      +.llseek = no_llseek, /* open uses nonseekable */
      };
      
      // use seq_lseek for sequential files
      /////////////////////////////////////
      @ seq depends on !has_llseek @
      identifier fops0.fops;
      identifier sr ~= "seq_read";
      @@
      struct file_operations fops = {
      ...  .read = sr, ...
      +.llseek = seq_lseek, /* we have seq_read */
      };
      
      // use default_llseek if there is a readdir
      ///////////////////////////////////////////
      @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier readdir_e;
      @@
      // any other fop is used that changes pos
      struct file_operations fops = {
      ... .readdir = readdir_e, ...
      +.llseek = default_llseek, /* readdir is present */
      };
      
      // use default_llseek if at least one of read/write touches f_pos
      /////////////////////////////////////////////////////////////////
      @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read.read_f;
      @@
      // read fops use offset
      struct file_operations fops = {
      ... .read = read_f, ...
      +.llseek = default_llseek, /* read accesses f_pos */
      };
      
      @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier write.write_f;
      @@
      // write fops use offset
      struct file_operations fops = {
      ... .write = write_f, ...
      +	.llseek = default_llseek, /* write accesses f_pos */
      };
      
      // Use noop_llseek if neither read nor write accesses f_pos
      ///////////////////////////////////////////////////////////
      
      @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read_no_fpos.read_f;
      identifier write_no_fpos.write_f;
      @@
      // write fops use offset
      struct file_operations fops = {
      ...
       .write = write_f,
       .read = read_f,
      ...
      +.llseek = noop_llseek, /* read and write both use no f_pos */
      };
      
      @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier write_no_fpos.write_f;
      @@
      struct file_operations fops = {
      ... .write = write_f, ...
      +.llseek = noop_llseek, /* write uses no f_pos */
      };
      
      @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read_no_fpos.read_f;
      @@
      struct file_operations fops = {
      ... .read = read_f, ...
      +.llseek = noop_llseek, /* read uses no f_pos */
      };
      
      @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      @@
      struct file_operations fops = {
      ...
      +.llseek = noop_llseek, /* no read or write fn */
      };
      ===== End semantic patch =====
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: Christoph Hellwig <hch@infradead.org>
      6038f373
  32. 11 10月, 2010 2 次提交
  33. 23 9月, 2010 1 次提交
  34. 15 9月, 2010 1 次提交
    • A
      sound: autoconvert trivial BKL users to private mutex · 645ef9ef
      Arnd Bergmann 提交于
      The usage of the BKL in the OSS sound drivers is
      trivial, and each of them only locks against itself,
      so it can be turned into per-driver mutexes.
      
      This is the script that was used for the conversion:
      
      file=$1
      name=$2
      if grep -q lock_kernel ${file} ; then
          if grep -q 'include.*linux.mutex.h' ${file} ; then
                  sed -i '/include.*<linux\/smp_lock.h>/d' ${file}
          else
                  sed -i 's/include.*<linux\/smp_lock.h>.*$/include <linux\/mutex.h>/g' ${file}
          fi
          sed -i ${file} \
              -e "/^#include.*linux.mutex.h/,$ {
                      1,/^\(static\|int\|long\)/ {
                           /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);
      
      } }"  \
          -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
          -e '/[      ]*cycle_kernel_lock();/d'
      else
          sed -i -e '/include.*\<smp_lock.h\>/d' ${file}  \
                      -e '/cycle_kernel_lock()/d'
      fi
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      645ef9ef
  35. 07 9月, 2010 1 次提交
  36. 28 8月, 2010 1 次提交