[PATCH v1 bpf-next 07/11] bpf: Make bpf_sock_ops.replylong[1] writable.

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

 



With the following patch, the BPF_SOCK_OPS_GEN_SYNCOOKIE_CB program
can utilise the TCP Timestamps option as another storage to encode
client information.

Then, we use bpf_sock_ops.replylong[1] as the user interface to pass
the timestamp value.

Signed-off-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
---
 net/core/filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index cc2e4babc85f..276abecf5d90 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -9079,7 +9079,7 @@ static bool sock_ops_is_valid_access(int off, int size,
 
 	if (type == BPF_WRITE) {
 		switch (off) {
-		case offsetof(struct bpf_sock_ops, reply):
+		case bpf_ctx_range_till(struct bpf_sock_ops, reply, replylong[1]):
 		case offsetof(struct bpf_sock_ops, sk_txhash):
 			if (size != size_default)
 				return false;
-- 
2.30.2





[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