bluetooth: fix not setting security level when creating a rfcomm session
Subsystems (2)
Luiz Augusto von Dentz
maintainerPATCH 1/1 bluetooth: fix not setting security level when creating a rfcomm session
From: Luiz Augusto von Dentz <[email protected]>
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.
--- net/bluetooth/rfcomm/core.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-)
net/bluetooth/rfcomm/core.c +10 -3
@@ -79,7 +79,10 @@ static void rfcomm_make_uih(struct sk_buff *skb, u8 addr);static void rfcomm_process_connect (struct rfcomm_session *s); -static struct rfcomm_session *rfcomm_session_create (bdaddr_t *src,bdaddr_t *dst,int *err); +static struct rfcomm_session *rfcomm_session_create (bdaddr_t *src, +bdaddr_t *dst, +u8 sec_level, +int *err);static struct rfcomm_session *rfcomm_session_get (bdaddr_t *src,bdaddr_t *dst);static void rfcomm_session_del (struct rfcomm_session *s);
@@ -402,7 +405,7 @@ static int __rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst, s =rfcomm_session_get (src, dst);if (!s) { - s =rfcomm_session_create (src, dst, &err); + s =rfcomm_session_create (src, dst, d->sec_level, &err);if (!s)return err; }
@@ -680,7 +683,10 @@ static void rfcomm_session_close(struct rfcomm_session *s, int err)rfcomm_session_put (s); } -static struct rfcomm_session *rfcomm_session_create (bdaddr_t *src,bdaddr_t *dst,int *err) +static struct rfcomm_session *rfcomm_session_create (bdaddr_t *src, +bdaddr_t *dst, +u8 sec_level, +int *err) {struct rfcomm_session *s =NULL ;struct sockaddr_l2 addr;
@@ -705,6 +711,7 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst sk = sock->sk;lock_sock (sk);l2cap_pi (sk)->imtu = l2cap_mtu; +l2cap_pi (sk)->sec_level = sec_level;if (l2cap_ertm)l2cap_pi (sk)->mode =L2CAP_MODE_ERTM ;release_sock (sk);
Signature · 1 line
1.7.0.4
Quoted 5 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
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.
Looks good.
Quoted 1 line
Signed-off-by Luiz Augusto von Dentz <[email protected]>
Signature · 1 line
Ville
Hi Luiz,
Quoted 10 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
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 <[email protected]>--- net/bluetooth/rfcomm/core.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-)
Patch has been applied to the bluetooth-2.6 tree. Thanks.
Signature · 2 lines
Gustavo F. Padovan ProFUSION embedded systems - http://profusion.mobi