11 Jan, 2012

1 commit


04 Jan, 2012

1 commit


03 Jan, 2012

1 commit


23 Dec, 2011

1 commit


20 Dec, 2011

1 commit

  • module_param(bool) used to counter-intuitively take an int. In
    fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
    trick.

    It's time to remove the int/unsigned int option. For this version
    it'll simply give a warning, but it'll break next kernel version.

    (Thanks to Joe Perches for suggesting coccinelle for 0/1 -> true/false).

    Cc: "David S. Miller"
    Cc: netdev@vger.kernel.org
    Signed-off-by: Rusty Russell
    Signed-off-by: David S. Miller

    Rusty Russell
     

19 Dec, 2011

1 commit


19 Oct, 2011

1 commit

  • The Bluetooth stack has internal connection handlers for all of the various
    Bluetooth protocols, and unfortunately, they are currently lacking the LSM
    hooks found in the core network stack's connection handlers. I say
    unfortunately, because this can cause problems for users who have have an
    LSM enabled and are using certain Bluetooth devices. See one problem
    report below:

    * http://bugzilla.redhat.com/show_bug.cgi?id=741703

    In order to keep things simple at this point in time, this patch fixes the
    problem by cloning the parent socket's LSM attributes to the newly created
    child socket. If we decide we need a more elaborate LSM marking mechanism
    for Bluetooth (I somewhat doubt this) we can always revisit this decision
    in the future.

    Reported-by: James M. Cape
    Signed-off-by: Paul Moore
    Acked-by: James Morris
    Signed-off-by: David S. Miller

    Paul Moore
     

12 Aug, 2011

1 commit


01 Jul, 2011

1 commit


10 Jun, 2011

1 commit

  • shutdown should wait for SCO link to be properly disconnected before
    detroying the socket, otherwise an application using the socket may
    assume link is properly disconnected before it really happens which
    can be a problem when e.g synchronizing profile switch.

    Signed-off-by: Luiz Augusto von Dentz
    Signed-off-by: Gustavo F. Padovan

    Luiz Augusto von Dentz
     

12 May, 2011

1 commit

  • This reverts commit f21ca5fff6e548833fa5ee8867239a8378623150.

    Quoth Gustavo F. Padovan:
    "Commit f21ca5fff6e548833fa5ee8867239a8378623150 can cause a NULL
    dereference if we call shutdown in a bluetooth SCO socket and doesn't
    wait the shutdown completion to call close(). Please revert it. I
    may have a fix for it soon, but we don't have time anymore, so revert
    is the way to go. ;)"

    Requested-by: Gustavo F. Padovan
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

19 Apr, 2011

1 commit

  • shutdown should wait for SCO link to be properly disconnected before
    detroying the socket, otherwise an application using the socket may
    assume link is properly disconnected before it really happens which
    can be a problem when e.g synchronizing profile switch.

    Signed-off-by: Luiz Augusto von Dentz
    Signed-off-by: Gustavo F. Padovan

    Luiz Augusto von Dentz
     

28 Feb, 2011

1 commit


15 Feb, 2011

1 commit

  • Actually doesn't make sense have these modules built separately.
    The L2CAP layer is needed by almost all Bluetooth protocols and profiles.
    There isn't any real use case without having L2CAP loaded.
    SCO is only essential for Audio transfers, but it is so small that we can
    have it loaded always in bluetooth.ko without problems.
    If you really doesn't want it you can disable SCO in the kernel config.

    Signed-off-by: Gustavo F. Padovan

    Gustavo F. Padovan
     

14 Feb, 2011

1 commit


02 Dec, 2010

1 commit


23 Nov, 2010

1 commit


18 May, 2010

1 commit

  • This patch removes from net/ (but not any netfilter files)
    all the unnecessary return; statements that precede the
    last closing brace of void functions.

    It does not remove the returns that are immediately
    preceded by a label as gcc doesn't like that.

    Done via:
    $ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
    xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

10 May, 2010

2 commits


21 Apr, 2010

1 commit

  • Define a new function to return the waitqueue of a "struct sock".

    static inline wait_queue_head_t *sk_sleep(struct sock *sk)
    {
    return sk->sk_sleep;
    }

    Change all read occurrences of sk_sleep by a call to this function.

    Needed for a future RCU conversion. sk_sleep wont be a field directly
    available.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

02 Apr, 2010

1 commit

  • check the length of the socket address passed to connect(2).

    Check the length of the socket address passed to connect(2). If the
    length is invalid, -EINVAL will be returned.

    Signed-off-by: Changli Gao
    ----
    net/bluetooth/l2cap.c | 3 ++-
    net/bluetooth/rfcomm/sock.c | 3 ++-
    net/bluetooth/sco.c | 3 ++-
    net/can/bcm.c | 3 +++
    net/ieee802154/af_ieee802154.c | 3 +++
    net/ipv4/af_inet.c | 5 +++++
    net/netlink/af_netlink.c | 3 +++
    7 files changed, 20 insertions(+), 3 deletions(-)
    Signed-off-by: David S. Miller

    Changli Gao
     

21 Mar, 2010

2 commits

  • Some of the debug files ended up wrongly in sysfs, because at that point
    of time, debugfs didn't exist. Convert these files to use debugfs and
    also seq_file. This patch converts all of these files at once and then
    removes the exported symbol for the Bluetooth sysfs class.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     
  • When creating a high number of Bluetooth sockets (L2CAP, SCO
    and RFCOMM) it is possible to scribble repeatedly on arbitrary
    pages of memory. Ensure that the content of these sysfs files is
    always less than one page. Even if this means truncating. The
    files in question are scheduled to be moved over to debugfs in
    the future anyway.

    Based on initial patches from Neil Brown and Linus Torvalds

    Reported-by: Neil Brown
    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     

08 Mar, 2010

1 commit

  • Passing the attribute to the low level IO functions allows all kinds
    of cleanups, by sharing low level IO code without requiring
    an own function for every piece of data.

    Also drivers can extend the attributes with own data fields
    and use that in the low level function.

    This makes the class attributes the same as sysdev_class attributes
    and plain attributes.

    This will allow further cleanups in drivers.

    Full tree sweep converting all users.

    Signed-off-by: Andi Kleen
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     

06 Nov, 2009

1 commit

  • The generic __sock_create function has a kern argument which allows the
    security system to make decisions based on if a socket is being created by
    the kernel or by userspace. This patch passes that flag to the
    net_proto_family specific create function, so it can do the same thing.

    Signed-off-by: Eric Paris
    Acked-by: Arnaldo Carvalho de Melo
    Signed-off-by: David S. Miller

    Eric Paris
     

07 Oct, 2009

1 commit


01 Oct, 2009

1 commit

  • This provides safety against negative optlen at the type
    level instead of depending upon (sometimes non-trivial)
    checks against this sprinkled all over the the place, in
    each and every implementation.

    Based upon work done by Arjan van de Ven and feedback
    from Linus Torvalds.

    Signed-off-by: David S. Miller

    David S. Miller
     

23 Aug, 2009

1 commit

  • The SCO sockets for Bluetooth audio setup and streaming are missing the
    shutdown implementation. This hasn't been a problem so far, but with a
    more deeper integration with PulseAudio it is important to shutdown SCO
    sockets properly.

    Also the Headset profile 1.2 has more detailed qualification tests that
    require that SCO and RFCOMM channels are terminated in the right order. A
    proper shutdown function is necessary for this.

    Based on a report by Johan Hedberg

    Signed-off-by: Marcel Holtmann
    Tested-by: Johan Hedberg

    Marcel Holtmann
     

27 Feb, 2009

4 commits

  • Some of the qualification tests demand that in case of failures in L2CAP
    the HCI disconnect should indicate a reason why L2CAP fails. This is a
    bluntly layer violation since multiple L2CAP connections could be using
    the same ACL and thus forcing a disconnect reason is not a good idea.

    To comply with the Bluetooth test specification, the disconnect reason
    is now stored in the L2CAP connection structure and every time a new
    L2CAP channel is added it will set back to its default. So only in the
    case where the L2CAP channel with the disconnect reason is really the
    last one, it will propagated to the HCI layer.

    The HCI layer has been extended with a disconnect indication that allows
    it to ask upper layers for a disconnect reason. The upper layer must not
    support this callback and in that case it will nicely default to the
    existing behavior. If an upper layer like L2CAP can provide a disconnect
    reason that one will be used to disconnect the ACL or SCO link.

    No modification to the ACL disconnect timeout have been made. So in case
    of Linux to Linux connection the initiator will disconnect the ACL link
    before the acceptor side can signal the specific disconnect reason. That
    is perfectly fine since Linux doesn't make use of this value anyway. The
    L2CAP layer has a perfect valid error code for rejecting connection due
    to a security violation. It is unclear why the Bluetooth specification
    insists on having specific HCI disconnect reason.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     
  • The current security model is based around the flags AUTH, ENCRYPT and
    SECURE. Starting with support for the Bluetooth 2.1 specification this is
    no longer sufficient. The different security levels are now defined as
    SDP, LOW, MEDIUM and SECURE.

    Previously it was possible to set each security independently, but this
    actually doesn't make a lot of sense. For Bluetooth the encryption depends
    on a previous successful authentication. Also you can only update your
    existing link key if you successfully created at least one before. And of
    course the update of link keys without having proper encryption in place
    is a security issue.

    The new security levels from the Bluetooth 2.1 specification are now
    used internally. All old settings are mapped to the new values and this
    way it ensures that old applications still work. The only limitation
    is that it is no longer possible to set authentication without also
    enabling encryption. No application should have done this anyway since
    this is actually a security issue. Without encryption the integrity of
    the authentication can't be guaranteed.

    As default for a new L2CAP or RFCOMM connection, the LOW security level
    is used. The only exception here are the service discovery sessions on
    PSM 1 where SDP level is used. To have similar security strength as with
    a Bluetooth 2.0 and before combination key, the MEDIUM level should be
    used. This is according to the Bluetooth specification. The MEDIUM level
    will not require any kind of man-in-the-middle (MITM) protection. Only
    the HIGH security level will require this.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     
  • All SCO and eSCO connection are auto-accepted no matter if there is a
    corresponding listening socket for them. This patch changes this and
    connection requests for SCO and eSCO without any socket are rejected.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     
  • The socket option levels SOL_L2CAP, SOL_RFOMM and SOL_SCO are currently
    in use by various Bluetooth applications. Going forward the common
    option level SOL_BLUETOOTH should be used. This patch prepares the clean
    split of the old and new option levels while keeping everything backward
    compatibility.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     

30 Nov, 2008

1 commit

  • With the introduction of CONFIG_DYNAMIC_PRINTK_DEBUG it is possible to
    allow debugging without having to recompile the kernel. This patch turns
    all BT_DBG() calls into pr_debug() to support dynamic debug messages.

    As a side effect all CONFIG_BT_*_DEBUG statements are now removed and
    some broken debug entries have been fixed.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     

09 Sep, 2008

1 commit

  • With the introduction of Security Mode 4 and Simple Pairing from the
    Bluetooth 2.1 specification it became mandatory that the initiator
    requires authentication and encryption before any L2CAP channel can
    be established. The only exception here is PSM 1 for the service
    discovery protocol (SDP). It is meant to be used without any encryption
    since it contains only public information. This is how Bluetooth 2.0
    and before handle connections on PSM 1.

    For Bluetooth 2.1 devices the pairing procedure differentiates between
    no bonding, general bonding and dedicated bonding. The L2CAP layer
    wrongly uses always general bonding when creating new connections, but it
    should not do this for SDP connections. In this case the authentication
    requirement should be no bonding and the just-works model should be used,
    but in case of non-SDP connection it is required to use general bonding.

    If the new connection requires man-in-the-middle (MITM) protection, it
    also first wrongly creates an unauthenticated link key and then later on
    requests an upgrade to an authenticated link key to provide full MITM
    protection. With Simple Pairing the link key generation is an expensive
    operation (compared to Bluetooth 2.0 and before) and doing this twice
    during a connection setup causes a noticeable delay when establishing
    a new connection. This should be avoided to not regress from the expected
    Bluetooth 2.0 connection times. The authentication requirements are known
    up-front and so enforce them.

    To fulfill these requirements the hci_connect() function has been extended
    with an authentication requirement parameter that will be stored inside
    the connection information and can be retrieved by userspace at any
    time. This allows the correct IO capabilities exchange and results in
    the expected behavior.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     

18 Aug, 2008

1 commit

  • The Bluetooth entries for the MAINTAINERS file are a little bit too
    much. Consolidate them into two entries. One for Bluetooth drivers and
    another one for the Bluetooth subsystem.

    Also the MODULE_AUTHOR should indicate the current maintainer of the
    module and actually not the original author. Fix all Bluetooth modules
    to provide current maintainer information.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     

15 Jul, 2008

2 commits


03 Apr, 2008

1 commit


29 Mar, 2008

1 commit