1. 16 4月, 2012 1 次提交
  2. 15 4月, 2012 3 次提交
  3. 14 4月, 2012 5 次提交
  4. 13 4月, 2012 3 次提交
  5. 12 4月, 2012 5 次提交
  6. 11 4月, 2012 5 次提交
  7. 10 4月, 2012 2 次提交
  8. 06 4月, 2012 1 次提交
  9. 05 4月, 2012 1 次提交
    • A
      net/dcb: Add an optional max rate attribute · 08f10aff
      Amir Vadai 提交于
      Although not specified in 8021Qaz spec, it could be useful to enable drivers
      whose HW supports setting a rate limit for an ETS TC. This patch adds this
      optional attribute to DCB netlink. To use it, drivers should implement and
      register the callbacks ieee_setmaxrate and ieee_getmaxrate. The units are 64
      bits long and specified in Kbps to enable usage over both slow and very fast
      networks.
      Signed-off-by: NAmir Vadai <amirv@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      08f10aff
  10. 02 4月, 2012 6 次提交
  11. 29 3月, 2012 1 次提交
  12. 28 3月, 2012 4 次提交
    • J
      Bluetooth: Check for minimum data length in eir_has_data_type() · 6c0c331e
      Johan Hedberg 提交于
      If passed 0 as data_length the (parsed < data_length - 1) test will be
      true and cause a buffer overflow. In practice we need at least two bytes
      for the element length and type so add a test for it to the very
      beginning of the function.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NGustavo Padovan <gustavo@padovan.org>
      6c0c331e
    • J
      Bluetooth: Don't increment twice in eir_has_data_type() · 84d9d071
      Johan Hedberg 提交于
      The parsed variable is already incremented inside the for-loop so there
      no need to increment it again (not to mention that the code was
      incrementing it the wrong amount).
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NGustavo Padovan <gustavo@padovan.org>
      84d9d071
    • J
      Bluetooth: hci_core: fix NULL-pointer dereference at unregister · 94324962
      Johan Hovold 提交于
      Make sure hci_dev_open returns immediately if hci_dev_unregister has
      been called.
      
      This fixes a race between hci_dev_open and hci_dev_unregister which can
      lead to a NULL-pointer dereference.
      
      Bug is 100% reproducible using hciattach and a disconnected serial port:
      
      0. # hciattach -n /dev/ttyO1 any noflow
      
      1. hci_dev_open called from hci_power_on grabs req lock
      2. hci_init_req executes but device fails to initialise (times out
         eventually)
      3. hci_dev_open is called from hci_sock_ioctl and sleeps on req lock
      4. hci_uart_tty_close calls hci_dev_unregister and sleeps on req lock in
         hci_dev_do_close
      5. hci_dev_open (1) releases req lock
      6. hci_dev_do_close grabs req lock and returns as device is not up
      7. hci_dev_unregister sleeps in destroy_workqueue
      8. hci_dev_open (3) grabs req lock, calls hci_init_req and eventually sleeps
      9. hci_dev_unregister finishes, while hci_dev_open is still running...
      
      [   79.627136] INFO: trying to register non-static key.
      [   79.632354] the code is fine but needs lockdep annotation.
      [   79.638122] turning off the locking correctness validator.
      [   79.643920] [<c00188bc>] (unwind_backtrace+0x0/0xf8) from [<c00729c4>] (__lock_acquire+0x1590/0x1ab0)
      [   79.653594] [<c00729c4>] (__lock_acquire+0x1590/0x1ab0) from [<c00733f8>] (lock_acquire+0x9c/0x128)
      [   79.663085] [<c00733f8>] (lock_acquire+0x9c/0x128) from [<c0040a88>] (run_timer_softirq+0x150/0x3ac)
      [   79.672668] [<c0040a88>] (run_timer_softirq+0x150/0x3ac) from [<c003a3b8>] (__do_softirq+0xd4/0x22c)
      [   79.682281] [<c003a3b8>] (__do_softirq+0xd4/0x22c) from [<c003a924>] (irq_exit+0x8c/0x94)
      [   79.690856] [<c003a924>] (irq_exit+0x8c/0x94) from [<c0013a50>] (handle_IRQ+0x34/0x84)
      [   79.699157] [<c0013a50>] (handle_IRQ+0x34/0x84) from [<c0008530>] (omap3_intc_handle_irq+0x48/0x4c)
      [   79.708648] [<c0008530>] (omap3_intc_handle_irq+0x48/0x4c) from [<c037499c>] (__irq_usr+0x3c/0x60)
      [   79.718048] Exception stack(0xcf281fb0 to 0xcf281ff8)
      [   79.723358] 1fa0:                                     0001e6a0 be8dab00 0001e698 00036698
      [   79.731933] 1fc0: 0002df98 0002df38 0000001f 00000000 b6f234d0 00000000 00000004 00000000
      [   79.740509] 1fe0: 0001e6f8 be8d6aa0 be8dac50 0000aab8 80000010 ffffffff
      [   79.747497] Unable to handle kernel NULL pointer dereference at virtual address 00000000
      [   79.756011] pgd = cf3b4000
      [   79.758850] [00000000] *pgd=8f0c7831, *pte=00000000, *ppte=00000000
      [   79.765502] Internal error: Oops: 80000007 [#1]
      [   79.770294] Modules linked in:
      [   79.773529] CPU: 0    Tainted: G        W     (3.3.0-rc6-00002-gb5d5c87 #421)
      [   79.781066] PC is at 0x0
      [   79.783721] LR is at run_timer_softirq+0x16c/0x3ac
      [   79.788787] pc : [<00000000>]    lr : [<c0040aa4>]    psr: 60000113
      [   79.788787] sp : cf281ee0  ip : 00000000  fp : cf280000
      [   79.800903] r10: 00000004  r9 : 00000100  r8 : b6f234d0
      [   79.806427] r7 : c0519c28  r6 : cf093488  r5 : c0561a00  r4 : 00000000
      [   79.813323] r3 : 00000000  r2 : c054eee0  r1 : 00000001  r0 : 00000000
      [   79.820190] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      [   79.827728] Control: 10c5387d  Table: 8f3b4019  DAC: 00000015
      [   79.833801] Process gpsd (pid: 1265, stack limit = 0xcf2802e8)
      [   79.839965] Stack: (0xcf281ee0 to 0xcf282000)
      [   79.844573] 1ee0: 00000002 00000000 c0040a24 00000000 00000002 cf281f08 00200200 00000000
      [   79.853210] 1f00: 00000000 cf281f18 cf281f08 00000000 00000000 00000000 cf281f18 cf281f18
      [   79.861816] 1f20: 00000000 00000001 c056184c 00000000 00000001 b6f234d0 c0561848 00000004
      [   79.870452] 1f40: cf280000 c003a3b8 c051e79c 00000001 00000000 00000100 3fa9e7b8 0000000a
      [   79.879089] 1f60: 00000025 cf280000 00000025 00000000 00000000 b6f234d0 00000000 00000004
      [   79.887756] 1f80: 00000000 c003a924 c053ad38 c0013a50 fa200000 cf281fb0 ffffffff c0008530
      [   79.896362] 1fa0: 0001e6a0 0000aab8 80000010 c037499c 0001e6a0 be8dab00 0001e698 00036698
      [   79.904998] 1fc0: 0002df98 0002df38 0000001f 00000000 b6f234d0 00000000 00000004 00000000
      [   79.913665] 1fe0: 0001e6f8 be8d6aa0 be8dac50 0000aab8 80000010 ffffffff 00fbf700 04ffff00
      [   79.922302] [<c0040aa4>] (run_timer_softirq+0x16c/0x3ac) from [<c003a3b8>] (__do_softirq+0xd4/0x22c)
      [   79.931945] [<c003a3b8>] (__do_softirq+0xd4/0x22c) from [<c003a924>] (irq_exit+0x8c/0x94)
      [   79.940582] [<c003a924>] (irq_exit+0x8c/0x94) from [<c0013a50>] (handle_IRQ+0x34/0x84)
      [   79.948913] [<c0013a50>] (handle_IRQ+0x34/0x84) from [<c0008530>] (omap3_intc_handle_irq+0x48/0x4c)
      [   79.958404] [<c0008530>] (omap3_intc_handle_irq+0x48/0x4c) from [<c037499c>] (__irq_usr+0x3c/0x60)
      [   79.967773] Exception stack(0xcf281fb0 to 0xcf281ff8)
      [   79.973083] 1fa0:                                     0001e6a0 be8dab00 0001e698 00036698
      [   79.981658] 1fc0: 0002df98 0002df38 0000001f 00000000 b6f234d0 00000000 00000004 00000000
      [   79.990234] 1fe0: 0001e6f8 be8d6aa0 be8dac50 0000aab8 80000010 ffffffff
      [   79.997161] Code: bad PC value
      [   80.000396] ---[ end trace 6f6739840475f9ee ]---
      [   80.005279] Kernel panic - not syncing: Fatal exception in interrupt
      
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <jhovold@gmail.com>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      94324962
    • H
      Bluetooth: Use correct flags for checking HCI_SSP_ENABLED bit · 3f17790c
      Hemant Gupta 提交于
      This patch uses the correct flags for checking the HCI_SSP_ENABLED bit.
      Without this authentication request was not being initiated.
      Signed-off-by: NHemant Gupta <hemant.gupta@stericsson.com>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      3f17790c
  13. 27 3月, 2012 1 次提交
  14. 26 3月, 2012 1 次提交
  15. 24 3月, 2012 1 次提交
    • H
      poll: add poll_requested_events() and poll_does_not_wait() functions · 626cf236
      Hans Verkuil 提交于
      In some cases the poll() implementation in a driver has to do different
      things depending on the events the caller wants to poll for.  An example
      is when a driver needs to start a DMA engine if the caller polls for
      POLLIN, but doesn't want to do that if POLLIN is not requested but instead
      only POLLOUT or POLLPRI is requested.  This is something that can happen
      in the video4linux subsystem among others.
      
      Unfortunately, the current epoll/poll/select implementation doesn't
      provide that information reliably.  The poll_table_struct does have it: it
      has a key field with the event mask.  But once a poll() call matches one
      or more bits of that mask any following poll() calls are passed a NULL
      poll_table pointer.
      
      Also, the eventpoll implementation always left the key field at ~0 instead
      of using the requested events mask.
      
      This was changed in eventpoll.c so the key field now contains the actual
      events that should be polled for as set by the caller.
      
      The solution to the NULL poll_table pointer is to set the qproc field to
      NULL in poll_table once poll() matches the events, not the poll_table
      pointer itself.  That way drivers can obtain the mask through a new
      poll_requested_events inline.
      
      The poll_table_struct can still be NULL since some kernel code calls it
      internally (netfs_state_poll() in ./drivers/staging/pohmelfs/netfs.h).  In
      that case poll_requested_events() returns ~0 (i.e.  all events).
      
      Very rarely drivers might want to know whether poll_wait will actually
      wait.  If another earlier file descriptor in the set already matched the
      events the caller wanted to wait for, then the kernel will return from the
      select() call without waiting.  This might be useful information in order
      to avoid doing expensive work.
      
      A new helper function poll_does_not_wait() is added that drivers can use
      to detect this situation.  This is now used in sock_poll_wait() in
      include/net/sock.h.  This was the only place in the kernel that needed
      this information.
      
      Drivers should no longer access any of the poll_table internals, but use
      the poll_requested_events() and poll_does_not_wait() access functions
      instead.  In order to enforce that the poll_table fields are now prepended
      with an underscore and a comment was added warning against using them
      directly.
      
      This required a change in unix_dgram_poll() in unix/af_unix.c which used
      the key field to get the requested events.  It's been replaced by a call
      to poll_requested_events().
      
      For qproc it was especially important to change its name since the
      behavior of that field changes with this patch since this function pointer
      can now be NULL when that wasn't possible in the past.
      
      Any driver accessing the qproc or key fields directly will now fail to compile.
      
      Some notes regarding the correctness of this patch: the driver's poll()
      function is called with a 'struct poll_table_struct *wait' argument.  This
      pointer may or may not be NULL, drivers can never rely on it being one or
      the other as that depends on whether or not an earlier file descriptor in
      the select()'s fdset matched the requested events.
      
      There are only three things a driver can do with the wait argument:
      
      1) obtain the key field:
      
      	events = wait ? wait->key : ~0;
      
         This will still work although it should be replaced with the new
         poll_requested_events() function (which does exactly the same).
         This will now even work better, since wait is no longer set to NULL
         unnecessarily.
      
      2) use the qproc callback. This could be deadly since qproc can now be
         NULL. Renaming qproc should prevent this from happening. There are no
         kernel drivers that actually access this callback directly, BTW.
      
      3) test whether wait == NULL to determine whether poll would return without
         waiting. This is no longer sufficient as the correct test is now
         wait == NULL || wait->_qproc == NULL.
      
         However, the worst that can happen here is a slight performance hit in
         the case where wait != NULL and wait->_qproc == NULL. In that case the
         driver will assume that poll_wait() will actually add the fd to the set
         of waiting file descriptors. Of course, poll_wait() will not do that
         since it tests for wait->_qproc. This will not break anything, though.
      
         There is only one place in the whole kernel where this happens
         (sock_poll_wait() in include/net/sock.h) and that code will be replaced
         by a call to poll_does_not_wait() in the next patch.
      
         Note that even if wait->_qproc != NULL drivers cannot rely on poll_wait()
         actually waiting. The next file descriptor from the set might match the
         event mask and thus any possible waits will never happen.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Reviewed-by: NJonathan Corbet <corbet@lwn.net>
      Reviewed-by: NAl Viro <viro@zeniv.linux.org.uk>
      Cc: Davide Libenzi <davidel@xmailserver.org>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: David Miller <davem@davemloft.net>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      626cf236