[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACGkMEswqwz_EG0onQcOZdt6pkcaJ7zHsVpm=c2HUkyqdOMTVg@mail.gmail.com>
Date: Fri, 6 Dec 2024 10:42:23 +0800
From: Jason Wang <jasowang@...hat.com>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: Stas Sergeev <stsp2@...dex.ru>, netdev@...r.kernel.org,
Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] tun: fix group permission check
On Fri, Dec 6, 2024 at 12:50 AM Willem de Bruijn
<willemdebruijn.kernel@...il.com> wrote:
>
> Stas Sergeev wrote:
> > Currently tun checks the group permission even if the user have matched.
> > Besides going against the usual permission semantic, this has a
> > very interesting implication: if the tun group is not among the
> > supplementary groups of the tun user, then effectively no one can
> > access the tun device. CAP_SYS_ADMIN still can, but its the same as
> > not setting the tun ownership.
> >
> > This patch relaxes the group checking so that either the user match
> > or the group match is enough. This avoids the situation when no one
> > can access the device even though the ownership is properly set.
> >
> > Also I simplified the logic by removing the redundant inversions:
> > tun_not_capable() --> !tun_capable()
> >
> > Signed-off-by: Stas Sergeev <stsp2@...dex.ru>
> >
> > CC: Willem de Bruijn <willemdebruijn.kernel@...il.com>
> > CC: Jason Wang <jasowang@...hat.com>
> > CC: Andrew Lunn <andrew+netdev@...n.ch>
> > CC: "David S. Miller" <davem@...emloft.net>
> > CC: Eric Dumazet <edumazet@...gle.com>
> > CC: Jakub Kicinski <kuba@...nel.org>
> > CC: Paolo Abeni <pabeni@...hat.com>
> > CC: netdev@...r.kernel.org
> > CC: linux-kernel@...r.kernel.org
>
> Reviewed-by: Willem de Bruijn <willemb@...gle.com>
>
> A lot more readable this way too.
>
Acked-by: Jason Wang <jasowang@...hat.com>
Thanks
Powered by blists - more mailing lists