05 Jan, 2011

1 commit


23 Dec, 2010

7 commits


16 Dec, 2010

1 commit


08 Dec, 2010

2 commits


07 Dec, 2010

3 commits


02 Dec, 2010

16 commits

  • Do not use assignment in IF condition, remove extra spaces,
    fixing typos, simplify code.

    Signed-off-by: Andrei Emeltchenko
    Signed-off-by: Gustavo F. Padovan

    Andrei Emeltchenko
     
  • Do not initialize static vars to zero, macros with complex values
    shall be enclosed with (), remove unneeded braces.

    Signed-off-by: Andrei Emeltchenko
    Signed-off-by: Gustavo F. Padovan

    Andrei Emeltchenko
     
  • Remove extra spaces, assignments in if statement, zeroing static
    variables, extra braces. Fix includes.

    Signed-off-by: Andrei Emeltchenko
    Signed-off-by: Gustavo F. Padovan

    Andrei Emeltchenko
     
  • Do not use assignments in IF condition, remove extra spaces

    Signed-off-by: Andrei Emeltchenko
    Signed-off-by: Gustavo F. Padovan

    Andrei Emeltchenko
     
  • create_singlethread_workqueue() may fail with errors such as -ENOMEM. If
    this happens, the return value is not set to a negative value and the
    module load will succeed. It will then crash on module unload because of
    a destroy_workqueue() call on a NULL pointer.

    Additionally, the _busy_wq workqueue is not being destroyed if any
    errors happen on l2cap_init().

    Signed-off-by: Anderson Lizardo
    Signed-off-by: Gustavo F. Padovan

    Anderson Lizardo
     
  • rfcomm_get_sock_by_channel() was the only user of this function, so I merged
    both into rfcomm_get_sock_by_channel(). The socket lock now should be hold
    outside of rfcomm_get_sock_by_channel() once we hold and release it inside the
    same function now.

    Signed-off-by: Gustavo F. Padovan

    Gustavo F. Padovan
     
  • l2cap_get_sock_by_psm() was the only user of this function, so I merged
    both into l2cap_get_sock_by_psm(). The socket lock now should be hold
    outside of l2cap_get_sock_by_psm() once we hold and release it inside the
    same function now.

    Signed-off-by: Gustavo F. Padovan

    Gustavo F. Padovan
     
  • Fix checkpatch errors like:
    "ERROR: do not use assignment in if condition"
    Simplify code and fix one long line.

    Signed-off-by: Andrei Emeltchenko
    Acked-by: Ville Tervo
    Signed-off-by: Gustavo F. Padovan

    Andrei Emeltchenko
     
  • In timer context we might delete l2cap channel used by krfcommd.
    The check makes sure that sk is not owned. If sk is owned we
    restart timer for HZ/5.

    Signed-off-by: Andrei Emeltchenko
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo F. Padovan

    Andrei Emeltchenko
     
  • Check that socket sk is not locked in user process before removing
    l2cap connection handler.

    lock_sock and release_sock do not hold a normal spinlock directly but
    instead hold the owner field. This means bh_lock_sock can still execute
    even if the socket is "locked". More info can be found here:
    http://www.linuxfoundation.org/collaborate/workgroups/networking/socketlocks

    krfcommd kernel thread may be preempted with l2cap tasklet which remove
    l2cap_conn structure. If krfcommd is in process of sending of RFCOMM reply
    (like "RFCOMM UA" reply to "RFCOMM DISC") then kernel crash happens.

    ...
    [ 694.175933] Unable to handle kernel NULL pointer dereference at virtual address 00000000
    [ 694.184936] pgd = c0004000
    [ 694.187683] [00000000] *pgd=00000000
    [ 694.191711] Internal error: Oops: 5 [#1] PREEMPT
    [ 694.196350] last sysfs file: /sys/devices/platform/hci_h4p/firmware/hci_h4p/loading
    [ 694.260375] CPU: 0 Not tainted (2.6.32.10 #1)
    [ 694.265106] PC is at l2cap_sock_sendmsg+0x43c/0x73c [l2cap]
    [ 694.270721] LR is at 0xd7017303
    ...
    [ 694.525085] Backtrace:
    [ 694.527587] [] (l2cap_sock_sendmsg+0x0/0x73c [l2cap]) from [] (sock_sendmsg+0xb8/0xd8)
    [ 694.537292] [] (sock_sendmsg+0x0/0xd8) from [] (kernel_sendmsg+0x48/0x80)

    Signed-off-by: Andrei Emeltchenko
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo F. Padovan

    Andrei Emeltchenko
     
  • Structure hidp_conninfo is copied to userland with version, product,
    vendor and name fields unitialized if both session->input and session->hid
    are NULL. It leads to leaking of contents of kernel stack memory.

    Signed-off-by: Vasiliy Kulikov
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo F. Padovan

    Vasiliy Kulikov
     
  • Structure cmtp_conninfo is copied to userland with some padding fields
    unitialized. It leads to leaking of contents of kernel stack memory.

    Signed-off-by: Vasiliy Kulikov
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo F. Padovan

    Vasiliy Kulikov
     
  • Structure bnep_conninfo is copied to userland with the field "device"
    that has the last elements unitialized. It leads to leaking of
    contents of kernel stack memory.

    Signed-off-by: Vasiliy Kulikov
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo F. Padovan

    Vasiliy Kulikov
     
  • In Bluetooth there are no automatic updates of remote device names when
    they get changed on the remote side. Instead, it is a good idea to do a
    manual name request when a new connection gets created (for whatever
    reason) since at this point it is very cheap (no costly baseband
    connection creation needed just for the sake of the name request).

    So far userspace has been responsible for this extra name request but
    tighter control is needed in order not to flood Bluetooth controllers
    with two many commands during connection creation. It has been shown
    that some controllers simply fail to function correctly if they get too
    many (almost) simultaneous commands during connection creation. The
    simplest way to acheive better control of these commands is to move
    their sending completely to the kernel side.

    This patch inserts name requests into the sequence of events that the
    kernel performs during connection creation. It does this after the
    remote features have been successfully requested and before any pending
    authentication requests are performed. The code will work sub-optimally
    with userspace versions that still do the name requesting themselves (it
    shouldn't break anything though) so it is recommended to combine this
    with a userspace software version that doesn't have automated name
    requests.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Gustavo F. Padovan

    Johan Hedberg
     
  • This patch adds a single function that's responsible for requesting
    authentication for outgoing connections. This is preparation for the
    next patch which will add automated name requests and thereby move the
    authentication requests to a different location.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Gustavo F. Padovan

    Johan Hedberg
     
  • The current remote and remote extended features event callbacks logic
    can be made simpler by using a label and goto statements instead of the
    current multiple levels of nested if statements.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Gustavo F. Padovan

    Johan Hedberg
     

23 Nov, 2010

1 commit


09 Nov, 2010

5 commits

  • This cause 'No Bonding' to be used if userspace has not yet been paired
    with remote device since the l2cap socket used to create the rfcomm
    session does not have any security level set.

    Signed-off-by: Luiz Augusto von Dentz
    Acked-by: Ville Tervo
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo F. Padovan

    Luiz Augusto von Dentz
     
  • Last commit added a wrong endianness conversion. Fixing that.

    Reported-by: Harvey Harrison
    Signed-off-by: Gustavo F. Padovan

    Gustavo F. Padovan
     
  • In function l2cap_get_conf_opt() and l2cap_add_conf_opt() the address of
    opt->val sometimes is not at the edge of 2-bytes/4-bytes, so 2-bytes/4 bytes
    access will cause data misalignment exeception. Use get_unaligned_le16/32
    and put_unaligned_le16/32 function to avoid data misalignment execption.

    Signed-off-by: steven miao
    Signed-off-by: Mike Frysinger
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo F. Padovan

    steven miao
     
  • When initiating dedicated bonding a L2CAP raw socket with HIGH security
    level is used. The kernel is supposed to trigger the authentication
    request in this case but this doesn't happen currently for non-SSP
    (pre-2.1) devices. The reason is that the authentication request happens
    in the remote extended features callback which never gets called for
    non-SSP devices. This patch fixes the issue by requesting also
    authentiation in the (normal) remote features callback in the case of
    non-SSP devices.

    This rule is applied only for HIGH security level which might at first
    seem unintuitive since on the server socket side MEDIUM is already
    enough for authentication. However, for the clients we really want to
    prefer the server side to decide the authentication requrement in most
    cases, and since most client sockets use MEDIUM it's better to be
    avoided on the kernel side for these sockets. The important socket to
    request it for is the dedicated bonding one and that socket uses HIGH
    security level.

    The patch is based on the initial investigation and patch proposal from
    Andrei Emeltchenko .

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

    Johan Hedberg
     
  • Fix kconfig dependency warning to satisfy dependencies:

    warning: (BT_HIDP && NET && BT && BT_L2CAP && INPUT || USB_HID && HID_SUPPORT && USB && INPUT) selects HID which has unmet direct dependencies (HID_SUPPORT && INPUT)

    Signed-off-by: Randy Dunlap
    Acked-by: Marcel Holtmann
    Signed-off-by: Gustavo F. Padovan

    Randy Dunlap
     

24 Oct, 2010

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1699 commits)
    bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL.
    vlan: Calling vlan_hwaccel_do_receive() is always valid.
    tproxy: use the interface primary IP address as a default value for --on-ip
    tproxy: added IPv6 support to the socket match
    cxgb3: function namespace cleanup
    tproxy: added IPv6 support to the TPROXY target
    tproxy: added IPv6 socket lookup function to nf_tproxy_core
    be2net: Changes to use only priority codes allowed by f/w
    tproxy: allow non-local binds of IPv6 sockets if IP_TRANSPARENT is enabled
    tproxy: added tproxy sockopt interface in the IPV6 layer
    tproxy: added udp6_lib_lookup function
    tproxy: added const specifiers to udp lookup functions
    tproxy: split off ipv6 defragmentation to a separate module
    l2tp: small cleanup
    nf_nat: restrict ICMP translation for embedded header
    can: mcp251x: fix generation of error frames
    can: mcp251x: fix endless loop in interrupt handler if CANINTF_MERRF is set
    can-raw: add msg_flags to distinguish local traffic
    9p: client code cleanup
    rds: make local functions/variables static
    ...

    Fix up conflicts in net/core/dev.c, drivers/net/pcmcia/smc91c92_cs.c and
    drivers/net/wireless/ath/ath9k/debug.c as per David

    Linus Torvalds
     

23 Oct, 2010

1 commit


21 Oct, 2010

1 commit


18 Oct, 2010

1 commit