1. 12 Apr, 2008 5 commits
  2. 11 Apr, 2008 1 commit
  3. 10 Apr, 2008 1 commit
    • David S. Miller's avatar
      [IPV4]: Fix byte value boundary check in do_ip_getsockopt(). · 951e07c9
      David S. Miller authored
      This fixes kernel bugzilla 10371.
      
      As reported by M.Piechaczek@osmosys.tv, if we try to grab a
      char sized socket option value, as in:
      
        unsigned char ttl = 255;
        socklen_t     len = sizeof(ttl);
        setsockopt(socket, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, &len);
      
        getsockopt(socket, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, &len);
      
      The ttl returned will be wrong on big-endian, and on both little-
      endian and big-endian the next three bytes in userspace are written
      with garbage.
      
      It's because of this test in do_ip_getsockopt():
      
      	if (len < sizeof(int) && len > 0 && val>=0 && val<255) {
      
      It should allow a 'val' of 255 to pass here, but it doesn't so it
      copies a full 'int' back to userspace.
      
      On little-endian that will write the correct value into the location
      but it spams on the next three bytes in userspace.  On big endian it
      writes the wrong value into the location and spams the next three
      bytes.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      951e07c9
  4. 09 Apr, 2008 9 commits
  5. 08 Apr, 2008 10 commits
  6. 04 Apr, 2008 6 commits
  7. 03 Apr, 2008 5 commits
  8. 02 Apr, 2008 3 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 · 9597362d
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
        USB: ohci: fix 2 timers to fire at jiffies + 1s
        USB: Allow initialization of broken keyspan serial adapters.
        USB: fix bug in sg initialization in usbtest
        USB: serial: fix regression in Visor/Palm OS module for kernels >= 2.6.24
        USB: cp2101: Add identifiers for the Telegesys ETRX2USB
        USB: serial: ti_usb_3410_5052: Correct TUSB3410 endpoint requirements.
        USB: another ehci_iaa_watchdog fix
      9597362d
    • Andrew Morton's avatar
      alpha: get_current(): don't add zero to current_thread_info()->task · 06f11f37
      Andrew Morton authored
      A nasty compile error:
      
      In file included from security/keys/internal.h:16,
                       from security/keys/sysctl.c:14:
      include/linux/key-ui.h: In function 'key_permission':
      include/linux/key-ui.h:51: error: invalid use of undefined type 'struct task_struct'
      
      apparently the compiler has decided that it needs to know sizeof(task_struct)
      so that it can add zero to a task_struct* (which is rather dumb of it).
      
      Getting task_struct in scope in these deeply-nested headers is scary-looking,
      so let's just remove the "+ 0".
      
      Cc: David Howells <dhowells@redhat.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      06f11f37
    • Mathieu Desnoyers's avatar
      markers: use synchronize_sched() · 6496968e
      Mathieu Desnoyers authored
      Markers do not mix well with CONFIG_PREEMPT_RCU because it uses
      preempt_disable/enable() and not rcu_read_lock/unlock for minimal
      intrusiveness.  We would need call_sched and sched_barrier primitives.
      
      Currently, the modification (connection and disconnection) of probes
      from markers requires changes to the data structure done in RCU-style :
      a new data structure is created, the pointer is changed atomically, a
      quiescent state is reached and then the old data structure is freed.
      
      The quiescent state is reached once all the currently running
      preempt_disable regions are done running.  We use the call_rcu mechanism
      to execute kfree() after such quiescent state has been reached.
      However, the new CONFIG_PREEMPT_RCU version of call_rcu and rcu_barrier
      does not guarantee that all preempt_disable code regions have finished,
      hence the race.
      
      The "proper" way to do this is to use rcu_read_lock/unlock, but we don't
      want to use it to minimize intrusiveness on the traced system.  (we do
      not want the marker code to call into much of the OS code, because it
      would quickly restrict what can and cannot be instrumented, such as the
      scheduler).
      
      The temporary fix, until we get call_rcu_sched and rcu_barrier_sched in
      mainline, is to use synchronize_sched before each call_rcu calls, so we
      wait for the quiescent state in the system call code path.  It will slow
      down batch marker enable/disable, but will make sure the race is gone.
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Acked-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6496968e