1. 14 6月, 2007 2 次提交
  2. 09 6月, 2007 6 次提交
    • G
      [IrDA]: Fix Rx/Tx path race. · c0cfe7fa
      G. Liakhovetski 提交于
      From: G. Liakhovetski <gl@dsa-ac.de>
      
      We need to switch to NRM _before_ sending the final packet otherwise
      we might hit a race condition where we get the first packet from the
      peer while we're still in LAP_XMIT_P.
      Signed-off-by: NSamuel Ortiz <samuel@sortiz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c0cfe7fa
    • R
      Protect <linux/console_struct.h> from multiple inclusion · 217397d7
      Robert P. J. Day 提交于
      Prevent <linux/console_struct.h> from being included more than once,
      otherwise you get a redefinition error if you happen to include
      <linux/vt_kern.h> first.
      Signed-off-by: NRobert P. J. Day <rpjday@mindspring.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      217397d7
    • R
      hexdump: more output formatting · c7909234
      Randy Dunlap 提交于
      Add a prefix string parameter.  Callers are responsible for any string
      length/alignment that they want to see in the output.  I.e., callers should
      pad strings to achieve alignment if they want that.
      
      Add rowsize parameter.  This is the number of raw data bytes to be printed
      per line.  Must be 16 or 32.
      
      Add a groupsize parameter.  This allows callers to dump values as 1-byte,
      2-byte, 4-byte, or 8-byte numbers.  Default is 1-byte numbers.  If the
      total length is not an even multiple of groupsize, 1-byte numbers are
      printed.
      
      Add an "ascii" output parameter.  This causes ASCII data output following
      the hex data output.
      
      Clean up some doc examples.
      
      Align the ASCII output on all lines that are produced by one call.
      
      Add a new interface, print_hex_dump_bytes(), that is a shortcut to
      print_hex_dump(), using default parameter values to print 16 bytes in
      byte-size chunks of hex + ASCII output, using printk level KERN_DEBUG.
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Cc: Christoph Lameter <clameter@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c7909234
    • A
      pi-futex: fix exit races and locking problems · 778e9a9c
      Alexey Kuznetsov 提交于
      1. New entries can be added to tsk->pi_state_list after task completed
         exit_pi_state_list(). The result is memory leakage and deadlocks.
      
      2. handle_mm_fault() is called under spinlock. The result is obvious.
      
      3. results in self-inflicted deadlock inside glibc.
         Sometimes futex_lock_pi returns -ESRCH, when it is not expected
         and glibc enters to for(;;) sleep() to simulate deadlock. This problem
         is quite obvious and I think the patch is right. Though it looks like
         each "if" in futex_lock_pi() got some stupid special case "else if". :-)
      
      4. sometimes futex_lock_pi() returns -EDEADLK,
         when nobody has the lock. The reason is also obvious (see comment
         in the patch), but correct fix is far beyond my comprehension.
         I guess someone already saw this, the chunk:
      
                              if (rt_mutex_trylock(&q.pi_state->pi_mutex))
                                      ret = 0;
      
         is obviously from the same opera. But it does not work, because the
         rtmutex is really taken at this point: wake_futex_pi() of previous
         owner reassigned it to us. My fix works. But it looks very stupid.
         I would think about removal of shift of ownership in wake_futex_pi()
         and making all the work in context of process taking lock.
      
      From: Thomas Gleixner <tglx@linutronix.de>
      
      Fix 1) Avoid the tasklist lock variant of the exit race fix by adding
          an additional state transition to the exit code.
      
          This fixes also the issue, when a task with recursive segfaults
          is not able to release the futexes.
      
      Fix 2) Cleanup the lookup_pi_state() failure path and solve the -ESRCH
          problem finally.
      
      Fix 3) Solve the fixup_pi_state_owner() problem which needs to do the fixup
          in the lock protected section by using the in_atomic userspace access
          functions.
      
          This removes also the ugly lock drop / unqueue inside of fixup_pi_state()
      
      Fix 4) Fix a stale lock in the error path of futex_wake_pi()
      
      Added some error checks for verification.
      
      The -EDEADLK problem is solved by the rtmutex fixups.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Ulrich Drepper <drepper@redhat.com>
      Cc: Eric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      778e9a9c
    • C
      SLUB: return ZERO_SIZE_PTR for kmalloc(0) · 272c1d21
      Christoph Lameter 提交于
      Instead of returning the smallest available object return ZERO_SIZE_PTR.
      
      A ZERO_SIZE_PTR can be legitimately used as an object pointer as long as it
      is not deferenced.  The dereference of ZERO_SIZE_PTR causes a distinctive
      fault.  kfree can handle a ZERO_SIZE_PTR in the same way as NULL.
      
      This enables functions to use zero sized object. e.g. n = number of objects.
      
      	objects = kmalloc(n * sizeof(object));
      
      	for (i = 0; i < n; i++)
      		objects[i].x = y;
      
      	kfree(objects);
      Signed-off-by: NChristoph Lameter <clameter@sgi.com>
      Acked-by: NPekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      272c1d21
    • P
      [NetLabel]: consolidate the struct socket/sock handling to just struct sock · ba6ff9f2
      Paul Moore 提交于
      The current NetLabel code has some redundant APIs which allow both
      "struct socket" and "struct sock" types to be used; this may have made
      sense at some point but it is wasteful now.  Remove the functions that
      operate on sockets and convert the callers.  Not only does this make
      the code smaller and more consistent but it pushes the locking burden
      up to the caller which can be more intelligent about the locks.  Also,
      perform the same conversion (socket to sock) on the SELinux/NetLabel
      glue code where it make sense.
      Signed-off-by: NPaul Moore <paul.moore@hp.com>
      Acked-by: NJames Morris <jmorris@namei.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ba6ff9f2
  3. 08 6月, 2007 10 次提交
  4. 07 6月, 2007 3 次提交
  5. 05 6月, 2007 5 次提交
  6. 04 6月, 2007 3 次提交
  7. 03 6月, 2007 1 次提交
  8. 02 6月, 2007 4 次提交
  9. 01 6月, 2007 6 次提交