lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250516225441.527020-1-stfomichev@gmail.com>
Date: Fri, 16 May 2025 15:54:41 -0700
From: Stanislav Fomichev <stfomichev@...il.com>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net,
	edumazet@...gle.com,
	kuba@...nel.org,
	pabeni@...hat.com,
	horms@...nel.org,
	sagi@...mberg.me,
	willemb@...gle.com,
	asml.silence@...il.com,
	almasrymina@...gle.com,
	stfomichev@...il.com,
	kaiyuanz@...gle.com,
	linux-kernel@...r.kernel.org
Subject: [PATCH net-next] net: devmem: drop iterator type check

sendmsg() with a single iov becomes ITER_UBUF, sendmsg() with multiple
iovs becomes ITER_IOVEC. Instead of adjusting the check to include
ITER_UBUF, drop the check completely. The callers are guaranteed
to happen from system call side and we don't need to pay runtime
cost to verify it.

Fixes: bd61848900bf ("net: devmem: Implement TX path")
Signed-off-by: Stanislav Fomichev <stfomichev@...il.com>
---
 net/core/datagram.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/net/core/datagram.c b/net/core/datagram.c
index 9ef5442536f5..e04908276a32 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -702,13 +702,6 @@ zerocopy_fill_skb_from_devmem(struct sk_buff *skb, struct iov_iter *from,
 	size_t virt_addr, size, off;
 	struct net_iov *niov;
 
-	/* Devmem filling works by taking an IOVEC from the user where the
-	 * iov_addrs are interpreted as an offset in bytes into the dma-buf to
-	 * send from. We do not support other iter types.
-	 */
-	if (iov_iter_type(from) != ITER_IOVEC)
-		return -EFAULT;
-
 	while (length && iov_iter_count(from)) {
 		if (i == MAX_SKB_FRAGS)
 			return -EMSGSIZE;
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ