All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next v5 1/4] bpf: Be less specific about socket cookies guarantees
@ 2021-01-19 15:59 Florent Revest
  2021-01-19 15:59 ` [PATCH bpf-next v5 2/4] bpf: Expose bpf_get_socket_cookie to tracing programs Florent Revest
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Florent Revest @ 2021-01-19 15:59 UTC (permalink / raw)
  To: bpf; +Cc: ast, daniel, andrii, kpsingh, revest, linux-kernel, Florent Revest

Since "92acdc58ab11 bpf, net: Rework cookie generator as per-cpu one"
socket cookies are not guaranteed to be non-decreasing. The
bpf_get_socket_cookie helper descriptions are currently specifying that
cookies are non-decreasing but we don't want users to rely on that.

Reported-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Florent Revest <revest@chromium.org>
---
 include/uapi/linux/bpf.h       | 8 ++++----
 tools/include/uapi/linux/bpf.h | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index c001766adcbc..0b735c2729b2 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -1656,22 +1656,22 @@ union bpf_attr {
  * 		networking traffic statistics as it provides a global socket
  * 		identifier that can be assumed unique.
  * 	Return
- * 		A 8-byte long non-decreasing number on success, or 0 if the
- * 		socket field is missing inside *skb*.
+ * 		A 8-byte long unique number on success, or 0 if the socket
+ * 		field is missing inside *skb*.
  *
  * u64 bpf_get_socket_cookie(struct bpf_sock_addr *ctx)
  * 	Description
  * 		Equivalent to bpf_get_socket_cookie() helper that accepts
  * 		*skb*, but gets socket from **struct bpf_sock_addr** context.
  * 	Return
- * 		A 8-byte long non-decreasing number.
+ * 		A 8-byte long unique number.
  *
  * u64 bpf_get_socket_cookie(struct bpf_sock_ops *ctx)
  * 	Description
  * 		Equivalent to **bpf_get_socket_cookie**\ () helper that accepts
  * 		*skb*, but gets socket from **struct bpf_sock_ops** context.
  * 	Return
- * 		A 8-byte long non-decreasing number.
+ * 		A 8-byte long unique number.
  *
  * u32 bpf_get_socket_uid(struct sk_buff *skb)
  * 	Return
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index c001766adcbc..0b735c2729b2 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -1656,22 +1656,22 @@ union bpf_attr {
  * 		networking traffic statistics as it provides a global socket
  * 		identifier that can be assumed unique.
  * 	Return
- * 		A 8-byte long non-decreasing number on success, or 0 if the
- * 		socket field is missing inside *skb*.
+ * 		A 8-byte long unique number on success, or 0 if the socket
+ * 		field is missing inside *skb*.
  *
  * u64 bpf_get_socket_cookie(struct bpf_sock_addr *ctx)
  * 	Description
  * 		Equivalent to bpf_get_socket_cookie() helper that accepts
  * 		*skb*, but gets socket from **struct bpf_sock_addr** context.
  * 	Return
- * 		A 8-byte long non-decreasing number.
+ * 		A 8-byte long unique number.
  *
  * u64 bpf_get_socket_cookie(struct bpf_sock_ops *ctx)
  * 	Description
  * 		Equivalent to **bpf_get_socket_cookie**\ () helper that accepts
  * 		*skb*, but gets socket from **struct bpf_sock_ops** context.
  * 	Return
- * 		A 8-byte long non-decreasing number.
+ * 		A 8-byte long unique number.
  *
  * u32 bpf_get_socket_uid(struct sk_buff *skb)
  * 	Return
-- 
2.30.0.284.gd98b1dd5eaa7-goog


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-01-26 18:17 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 15:59 [PATCH bpf-next v5 1/4] bpf: Be less specific about socket cookies guarantees Florent Revest
2021-01-19 15:59 ` [PATCH bpf-next v5 2/4] bpf: Expose bpf_get_socket_cookie to tracing programs Florent Revest
2021-01-20 16:56   ` KP Singh
2021-01-19 15:59 ` [PATCH bpf-next v5 3/4] selftests/bpf: Integrate the socket_cookie test to test_progs Florent Revest
2021-01-20 16:58   ` KP Singh
2021-01-21  7:55   ` Andrii Nakryiko
2021-01-22 14:35     ` Florent Revest
2021-01-22 20:32       ` Andrii Nakryiko
2021-01-19 15:59 ` [PATCH bpf-next v5 4/4] selftests/bpf: Add a selftest for the tracing bpf_get_socket_cookie Florent Revest
2021-01-20 17:07   ` KP Singh
2021-01-20 19:03     ` Alexei Starovoitov
2021-01-20 19:06       ` Florent Revest
2021-01-22 15:34         ` Florent Revest
2021-01-23 20:45           ` Yonghong Song
2021-01-26 18:00             ` Florent Revest
2021-01-20 13:14 ` [PATCH bpf-next v5 1/4] bpf: Be less specific about socket cookies guarantees KP Singh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.