[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 <marcel@holtmann.org>

+6
+6
net/bluetooth/l2cap.c
··· 585 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 594 write_lock_bh(&l2cap_sk_list.lock); 589 595 590 596 if (la->l2_psm && __l2cap_get_sock_by_addr(la->l2_psm, &la->l2_bdaddr)) {