Thread (22 messages) 22 messages, 2 authors, 2019-03-21
STALE2610d
Revisions (14)
  1. v5 [diff vs current]
  2. v6 [diff vs current]
  3. v10 [diff vs current]
  4. v11 [diff vs current]
  5. v11 [diff vs current]
  6. v12 [diff vs current]
  7. v12 [diff vs current]
  8. v13 current
  9. v14 [diff vs current]
  10. v15 [diff vs current]
  11. v16 [diff vs current]
  12. v17 [diff vs current]
  13. v18 [diff vs current]
  14. v19 [diff vs current]

[PATCH v13 09/20] net, arm64: untag user pointers in tcp_zerocopy_receive

From: Andrey Konovalov <hidden>
Date: 2019-03-20 14:54:35
Also in: bpf, linux-arch, linux-kselftest, linux-media, linux-mm, lkml
Subsystem: networking [general], networking [tcp], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Neal Cardwell, Linus Torvalds

This patch is a part of a series that extends arm64 kernel ABI to allow to
pass tagged user pointers (with the top byte set to something else other
than 0x00) as syscall arguments.

tcp_zerocopy_receive() uses provided user pointers for vma lookups, which
can only by done with untagged pointers.

Untag user pointers in this function.

Signed-off-by: Andrey Konovalov <redacted>
---
 net/ipv4/tcp.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 6baa6dc1b13b..855a1f68c1ea 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1761,6 +1761,8 @@ static int tcp_zerocopy_receive(struct sock *sk,
 	if (address & (PAGE_SIZE - 1) || address != zc->address)
 		return -EINVAL;
 
+	address = untagged_addr(address);
+
 	if (sk->sk_state == TCP_LISTEN)
 		return -ENOTCONN;
 
-- 
2.21.0.225.g810b269d1ac-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help