* [PATCH net] s390/qeth: Check CAP_NET_ADMIN for private ioctls
@ 2026-07-23 14:00 Aswin Karuvally
2026-07-28 1:06 ` Jakub Kicinski
2026-07-28 1:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 4+ messages in thread
From: Aswin Karuvally @ 2026-07-23 14:00 UTC (permalink / raw)
To: David Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet,
Andrew Lunn
Cc: netdev, linux-s390, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Alexandra Winter, Christian Borntraeger,
Sven Schnelle, Simon Horman, arnd, stable
Gate the SIOCDEVPRIVATE ioctl commands SIOC_QETH_ADP_SET_SNMP_CONTROL,
SIOC_QETH_GET_CARD_TYPE and SIOC_QETH_QUERY_OAT with CAP_NET_ADMIN
capable check to ensure unprivileged users cannot invoke them.
Fixes: 18787eeebd71 ("qeth: use ndo_siocdevprivate")
Cc: stable@vger.kernel.org
Suggested-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: Aswin Karuvally <aswin@linux.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 20fb0d2e02a9..f18eed9df3c7 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -6525,6 +6525,9 @@ int qeth_siocdevprivate(struct net_device *dev, struct ifreq *rq, void __user *d
struct qeth_card *card = dev->ml_priv;
int rc = 0;
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
switch (cmd) {
case SIOC_QETH_ADP_SET_SNMP_CONTROL:
rc = qeth_snmp_command(card, data);
--
2.53.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] s390/qeth: Check CAP_NET_ADMIN for private ioctls
2026-07-23 14:00 [PATCH net] s390/qeth: Check CAP_NET_ADMIN for private ioctls Aswin Karuvally
@ 2026-07-28 1:06 ` Jakub Kicinski
2026-07-28 10:50 ` Aswin Karuvally
2026-07-28 1:10 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2026-07-28 1:06 UTC (permalink / raw)
To: Aswin Karuvally
Cc: David Miller, Paolo Abeni, Eric Dumazet, Andrew Lunn, netdev,
linux-s390, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Alexandra Winter, Christian Borntraeger, Sven Schnelle,
Simon Horman, arnd, stable
On Thu, 23 Jul 2026 16:00:50 +0200 Aswin Karuvally wrote:
> Gate the SIOCDEVPRIVATE ioctl commands SIOC_QETH_ADP_SET_SNMP_CONTROL,
> SIOC_QETH_GET_CARD_TYPE and SIOC_QETH_QUERY_OAT with CAP_NET_ADMIN
> capable check to ensure unprivileged users cannot invoke them.
No need to make this netns-aware, I assume?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] s390/qeth: Check CAP_NET_ADMIN for private ioctls
2026-07-23 14:00 [PATCH net] s390/qeth: Check CAP_NET_ADMIN for private ioctls Aswin Karuvally
2026-07-28 1:06 ` Jakub Kicinski
@ 2026-07-28 1:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-07-28 1:10 UTC (permalink / raw)
To: Aswin Karuvally
Cc: davem, kuba, pabeni, edumazet, andrew+netdev, netdev, linux-s390,
hca, gor, agordeev, wintera, borntraeger, svens, horms, arnd,
stable
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 23 Jul 2026 16:00:50 +0200 you wrote:
> Gate the SIOCDEVPRIVATE ioctl commands SIOC_QETH_ADP_SET_SNMP_CONTROL,
> SIOC_QETH_GET_CARD_TYPE and SIOC_QETH_QUERY_OAT with CAP_NET_ADMIN
> capable check to ensure unprivileged users cannot invoke them.
>
> Fixes: 18787eeebd71 ("qeth: use ndo_siocdevprivate")
> Cc: stable@vger.kernel.org
> Suggested-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
> Signed-off-by: Aswin Karuvally <aswin@linux.ibm.com>
>
> [...]
Here is the summary with links:
- [net] s390/qeth: Check CAP_NET_ADMIN for private ioctls
https://git.kernel.org/netdev/net/c/d211028bac1b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] s390/qeth: Check CAP_NET_ADMIN for private ioctls
2026-07-28 1:06 ` Jakub Kicinski
@ 2026-07-28 10:50 ` Aswin Karuvally
0 siblings, 0 replies; 4+ messages in thread
From: Aswin Karuvally @ 2026-07-28 10:50 UTC (permalink / raw)
To: Jakub Kicinski
Cc: David Miller, Paolo Abeni, Eric Dumazet, Andrew Lunn, netdev,
linux-s390, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Alexandra Winter, Christian Borntraeger, Sven Schnelle,
Simon Horman, arnd, stable
On 28/07/26 06:36, Jakub Kicinski wrote:
> On Thu, 23 Jul 2026 16:00:50 +0200 Aswin Karuvally wrote:
>> Gate the SIOCDEVPRIVATE ioctl commands SIOC_QETH_ADP_SET_SNMP_CONTROL,
>> SIOC_QETH_GET_CARD_TYPE and SIOC_QETH_QUERY_OAT with CAP_NET_ADMIN
>> capable check to ensure unprivileged users cannot invoke them.
>
> No need to make this netns-aware, I assume?
Hi Jakub,
Thank you for accepting the patch!
It was concluded that the tools that make use of these calls are
strictly meant for IBM OSA cards on an LPAR, which find very limited use
within environments that make use of network namespaces, eg. containers.
Thus stuck with capable().
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-28 10:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-23 14:00 [PATCH net] s390/qeth: Check CAP_NET_ADMIN for private ioctls Aswin Karuvally
2026-07-28 1:06 ` Jakub Kicinski
2026-07-28 10:50 ` Aswin Karuvally
2026-07-28 1:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox