aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-02-06 22:05:13 -0500
committerPaul Mackerras <paulus@samba.org>2007-02-06 22:05:13 -0500
commit8423200553113cc031caa9b147f6150a8e26545c (patch)
tree752c93a200c9ba056c7469c96f7e27d02c99291d /net/bluetooth
parentf03e64f2ca6ee3d0b7824536b1940497701fe766 (diff)
parent62d0cfcb27cf755cebdc93ca95dabc83608007cd (diff)
Merge branch 'linux-2.6'
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/l2cap.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 29a8fa4d3728..f8c25d500155 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -585,6 +585,12 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_
585 goto done; 585 goto done;
586 } 586 }
587 587
588 if (la->l2_psm > 0 && btohs(la->l2_psm) < 0x1001 &&
589 !capable(CAP_NET_BIND_SERVICE)) {
590 err = -EACCES;
591 goto done;
592 }
593
588 write_lock_bh(&l2cap_sk_list.lock); 594 write_lock_bh(&l2cap_sk_list.lock);
589 595
590 if (la->l2_psm && __l2cap_get_sock_by_addr(la->l2_psm, &la->l2_bdaddr)) { 596 if (la->l2_psm && __l2cap_get_sock_by_addr(la->l2_psm, &la->l2_bdaddr)) {
@@ -2150,8 +2156,8 @@ static ssize_t l2cap_sysfs_show(struct class *dev, char *buf)
2150 2156
2151 str += sprintf(str, "%s %s %d %d 0x%4.4x 0x%4.4x %d %d 0x%x\n", 2157 str += sprintf(str, "%s %s %d %d 0x%4.4x 0x%4.4x %d %d 0x%x\n",
2152 batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst), 2158 batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst),
2153 sk->sk_state, pi->psm, pi->scid, pi->dcid, pi->imtu, 2159 sk->sk_state, btohs(pi->psm), pi->scid, pi->dcid,
2154 pi->omtu, pi->link_mode); 2160 pi->imtu, pi->omtu, pi->link_mode);
2155 } 2161 }
2156 2162
2157 read_unlock_bh(&l2cap_sk_list.lock); 2163 read_unlock_bh(&l2cap_sk_list.lock);