[RFC PATCH bpf-next 04/14] bpf: Mark sk as PTR_TRUSTED in sockmap iterator context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Allow sk to be passed to bpf_sock_destroy() by marking it as
PTR_TRUSTED.

Signed-off-by: Jordan Rife <jordan@xxxxxxxx>
---
 net/core/sock_map.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/sock_map.c b/net/core/sock_map.c
index f33bfce96b9e..20b0627b1eb1 100644
--- a/net/core/sock_map.c
+++ b/net/core/sock_map.c
@@ -2065,7 +2065,7 @@ static struct bpf_iter_reg sock_map_iter_reg = {
 		{ offsetof(struct bpf_iter__sockmap, key),
 		  PTR_TO_BUF | PTR_MAYBE_NULL | MEM_RDONLY },
 		{ offsetof(struct bpf_iter__sockmap, sk),
-		  PTR_TO_BTF_ID_OR_NULL },
+		  PTR_TO_BTF_ID_OR_NULL | PTR_TRUSTED },
 	},
 };
 
-- 
2.43.0





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux