Commit c05731d0 authored by Thadeu Lima de Souza Cascardo's avatar Thadeu Lima de Souza Cascardo Committed by Marcel Holtmann
Browse files

Bluetooth: hci_ldisc: require CAP_NET_ADMIN to attach N_HCI ldisc



Any unprivileged user can attach N_HCI ldisc and send packets coming from a
virtual controller by using PTYs.

Require initial namespace CAP_NET_ADMIN to do that.

Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 24ff62ae
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -479,6 +479,9 @@ static int hci_uart_tty_open(struct tty_struct *tty)

	BT_DBG("tty %p", tty);

	if (!capable(CAP_NET_ADMIN))
		return -EPERM;

	/* Error if the tty has no write op instead of leaving an exploitable
	 * hole
	 */