Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=847641d7db15ac3f18b3d4aa05479812abdf397a Commit: 847641d7db15ac3f18b3d4aa05479812abdf397a Parent: 7386397636d49cd5f03da29432467d3e98cbad35 Author: Marcel Holtmann <[EMAIL PROTECTED]> AuthorDate: Mon Jan 22 22:00:45 2007 +0100 Committer: Marcel Holtmann <[EMAIL PROTECTED]> CommitDate: Mon Jan 22 22:00:45 2007 +0100
[Bluetooth] Restrict well known PSM to privileged users The PSM values below 0x1001 of L2CAP are reserved for well known services. Restrict the possibility to bind them to privileged users. Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]> --- net/bluetooth/l2cap.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index be5a6e6..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)) { - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html