tty: n_gsm: require CAP_NET_ADMIN to attach N_GSM0710 ldisc
commit 67c3775689
upstream.
Any unprivileged user can attach N_GSM0710 ldisc, but it requires
CAP_NET_ADMIN to create a GSM network anyway.
Require initial namespace CAP_NET_ADMIN to do that.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Link: https://lore.kernel.org/r/20230731185942.279611-1-cascardo@canonical.com
Cc: Salvatore Bonaccorso <carnil@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2aeb805a1b
commit
2b85977977
@ -2969,6 +2969,9 @@ static int gsmld_open(struct tty_struct *tty)
|
|||||||
{
|
{
|
||||||
struct gsm_mux *gsm;
|
struct gsm_mux *gsm;
|
||||||
|
|
||||||
|
if (!capable(CAP_NET_ADMIN))
|
||||||
|
return -EPERM;
|
||||||
|
|
||||||
if (tty->ops->write == NULL)
|
if (tty->ops->write == NULL)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user