10 Jul, 2013

1 commit

  • Pull networking updates from David Miller:
    "This is a re-do of the net-next pull request for the current merge
    window. The only difference from the one I made the other day is that
    this has Eliezer's interface renames and the timeout handling changes
    made based upon your feedback, as well as a few bug fixes that have
    trickeled in.

    Highlights:

    1) Low latency device polling, eliminating the cost of interrupt
    handling and context switches. Allows direct polling of a network
    device from socket operations, such as recvmsg() and poll().

    Currently ixgbe, mlx4, and bnx2x support this feature.

    Full high level description, performance numbers, and design in
    commit 0a4db187a999 ("Merge branch 'll_poll'")

    From Eliezer Tamir.

    2) With the routing cache removed, ip_check_mc_rcu() gets exercised
    more than ever before in the case where we have lots of multicast
    addresses. Use a hash table instead of a simple linked list, from
    Eric Dumazet.

    3) Add driver for Atheros CQA98xx 802.11ac wireless devices, from
    Bartosz Markowski, Janusz Dziedzic, Kalle Valo, Marek Kwaczynski,
    Marek Puzyniak, Michal Kazior, and Sujith Manoharan.

    4) Support reporting the TUN device persist flag to userspace, from
    Pavel Emelyanov.

    5) Allow controlling network device VF link state using netlink, from
    Rony Efraim.

    6) Support GRE tunneling in openvswitch, from Pravin B Shelar.

    7) Adjust SOCK_MIN_RCVBUF and SOCK_MIN_SNDBUF for modern times, from
    Daniel Borkmann and Eric Dumazet.

    8) Allow controlling of TCP quickack behavior on a per-route basis,
    from Cong Wang.

    9) Several bug fixes and improvements to vxlan from Stephen
    Hemminger, Pravin B Shelar, and Mike Rapoport. In particular,
    support receiving on multiple UDP ports.

    10) Major cleanups, particular in the area of debugging and cookie
    lifetime handline, to the SCTP protocol code. From Daniel
    Borkmann.

    11) Allow packets to cross network namespaces when traversing tunnel
    devices. From Nicolas Dichtel.

    12) Allow monitoring netlink traffic via AF_PACKET sockets, in a
    manner akin to how we monitor real network traffic via ptype_all.
    From Daniel Borkmann.

    13) Several bug fixes and improvements for the new alx device driver,
    from Johannes Berg.

    14) Fix scalability issues in the netem packet scheduler's time queue,
    by using an rbtree. From Eric Dumazet.

    15) Several bug fixes in TCP loss recovery handling, from Yuchung
    Cheng.

    16) Add support for GSO segmentation of MPLS packets, from Simon
    Horman.

    17) Make network notifiers have a real data type for the opaque
    pointer that's passed into them. Use this to properly handle
    network device flag changes in arp_netdev_event(). From Jiri
    Pirko and Timo Teräs.

    18) Convert several drivers over to module_pci_driver(), from Peter
    Huewe.

    19) tcp_fixup_rcvbuf() can loop 500 times over loopback, just use a
    O(1) calculation instead. From Eric Dumazet.

    20) Support setting of explicit tunnel peer addresses in ipv6, just
    like ipv4. From Nicolas Dichtel.

    21) Protect x86 BPF JIT against spraying attacks, from Eric Dumazet.

    22) Prevent a single high rate flow from overruning an individual cpu
    during RX packet processing via selective flow shedding. From
    Willem de Bruijn.

    23) Don't use spinlocks in TCP md5 signing fast paths, from Eric
    Dumazet.

    24) Don't just drop GSO packets which are above the TBF scheduler's
    burst limit, chop them up so they are in-bounds instead. Also
    from Eric Dumazet.

    25) VLAN offloads are missed when configured on top of a bridge, fix
    from Vlad Yasevich.

    26) Support IPV6 in ping sockets. From Lorenzo Colitti.

    27) Receive flow steering targets should be updated at poll() time
    too, from David Majnemer.

    28) Fix several corner case regressions in PMTU/redirect handling due
    to the routing cache removal, from Timo Teräs.

    29) We have to be mindful of ipv4 mapped ipv6 sockets in
    upd_v6_push_pending_frames(). From Hannes Frederic Sowa.

    30) Fix L2TP sequence number handling bugs, from James Chapman."

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1214 commits)
    drivers/net: caif: fix wrong rtnl_is_locked() usage
    drivers/net: enic: release rtnl_lock on error-path
    vhost-net: fix use-after-free in vhost_net_flush
    net: mv643xx_eth: do not use port number as platform device id
    net: sctp: confirm route during forward progress
    virtio_net: fix race in RX VQ processing
    virtio: support unlocked queue poll
    net/cadence/macb: fix bug/typo in extracting gem_irq_read_clear bit
    Documentation: Fix references to defunct linux-net@vger.kernel.org
    net/fs: change busy poll time accounting
    net: rename low latency sockets functions to busy poll
    bridge: fix some kernel warning in multicast timer
    sfc: Fix memory leak when discarding scattered packets
    sit: fix tunnel update via netlink
    dt:net:stmmac: Add dt specific phy reset callback support.
    dt:net:stmmac: Add support to dwmac version 3.610 and 3.710
    dt:net:stmmac: Allocate platform data only if its NULL.
    net:stmmac: fix memleak in the open method
    ipv6: rt6_check_neigh should successfully verify neigh if no NUD information are available
    net: ipv6: fix wrong ping_v6_sendmsg return value
    ...

    Linus Torvalds
     

05 Jul, 2013

1 commit

  • Pull HID updates from Jiri Kosina:
    - HID battery handling cleanup by David Herrmann
    - ELO 4000/4500 driver, which has been finally ported to be proper HID
    driver by Jiri Slaby
    - ps3remote driver functionality is now provided by generic sony
    driver, by Jiri Kosina
    - PS2/3 Buzz controllers support, by Colin Leitner
    - rework of wiimote driver including full extensions hotpluggin
    support, sub-device modularization and speaker support by David
    Herrmann

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (55 commits)
    HID: wacom: Intuos4 battery charging changes
    HID: i2c-hid: support sending HID output reports using the output register
    HID: kye: Add report fixup for Genius Gila Gaming mouse
    HID: wiimote: support Nintendo Wii U Pro Controller
    Input: make gamepad API keycodes more clear
    input: document gamepad API and add extra keycodes
    HID: explain out-of-range check better
    HID: fix false positive out of range values
    HID: wiimote: fix coccinelle warnings
    HID: roccat: check cdev_add return value
    HID: fold ps3remote driver into generic Sony driver
    HID: hyperv: convert alloc+memcpy to memdup
    HID: core: fix reporting of raw events
    HID: wiimote: discard invalid EXT data reports
    HID: wiimote: fix classic controller parsing
    HID: wiimote: init EXT/MP during device detection
    HID: wiimote: fix DRM debug-attr to correctly parse input
    HID: wiimote: add MP quirks
    HID: wiimote: remove old static extension support
    HID: wiimote: add "bboard_calib" attribute
    ...

    Linus Torvalds
     

04 Jul, 2013

2 commits


27 Jun, 2013

1 commit


23 Jun, 2013

31 commits

  • Some Bluetooth controllers doesn't support this command so we first
    need to check for its support before sending it. This patch adds a
    lengthful commentary about this.

    Signed-off-by: Marcel Holtmann
    Signed-off-by: Gustavo Padovan

    Gustavo Padovan
     
  • The length check is invalid since the length varies with type of
    info response.

    This was introduced by the commit cb3b3152b2f5939d67005cff841a1ca748b19888

    Because of this, l2cap info rsp is not handled and command reject is sent.

    > ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
    Extended feature mask 0x00b8
    Enhanced Retransmission mode
    Streaming mode
    FCS Option
    Fixed Channels
    < ACL data: handle 11 flags 0x00 dlen 10
    L2CAP(s): Command rej: reason 0
    Command not understood

    Cc: stable@vger.kernel.org
    Signed-off-by: Jaganath Kanakkassery
    Signed-off-by: Chan-Yeol Park
    Acked-by: Johan Hedberg
    Signed-off-by: Gustavo Padovan

    Jaganath Kanakkassery
     
  • For NULL terminated string, need always let it ended by zero.

    Since have already called memcpy() to initialize 'ci', so need not
    redundant initialization.

    Better use ''if(session->hid) {} else if(session->input) {}"" instead
    of ''if(session->hid) {}; if(session->input) {};''

    Signed-off-by: Chen Gang
    Reviewed-by: David Herrmann
    Acked-by: Jiri Kosina
    Signed-off-by: Gustavo Padovan

    Chen Gang
     
  • Remove HCI_LINK_KEYS flag since using HCI_MGMT is enough for test that
    user space expects the kernel managing link keys.

    Signed-off-by: Andrei Emeltchenko
    Acked-by: Johan Hedberg
    Signed-off-by: Gustavo Padovan

    Andrei Emeltchenko
     
  • Use HCI_MGMT flag instead of HCI_LINK_KEYS flag. There is a problem with
    HCI_LINK_KEYS flag since it is set only when link keys are loaded. Otherwise
    kernel assumes that old interface is used.

    Signed-off-by: Andrei Emeltchenko
    Acked-by: Johan Hedberg
    Signed-off-by: Gustavo Padovan

    Andrei Emeltchenko
     
  • We only want to send Mgmt Device Found Events if we are running the
    Device Discovery procedure (started by the MGMT Start Discovery
    Command). Inquiry or LE scanning triggered by HCI raw interface (e.g.
    hcitool) or kernel internals should not send Mgmt Device Found Events.

    Signed-off-by: Andre Guedes
    Acked-by: Johan Hedberg
    Signed-off-by: Gustavo Padovan

    Andre Guedes
     
  • This patch removes the hci_cc_le_set_scan_param event handler. This
    handler became empty because failures of this event are now handled
    by start_discovery_complete function in mgmt.c.

    Signed-off-by: Andre Guedes
    Acked-by: Johan Hedberg
    Signed-off-by: Gustavo Padovan

    Andre Guedes
     
  • This patch removes hci_do_inquiry and hci_cancel_inquiry helpers. We
    now use the HCI request framework in device discovery functionality
    and these helpers are no longer needed.

    Signed-off-by: Andre Guedes
    Acked-by: Johan Hedberg
    Signed-off-by: Gustavo Padovan

    Andre Guedes
     
  • This patch removes the LE scan helpers hci_le_scan and hci_cancel_
    le_scan and all code related to it. We now use the HCI request
    framework in device discovery functionality and these helpers are
    no longer needed.

    Signed-off-by: Andre Guedes
    Acked-by: Johan Hedberg
    Signed-off-by: Gustavo Padovan

    Andre Guedes
     
  • This patch does a trivial refactoring in hci_cc_le_set_scan_enable.
    Since start and stop discovery command failures are now handled in
    mgmt layer, the status check became empty. So, we can move it to
    outside the switch statement.

    Signed-off-by: Andre Guedes
    Acked-by: Johan Hedberg
    Signed-off-by: Gustavo Padovan

    Andre Guedes
     
  • mgmt_stop_discovery_failed is now only used in mgmt.c so we can
    make it a local function. This patch also moves the mgmt_stop_
    discovery_failed definition up in mgmt.c to avoid forward
    declaration.

    Signed-off-by: Andre Guedes
    Signed-off-by: Gustavo Padovan

    Andre Guedes
     
  • Since all mgmt stop discovery command complete events are now handled
    in stop_discovery_complete callback in mgmt.c, we can remove this
    handling from hci_event.c.

    Signed-off-by: Andre Guedes
    Acked-by: Johan Hedberg
    Signed-off-by: Gustavo Padovan

    Andre Guedes
     
  • This patch modifies the stop_discovery function so it uses the HCI
    request framework.

    The HCI request is built according to the current discovery state
    (inquiry, LE scanning or name resolving) and a complete callback is
    register to handle the command complete event for the stop discovery
    command. This way, we move all stop_discovery mgmt handling code
    spread in hci_event.c to a single place in mgmt.c.

    Signed-off-by: Andre Guedes
    Acked-by: Johan Hedberg
    Signed-off-by: Gustavo Padovan

    Andre Guedes
     
  • In order to have a better HCI error handling in interleaved discovery
    functionality, we should use the HCI request framework.

    This patch updates le_scan_disable_work function so it uses the
    HCI request framework instead of the hci_send_cmd helper. A complete
    callback is registered (le_scan_disable_work_complete function) so we
    are able to trigger the inquiry procedure (if we are running the
    interleaved discovery) or to stop the discovery procedure (if we are
    running LE-only discovery).

    This patch also removes the extra logic in hci_cc_le_set_scan_enable
    to trigger the inquiry procedure and the mgmt_interleaved_discovery
    function since they become useless.

    Signed-off-by: Andre Guedes
    Signed-off-by: Gustavo Padovan

    Andre Guedes
     
  • Some of discovery macros will be used in hci_core so we need to
    define them in common place such as hci_core.h. Thus, this patch
    moves discovery macros to hci_core.h and also adds the DISCOV_
    prefix to them.

    Signed-off-by: Andre Guedes
    Acked-by: Johan Hedberg
    Signed-off-by: Gustavo Padovan

    Andre Guedes
     
  • mgmt_start_discovery_failed is now only used in mgmt.c so we can
    make it a local function. This patch also moves the mgmt_start_
    discovery_failed definition up in mgmt.c to avoid forward
    declaration.

    Signed-off-by: Andre Guedes
    Signed-off-by: Gustavo Padovan

    Andre Guedes
     
  • Since all mgmt start discovery command complete events are now handled
    in start_discovery_complete callback in mgmt.c, we can remove this
    handling from hci_event.c.

    Signed-off-by: Andre Guedes
    Acked-by: Johan Hedberg
    Signed-off-by: Gustavo Padovan

    Andre Guedes
     
  • This patch modifies the start_discovery function so it uses the HCI
    request framework.

    We build the HCI request according to the discovery type (add inquiry
    or LE scan HCI commands) and run the HCI request. We also register
    the start_discovery_complete callback which handles mgmt command
    complete events for this command. This way, we move all start_
    discovery mgmt handling code spread in hci_event.c to a single place
    in mgmt.c.

    This patch also merges the LE-only and interleaved discovery type
    cases since these cases are pretty much the same now.

    Signed-off-by: Andre Guedes
    Acked-by: Johan Hedberg
    Signed-off-by: Gustavo Padovan

    Andre Guedes
     
  • In order to use HCI request framework in start_discovery, we'll need
    to call inquiry_cache_flush in mgmt.c. Therefore, this patch adds the
    hci_ prefix to inquiry_cache_flush and makes it non-static.

    Signed-off-by: Andre Guedes
    Acked-by: Johan Hedberg
    Signed-off-by: Gustavo Padovan

    Andre Guedes
     
  • The LE ATT server socket needs to be superseded by any ATT client
    sockets. Previously this was done by looking at the hcon->out variable
    (indicating whether the connection is outgoing or incoming) which is a
    too crude way of determining whether the server socket needs to be
    picked or not (an outgoing connection doesn't necessarily mean that an
    ATT client socket has triggered it).

    This patch extends the ATT server socket lookup function
    (l2cap_le_conn_ready) to be used for all LE connections (regardless of
    the hcon->out value) and adds an internal check into the function for
    the existence of any ATT client sockets (in which case the server socket
    should be skipped). For this to work reliably all lookups must be done
    while the l2cap_conn->chan_lock is held, meaning also that the call to
    l2cap_chan_add needs to be changed to its lockless __l2cap_chan_add
    counterpart.

    Signed-off-by: Johan Hedberg
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo Padovan

    Johan Hedberg
     
  • There's no need to reset disc_timeout in l2cap_le_conn_ready since
    HCI_DISCONN_TIMEOUT is the default when the hci_conn is created and
    there should be no way for it to get changed between creation and
    l2cap_le_conn_ready being called.

    Signed-off-by: Johan Hedberg
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo Padovan

    Johan Hedberg
     
  • The L2CAP code has been incrementing the hci_conn reference for each
    l2cap_chan instance in the l2cap_conn list. Likewise, the reference is
    dropped each time an l2cap_chan is removed from the list. The reference
    counting policy with respect to removal has been clear and explicit in
    the l2cap_chan_del function, however for addition the function
    calling 2cap_chan_add has always had to do a separate hci_conn_hold
    call.

    What made the counting even more hard to follow is that the
    hci_connect() procedure increments the reference and the L2CAP layer
    making this call took advantage of it to use it as its own reference.

    This patch aims to clarify things by having the call to hci_conn_hold
    inside __l2cap_chan_add, thereby removing the need to do it in the
    functions calling __l2cap_chan_add. The reference count for hci_connect
    is still kept as it's necessary for users such as mgmt_pair_device,
    however for the L2CAP layer it means that an extra call to hci_conn_drop
    must be performed once l2cap_chan_add has been done.

    Signed-off-by: Johan Hedberg
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo Padovan

    Johan Hedberg
     
  • In l2cap_att_channel() we're only interested in the BT_CONNECTED state
    so this state can directly be passed to l2cap_global_chan_by_scid().
    This way there's no need to do any additional state check later.

    Signed-off-by: Johan Hedberg
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo Padovan

    Johan Hedberg
     
  • The sk variable is of quite little use since it's only used to simplify
    access in the two bt_sk() calls.

    Signed-off-by: Johan Hedberg
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo Padovan

    Johan Hedberg
     
  • In l2cap_le_conn_ready() after doing l2cap_chann_add() the LE channel is
    part of the list which is subsequently iterated in l2cap_conn_ready() in
    this loop each channel will get l2cap_chan_ready() called which would
    result in trying to set the channel two times into BT_CONNECTED state.
    Instead it makes sense to just add the channel but not call chan_ready
    in l2cap_le_conn_ready, which is what this patch does.

    Signed-off-by: Johan Hedberg
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo Padovan

    Johan Hedberg
     
  • There is an extra call to smp_conn_security() for outgoing LE
    connections from l2cap_conn_ready() but the reason for this call is far
    from clear. After a bit of commit history research and using git blame I
    found out that this extra call is for socket-less pairing processes
    added by commit 160dc6ac1. This patch adds a clarifying comment to the
    code for this.

    Signed-off-by: Johan Hedberg
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo Padovan

    Johan Hedberg
     
  • Since in the future more than the ATT CID may be permissible we should
    not be hardcoding it for all LE connections in __l2cap_chan_add().
    Instead, the source ATT CID should only be set if the destination is
    also ATT, and in other cases we should just use the existing dynamic CID
    allocation function.

    Assigning scid based on dcid means that whenever __l2cap_chan_add() is
    called that chan->dcid is properly initialized. l2cap_le_conn_ready()
    wasn't initializing is properly so this is also taken care of in this
    patch.

    Signed-off-by: Johan Hedberg
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo Padovan

    Johan Hedberg
     
  • The current test in l2cap_chan_connect is intended to protect against
    multiple conflicting connect attempts. However, it assumes that there
    will ever only be a single CID that is connected to, which is not true.
    We do need to check for conflicts with connect attempts to the same
    destination CID but this check is not in anyway specific to LE but can
    be applied to BR/EDR as well.

    Signed-off-by: Johan Hedberg
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo Padovan

    Johan Hedberg
     
  • The choice between LE and BR/EDR should be made on the destination
    address type instead of the destination CID. This is particularly
    important when in the future more than one CID will be allowed for LE.

    Signed-off-by: Johan Hedberg
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo Padovan

    Johan Hedberg
     
  • In future Core Specification versions the ATT CID will be just one of
    many possible CIDs that can be used for data transfer. Therefore, it
    makes sense to rename the define for the ATT CID to something less
    ambigous.

    Signed-off-by: Johan Hedberg
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo Padovan

    Johan Hedberg
     
  • The LE L2CAP signalling channel follows its own rules and will continue
    to evolve independently from the BR/EDR signalling channel. Therefore,
    it makes sense to have a clear split from BR/EDR by having a dedicated
    function for handling LE signalling commands.

    Signed-off-by: Johan Hedberg
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo Padovan

    Johan Hedberg
     

14 Jun, 2013

2 commits

  • Even though the HCI_Delete_Stored_Link_Key command is mandatory for 1.1
    and later controllers some controllers do not seem to support it
    properly as was witnessed by one Broadcom based controller:

    < HCI Command: Delete Stored Link Key (0x03|0x0012) plen 7
    bdaddr 00:00:00:00:00:00 all 1
    > HCI Event: Command Complete (0x0e) plen 4
    Delete Stored Link Key (0x03|0x0012) ncmd 1
    status 0x11 deleted 0
    Error: Unsupported Feature or Parameter Value

    Luckily this same controller also doesn't list the command in its
    supported commands bit mask (counting from 0 bit 7 of octet 6):

    < HCI Command: Read Local Supported Commands (0x04|0x0002) plen 0
    > HCI Event: Command Complete (0x0e) plen 68
    Read Local Supported Commands (0x04|0x0002) ncmd 1
    status 0x00
    Commands: ffffffffffff1ffffffffffff30fffff3f

    Therefore, it makes sense to move sending of HCI_Delete_Stored_Link_Key
    to after receiving the supported commands response and to only send it
    if its respective bit in the mask is set. The downside of this is that
    we no longer send the HCI_Delete_Stored_Link_Key command for Bluetooth
    1.1 controllers since HCI_Read_Local_Supported_Command was introduced in
    version 1.2, but this is an acceptable penalty as the command in
    question shouldn't affect critical behavior.

    Reported-by: Pavel Machek
    Signed-off-by: Johan Hedberg
    Tested-by: Pavel Machek
    Signed-off-by: Gustavo Padovan
    Signed-off-by: John W. Linville

    Johan Hedberg
     
  • If a too small MTU value is set with ioctl(HCISETACLMTU) or by a bogus
    controller, memory corruption happens due to a memcpy() call with
    negative length.

    Fix this crash on either incoming or outgoing connections with a MTU
    smaller than L2CAP_HDR_SIZE + L2CAP_CMD_HDR_SIZE:

    [ 46.885433] BUG: unable to handle kernel paging request at f56ad000
    [ 46.888037] IP: [] memcpy+0x1d/0x40
    [ 46.888037] *pdpt = 0000000000ac3001 *pde = 00000000373f8067 *pte = 80000000356ad060
    [ 46.888037] Oops: 0002 [#1] SMP DEBUG_PAGEALLOC
    [ 46.888037] Modules linked in: hci_vhci bluetooth virtio_balloon i2c_piix4 uhci_hcd usbcore usb_common
    [ 46.888037] CPU: 0 PID: 1044 Comm: kworker/u3:0 Not tainted 3.10.0-rc1+ #12
    [ 46.888037] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
    [ 46.888037] Workqueue: hci0 hci_rx_work [bluetooth]
    [ 46.888037] task: f59b15b0 ti: f55c4000 task.ti: f55c4000
    [ 46.888037] EIP: 0060:[] EFLAGS: 00010212 CPU: 0
    [ 46.888037] EIP is at memcpy+0x1d/0x40
    [ 46.888037] EAX: f56ac1c0 EBX: fffffff8 ECX: 3ffffc6e EDX: f55c5cf2
    [ 46.888037] ESI: f55c6b32 EDI: f56ad000 EBP: f55c5c68 ESP: f55c5c5c
    [ 46.888037] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
    [ 46.888037] CR0: 8005003b CR2: f56ad000 CR3: 3557d000 CR4: 000006f0
    [ 46.888037] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    [ 46.888037] DR6: ffff0ff0 DR7: 00000400
    [ 46.888037] Stack:
    [ 46.888037] fffffff8 00000010 00000003 f55c5cac f8c6a54c ffffffff f8c69eb2 00000000
    [ 46.888037] f4783cdc f57f0070 f759c590 1001c580 00000003 0200000a 00000000 f5a88560
    [ 46.888037] f5ba2600 f5a88560 00000041 00000000 f55c5d90 f8c6f4c7 00000008 f55c5cf2
    [ 46.888037] Call Trace:
    [ 46.888037] [] l2cap_send_cmd+0x1cc/0x230 [bluetooth]
    [ 46.888037] [] ? l2cap_global_chan_by_psm+0x152/0x1a0 [bluetooth]
    [ 46.888037] [] l2cap_connect+0x3f7/0x540 [bluetooth]
    [ 46.888037] [] ? trace_hardirqs_off+0xb/0x10
    [ 46.888037] [] ? mark_held_locks+0x68/0x110
    [ 46.888037] [] ? mutex_lock_nested+0x280/0x360
    [ 46.888037] [] ? __mutex_unlock_slowpath+0xa9/0x150
    [ 46.888037] [] ? trace_hardirqs_on_caller+0xec/0x1b0
    [ 46.888037] [] ? mutex_lock_nested+0x268/0x360
    [ 46.888037] [] ? trace_hardirqs_on+0xb/0x10
    [ 46.888037] [] l2cap_recv_frame+0xb2d/0x1d30 [bluetooth]
    [ 46.888037] [] ? mark_held_locks+0x68/0x110
    [ 46.888037] [] ? __mutex_unlock_slowpath+0xa9/0x150
    [ 46.888037] [] ? trace_hardirqs_on_caller+0xec/0x1b0
    [ 46.888037] [] l2cap_recv_acldata+0x2a1/0x320 [bluetooth]
    [ 46.888037] [] hci_rx_work+0x518/0x810 [bluetooth]
    [ 46.888037] [] ? hci_rx_work+0x132/0x810 [bluetooth]
    [ 46.888037] [] process_one_work+0x1a9/0x600
    [ 46.888037] [] ? process_one_work+0x12b/0x600
    [ 46.888037] [] ? worker_thread+0x19e/0x320
    [ 46.888037] [] ? worker_thread+0x19e/0x320
    [ 46.888037] [] worker_thread+0xf7/0x320
    [ 46.888037] [] ? rescuer_thread+0x290/0x290
    [ 46.888037] [] kthread+0xa8/0xb0
    [ 46.888037] [] ret_from_kernel_thread+0x1b/0x28
    [ 46.888037] [] ? flush_kthread_worker+0x120/0x120
    [ 46.888037] Code: c3 90 8d 74 26 00 e8 63 fc ff ff eb e8 90 55 89 e5 83 ec 0c 89 5d f4 89 75 f8 89 7d fc 3e 8d 74 26 00 89 cb 89 c7 c1 e9 02 89 d6 a5 89 d9 83 e1 03 74 02 f3 a4 8b 5d f4 8b 75 f8 8b 7d fc 89
    [ 46.888037] EIP: [] memcpy+0x1d/0x40 SS:ESP 0068:f55c5c5c
    [ 46.888037] CR2: 00000000f56ad000
    [ 46.888037] ---[ end trace 0217c1f4d78714a9 ]---

    Signed-off-by: Anderson Lizardo
    Cc: stable@vger.kernel.org
    Signed-off-by: Gustavo Padovan
    Signed-off-by: John W. Linville

    Anderson Lizardo
     

12 Jun, 2013

2 commits

  • If hci_dev_open fails we need to ensure that the corresponding
    mgmt_set_powered command gets an appropriate response. This patch fixes
    the missing response by adding a new mgmt_set_powered_failed function
    that's used to indicate a power on failure to mgmt. Since a situation
    with the device being rfkilled may require special handling in user
    space the patch uses a new dedicated mgmt status code for this.

    Signed-off-by: Johan Hedberg
    Cc: stable@vger.kernel.org
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo Padovan
    Signed-off-by: John W. Linville

    Johan Hedberg
     
  • There has been code in place to check that the L2CAP length header
    matches the amount of data received, but many PDU handlers have not been
    checking that the data received actually matches that expected by the
    specific PDU. This patch adds passing the length header to the specific
    handler functions and ensures that those functions fail cleanly in the
    case of an incorrect amount of data.

    Signed-off-by: Johan Hedberg
    Cc: stable@vger.kernel.org
    Signed-off-by: Gustavo Padovan
    Signed-off-by: John W. Linville

    Johan Hedberg