Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Allow change security level on ATT_CID in slave role
@ 2014-06-13 12:08 Marcin Kraglak
  2014-06-13 12:20 ` Johan Hedberg
  2014-06-13 12:58 ` Marcel Holtmann
  0 siblings, 2 replies; 3+ messages in thread
From: Marcin Kraglak @ 2014-06-13 12:08 UTC (permalink / raw)
  To: linux-bluetooth

Kernel supports SMP Security Request so don't block increasing security
when we are slave.

Signed-off-by: Marcin Kraglak <marcin.kraglak@tieto.com>
---
 net/bluetooth/l2cap_sock.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 6ab2822..55215eb 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -787,11 +787,6 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
 
 		/*change security for LE channels */
 		if (chan->scid == L2CAP_CID_ATT) {
-			if (!conn->hcon->out) {
-				err = -EINVAL;
-				break;
-			}
-
 			if (smp_conn_security(conn->hcon, sec.level))
 				break;
 			sk->sk_state = BT_CONFIG;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Bluetooth: Allow change security level on ATT_CID in slave role
  2014-06-13 12:08 [PATCH] Bluetooth: Allow change security level on ATT_CID in slave role Marcin Kraglak
@ 2014-06-13 12:20 ` Johan Hedberg
  2014-06-13 12:58 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2014-06-13 12:20 UTC (permalink / raw)
  To: Marcin Kraglak; +Cc: linux-bluetooth

Hi Marcin,

On Fri, Jun 13, 2014, Marcin Kraglak wrote:
> Kernel supports SMP Security Request so don't block increasing security
> when we are slave.
> 
> Signed-off-by: Marcin Kraglak <marcin.kraglak@tieto.com>
> ---
>  net/bluetooth/l2cap_sock.c | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
> index 6ab2822..55215eb 100644
> --- a/net/bluetooth/l2cap_sock.c
> +++ b/net/bluetooth/l2cap_sock.c
> @@ -787,11 +787,6 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
>  
>  		/*change security for LE channels */
>  		if (chan->scid == L2CAP_CID_ATT) {
> -			if (!conn->hcon->out) {
> -				err = -EINVAL;
> -				break;
> -			}
> -
>  			if (smp_conn_security(conn->hcon, sec.level))
>  				break;
>  			sk->sk_state = BT_CONFIG;

Acked-by: Johan Hedberg <johan.hedberg@intel.com>

Though this could potentially have used a bit more verbose description.
The code in question seems to originate from the early days of SMP where
we probably didn't yet have fully functioning slave-role support. Now
it's there and calls to smp_conn_security() as slave should just do the
right thing.

Johan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Bluetooth: Allow change security level on ATT_CID in slave role
  2014-06-13 12:08 [PATCH] Bluetooth: Allow change security level on ATT_CID in slave role Marcin Kraglak
  2014-06-13 12:20 ` Johan Hedberg
@ 2014-06-13 12:58 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2014-06-13 12:58 UTC (permalink / raw)
  To: Marcin Kraglak; +Cc: linux-bluetooth

Hi Marcin,

> Kernel supports SMP Security Request so don't block increasing security
> when we are slave.
> 
> Signed-off-by: Marcin Kraglak <marcin.kraglak@tieto.com>
> ---
> net/bluetooth/l2cap_sock.c | 5 -----
> 1 file changed, 5 deletions(-)

patch has been applied to bluetooth tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-13 12:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-13 12:08 [PATCH] Bluetooth: Allow change security level on ATT_CID in slave role Marcin Kraglak
2014-06-13 12:20 ` Johan Hedberg
2014-06-13 12:58 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox