All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_ldisc: require CAP_NET_ADMIN to attach N_HCI ldisc
@ 2021-09-22 11:56 Thadeu Lima de Souza Cascardo
  2021-09-22 13:26 ` bluez.test.bot
  2021-09-22 14:15 ` [PATCH] " Marcel Holtmann
  0 siblings, 2 replies; 3+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2021-09-22 11:56 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: linux-kernel, Marcel Holtmann, Johan Hedberg,
	Luiz Augusto von Dentz, Thadeu Lima de Souza Cascardo

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: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 drivers/bluetooth/hci_ldisc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 5ed2cfa7da1d..5e32e4d5367a 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -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
 	 */
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: Bluetooth: hci_ldisc: require CAP_NET_ADMIN to attach N_HCI ldisc
  2021-09-22 11:56 [PATCH] Bluetooth: hci_ldisc: require CAP_NET_ADMIN to attach N_HCI ldisc Thadeu Lima de Souza Cascardo
@ 2021-09-22 13:26 ` bluez.test.bot
  2021-09-22 14:15 ` [PATCH] " Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2021-09-22 13:26 UTC (permalink / raw)
  To: linux-bluetooth, cascardo

[-- Attachment #1: Type: text/plain, Size: 1127 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=550945

---Test result---

Test Summary:
CheckPatch                    PASS      1.57 seconds
GitLint                       FAIL      0.94 seconds
BuildKernel                   PASS      666.33 seconds
TestRunner: Setup             PASS      433.65 seconds
TestRunner: l2cap-tester      PASS      3.49 seconds
TestRunner: bnep-tester       PASS      2.61 seconds
TestRunner: mgmt-tester       PASS      34.14 seconds
TestRunner: rfcomm-tester     PASS      2.83 seconds
TestRunner: smp-tester        PASS      2.92 seconds
TestRunner: userchan-tester   PASS      2.66 seconds

Details
##############################
Test: GitLint - FAIL - 0.94 seconds
Run gitlint with rule in .gitlint
Bluetooth: hci_ldisc: require CAP_NET_ADMIN to attach N_HCI ldisc
2: B4 Second line is not empty: "virtual controller by using PTYs."




---
Regards,
Linux Bluetooth


[-- Attachment #2: l2cap-tester.log --]
[-- Type: application/octet-stream, Size: 51568 bytes --]

[-- Attachment #3: bnep-tester.log --]
[-- Type: application/octet-stream, Size: 3935 bytes --]

[-- Attachment #4: mgmt-tester.log --]
[-- Type: application/octet-stream, Size: 626747 bytes --]

[-- Attachment #5: rfcomm-tester.log --]
[-- Type: application/octet-stream, Size: 14791 bytes --]

[-- Attachment #6: smp-tester.log --]
[-- Type: application/octet-stream, Size: 11859 bytes --]

[-- Attachment #7: userchan-tester.log --]
[-- Type: application/octet-stream, Size: 7768 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Bluetooth: hci_ldisc: require CAP_NET_ADMIN to attach N_HCI ldisc
  2021-09-22 11:56 [PATCH] Bluetooth: hci_ldisc: require CAP_NET_ADMIN to attach N_HCI ldisc Thadeu Lima de Souza Cascardo
  2021-09-22 13:26 ` bluez.test.bot
@ 2021-09-22 14:15 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2021-09-22 14:15 UTC (permalink / raw)
  To: Thadeu Lima de Souza Cascardo
  Cc: linux-bluetooth, open list, Johan Hedberg, Luiz Augusto von Dentz

Hi Thadeu,

> 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: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> ---
> drivers/bluetooth/hci_ldisc.c | 3 +++
> 1 file changed, 3 insertions(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-22 14:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22 11:56 [PATCH] Bluetooth: hci_ldisc: require CAP_NET_ADMIN to attach N_HCI ldisc Thadeu Lima de Souza Cascardo
2021-09-22 13:26 ` bluez.test.bot
2021-09-22 14:15 ` [PATCH] " Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.