summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-01-23 22:02:15 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2007-01-23 22:02:15 -0800
commit185bd6e2fb1f77e48e4aed50b77edcbf4f08b8fe (patch)
tree4492f6613256ab6bdd577ba093da89eab8c4a119 /net
parent2748e5dec7ca8a3804852c7c4171f9156384d15c (diff)
parent847641d7db15ac3f18b3d4aa05479812abdf397a (diff)
downloadop-kernel-dev-185bd6e2fb1f77e48e4aed50b77edcbf4f08b8fe.zip
op-kernel-dev-185bd6e2fb1f77e48e4aed50b77edcbf4f08b8fe.tar.gz
Merge master.kernel.org:/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6
Diffstat (limited to 'net')
-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 29a8fa4..f8c25d5 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_
goto done;
}
+ if (la->l2_psm > 0 && btohs(la->l2_psm) < 0x1001 &&
+ !capable(CAP_NET_BIND_SERVICE)) {
+ err = -EACCES;
+ goto done;
+ }
+
write_lock_bh(&l2cap_sk_list.lock);
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)
str += sprintf(str, "%s %s %d %d 0x%4.4x 0x%4.4x %d %d 0x%x\n",
batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst),
- sk->sk_state, pi->psm, pi->scid, pi->dcid, pi->imtu,
- pi->omtu, pi->link_mode);
+ sk->sk_state, btohs(pi->psm), pi->scid, pi->dcid,
+ pi->imtu, pi->omtu, pi->link_mode);
}
read_unlock_bh(&l2cap_sk_list.lock);
OpenPOWER on IntegriCloud