netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/7] net: add debug checks to skb_reset_xxx_header()
@ 2024-11-05 17:43 Eric Dumazet
  2024-11-05 17:43 ` [PATCH net-next 1/7] net: skb_reset_mac_len() must check if mac_header was set Eric Dumazet
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Eric Dumazet @ 2024-11-05 17:43 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: netdev, eric.dumazet, Eric Dumazet

Add debug checks (only enabled for CONFIG_DEBUG_NET=y builds),
to catch bugs earlier.

Eric Dumazet (7):
  net: skb_reset_mac_len() must check if mac_header was set
  net: add debug check in skb_reset_inner_transport_header()
  net: add debug check in skb_reset_inner_network_header()
  net: add debug check in skb_reset_inner_mac_header()
  net: add debug check in skb_reset_transport_header()
  net: add debug check in skb_reset_network_header()
  net: add debug check in skb_reset_mac_header()

 include/linux/skbuff.h | 47 +++++++++++++++++++++++++++++++-----------
 1 file changed, 35 insertions(+), 12 deletions(-)

-- 
2.47.0.199.ga7371fff76-goog


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

* [PATCH net-next 1/7] net: skb_reset_mac_len() must check if mac_header was set
  2024-11-05 17:43 [PATCH net-next 0/7] net: add debug checks to skb_reset_xxx_header() Eric Dumazet
@ 2024-11-05 17:43 ` Eric Dumazet
  2024-11-05 17:56   ` Joe Damato
  2024-11-05 17:43 ` [PATCH net-next 2/7] net: add debug check in skb_reset_inner_transport_header() Eric Dumazet
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Eric Dumazet @ 2024-11-05 17:43 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: netdev, eric.dumazet, Eric Dumazet, En-Wei Wu

Recent discussions show that skb_reset_mac_len() should be more careful.

We expect the MAC header being set.

If not, clear skb->mac_len and fire a warning for CONFIG_DEBUG_NET=y builds.

If after investigations we find that not having a MAC header was okay,
we can remove the warning.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/netdev/CANn89iJZGH+yEfJxfPWa3Hm7jxb-aeY2Up4HufmLMnVuQXt38A@mail.gmail.com/T/
Cc: En-Wei Wu <en-wei.wu@canonical.com>
---
 include/linux/skbuff.h | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 48f1e0fa2a13619e41dfba40f2593dd61f9b9a06..5d8fefa71cac78d83b9565d9038c319112da1e2d 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2909,9 +2909,19 @@ static inline void skb_reset_inner_headers(struct sk_buff *skb)
 	skb->inner_transport_header = skb->transport_header;
 }
 
+static inline int skb_mac_header_was_set(const struct sk_buff *skb)
+{
+	return skb->mac_header != (typeof(skb->mac_header))~0U;
+}
+
 static inline void skb_reset_mac_len(struct sk_buff *skb)
 {
-	skb->mac_len = skb->network_header - skb->mac_header;
+	if (!skb_mac_header_was_set(skb)) {
+		DEBUG_NET_WARN_ON_ONCE(1);
+		skb->mac_len = 0;
+	} else {
+		skb->mac_len = skb->network_header - skb->mac_header;
+	}
 }
 
 static inline unsigned char *skb_inner_transport_header(const struct sk_buff
@@ -3014,11 +3024,6 @@ static inline void skb_set_network_header(struct sk_buff *skb, const int offset)
 	skb->network_header += offset;
 }
 
-static inline int skb_mac_header_was_set(const struct sk_buff *skb)
-{
-	return skb->mac_header != (typeof(skb->mac_header))~0U;
-}
-
 static inline unsigned char *skb_mac_header(const struct sk_buff *skb)
 {
 	DEBUG_NET_WARN_ON_ONCE(!skb_mac_header_was_set(skb));
-- 
2.47.0.199.ga7371fff76-goog


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

* [PATCH net-next 2/7] net: add debug check in skb_reset_inner_transport_header()
  2024-11-05 17:43 [PATCH net-next 0/7] net: add debug checks to skb_reset_xxx_header() Eric Dumazet
  2024-11-05 17:43 ` [PATCH net-next 1/7] net: skb_reset_mac_len() must check if mac_header was set Eric Dumazet
@ 2024-11-05 17:43 ` Eric Dumazet
  2024-11-05 17:57   ` Joe Damato
  2024-11-05 17:43 ` [PATCH net-next 3/7] net: add debug check in skb_reset_inner_network_header() Eric Dumazet
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Eric Dumazet @ 2024-11-05 17:43 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: netdev, eric.dumazet, Eric Dumazet

Make sure (skb->data - skb->head) can fit in skb->inner_transport_header

This needs CONFIG_DEBUG_NET=y.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/linux/skbuff.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 5d8fefa71cac78d83b9565d9038c319112da1e2d..75795568803c0bfc83652ea69e27521eeeaf5d40 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2937,7 +2937,10 @@ static inline int skb_inner_transport_offset(const struct sk_buff *skb)
 
 static inline void skb_reset_inner_transport_header(struct sk_buff *skb)
 {
-	skb->inner_transport_header = skb->data - skb->head;
+	long offset = skb->data - skb->head;
+
+	DEBUG_NET_WARN_ON_ONCE(offset != (typeof(skb->inner_transport_header))offset);
+	skb->inner_transport_header = offset;
 }
 
 static inline void skb_set_inner_transport_header(struct sk_buff *skb,
-- 
2.47.0.199.ga7371fff76-goog


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

* [PATCH net-next 3/7] net: add debug check in skb_reset_inner_network_header()
  2024-11-05 17:43 [PATCH net-next 0/7] net: add debug checks to skb_reset_xxx_header() Eric Dumazet
  2024-11-05 17:43 ` [PATCH net-next 1/7] net: skb_reset_mac_len() must check if mac_header was set Eric Dumazet
  2024-11-05 17:43 ` [PATCH net-next 2/7] net: add debug check in skb_reset_inner_transport_header() Eric Dumazet
@ 2024-11-05 17:43 ` Eric Dumazet
  2024-11-05 17:57   ` Joe Damato
  2024-11-05 17:44 ` [PATCH net-next 4/7] net: add debug check in skb_reset_inner_mac_header() Eric Dumazet
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Eric Dumazet @ 2024-11-05 17:43 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: netdev, eric.dumazet, Eric Dumazet

Make sure (skb->data - skb->head) can fit in skb->inner_network_header

This needs CONFIG_DEBUG_NET=y.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/linux/skbuff.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 75795568803c0bfc83652ea69e27521eeeaf5d40..8dafd1295a6e921e9fba69b730286ea28fdc5249 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2957,7 +2957,10 @@ static inline unsigned char *skb_inner_network_header(const struct sk_buff *skb)
 
 static inline void skb_reset_inner_network_header(struct sk_buff *skb)
 {
-	skb->inner_network_header = skb->data - skb->head;
+	long offset = skb->data - skb->head;
+
+	DEBUG_NET_WARN_ON_ONCE(offset != (typeof(skb->inner_network_header))offset);
+	skb->inner_network_header = offset;
 }
 
 static inline void skb_set_inner_network_header(struct sk_buff *skb,
-- 
2.47.0.199.ga7371fff76-goog


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

* [PATCH net-next 4/7] net: add debug check in skb_reset_inner_mac_header()
  2024-11-05 17:43 [PATCH net-next 0/7] net: add debug checks to skb_reset_xxx_header() Eric Dumazet
                   ` (2 preceding siblings ...)
  2024-11-05 17:43 ` [PATCH net-next 3/7] net: add debug check in skb_reset_inner_network_header() Eric Dumazet
@ 2024-11-05 17:44 ` Eric Dumazet
  2024-11-05 17:58   ` Joe Damato
  2024-11-05 17:44 ` [PATCH net-next 5/7] net: add debug check in skb_reset_transport_header() Eric Dumazet
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Eric Dumazet @ 2024-11-05 17:44 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: netdev, eric.dumazet, Eric Dumazet

Make sure (skb->data - skb->head) can fit in skb->inner_mac_header

This needs CONFIG_DEBUG_NET=y.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/linux/skbuff.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 8dafd1295a6e921e9fba69b730286ea28fdc5249..32a7d8a65b9f8f6087007177e763dc9498215e34 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2982,7 +2982,10 @@ static inline unsigned char *skb_inner_mac_header(const struct sk_buff *skb)
 
 static inline void skb_reset_inner_mac_header(struct sk_buff *skb)
 {
-	skb->inner_mac_header = skb->data - skb->head;
+	long offset = skb->data - skb->head;
+
+	DEBUG_NET_WARN_ON_ONCE(offset != (typeof(skb->inner_mac_header))offset);
+	skb->inner_mac_header = offset;
 }
 
 static inline void skb_set_inner_mac_header(struct sk_buff *skb,
-- 
2.47.0.199.ga7371fff76-goog


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

* [PATCH net-next 5/7] net: add debug check in skb_reset_transport_header()
  2024-11-05 17:43 [PATCH net-next 0/7] net: add debug checks to skb_reset_xxx_header() Eric Dumazet
                   ` (3 preceding siblings ...)
  2024-11-05 17:44 ` [PATCH net-next 4/7] net: add debug check in skb_reset_inner_mac_header() Eric Dumazet
@ 2024-11-05 17:44 ` Eric Dumazet
  2024-11-05 17:58   ` Joe Damato
  2024-11-05 17:44 ` [PATCH net-next 6/7] net: add debug check in skb_reset_network_header() Eric Dumazet
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Eric Dumazet @ 2024-11-05 17:44 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: netdev, eric.dumazet, Eric Dumazet

Make sure (skb->data - skb->head) can fit in skb->transport_header

This needs CONFIG_DEBUG_NET=y.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/linux/skbuff.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 32a7d8a65b9f8f6087007177e763dc9498215e34..f76524844e7edc5fe4e0afc27ce71eed7fbd40f9 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3007,7 +3007,10 @@ static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
 
 static inline void skb_reset_transport_header(struct sk_buff *skb)
 {
-	skb->transport_header = skb->data - skb->head;
+	long offset = skb->data - skb->head;
+
+	DEBUG_NET_WARN_ON_ONCE(offset != (typeof(skb->transport_header))offset);
+	skb->transport_header = offset;
 }
 
 static inline void skb_set_transport_header(struct sk_buff *skb,
-- 
2.47.0.199.ga7371fff76-goog


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

* [PATCH net-next 6/7] net: add debug check in skb_reset_network_header()
  2024-11-05 17:43 [PATCH net-next 0/7] net: add debug checks to skb_reset_xxx_header() Eric Dumazet
                   ` (4 preceding siblings ...)
  2024-11-05 17:44 ` [PATCH net-next 5/7] net: add debug check in skb_reset_transport_header() Eric Dumazet
@ 2024-11-05 17:44 ` Eric Dumazet
  2024-11-05 17:58   ` Joe Damato
  2024-11-05 17:44 ` [PATCH net-next 7/7] net: add debug check in skb_reset_mac_header() Eric Dumazet
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Eric Dumazet @ 2024-11-05 17:44 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: netdev, eric.dumazet, Eric Dumazet

Make sure (skb->data - skb->head) can fit in skb->network_header

This needs CONFIG_DEBUG_NET=y.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/linux/skbuff.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index f76524844e7edc5fe4e0afc27ce71eed7fbd40f9..f1e49a32880df8f3716c585d13c1085a2183978a 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3027,7 +3027,10 @@ static inline unsigned char *skb_network_header(const struct sk_buff *skb)
 
 static inline void skb_reset_network_header(struct sk_buff *skb)
 {
-	skb->network_header = skb->data - skb->head;
+	long offset = skb->data - skb->head;
+
+	DEBUG_NET_WARN_ON_ONCE(offset != (typeof(skb->network_header))offset);
+	skb->network_header = offset;
 }
 
 static inline void skb_set_network_header(struct sk_buff *skb, const int offset)
-- 
2.47.0.199.ga7371fff76-goog


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

* [PATCH net-next 7/7] net: add debug check in skb_reset_mac_header()
  2024-11-05 17:43 [PATCH net-next 0/7] net: add debug checks to skb_reset_xxx_header() Eric Dumazet
                   ` (5 preceding siblings ...)
  2024-11-05 17:44 ` [PATCH net-next 6/7] net: add debug check in skb_reset_network_header() Eric Dumazet
@ 2024-11-05 17:44 ` Eric Dumazet
  2024-11-05 17:59   ` Joe Damato
  2024-11-06  9:52 ` [PATCH net-next 0/7] net: add debug checks to skb_reset_xxx_header() Xuan Zhuo
  2024-11-07  2:00 ` patchwork-bot+netdevbpf
  8 siblings, 1 reply; 17+ messages in thread
From: Eric Dumazet @ 2024-11-05 17:44 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: netdev, eric.dumazet, Eric Dumazet

Make sure (skb->data - skb->head) can fit in skb->mac_header

This needs CONFIG_DEBUG_NET=y.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/linux/skbuff.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index f1e49a32880df8f3716c585d13c1085a2183978a..e5095d75abba18c5c5301ddc39c40cdcf5e528ed 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3063,7 +3063,10 @@ static inline void skb_unset_mac_header(struct sk_buff *skb)
 
 static inline void skb_reset_mac_header(struct sk_buff *skb)
 {
-	skb->mac_header = skb->data - skb->head;
+	long offset = skb->data - skb->head;
+
+	DEBUG_NET_WARN_ON_ONCE(offset != (typeof(skb->mac_header))offset);
+	skb->mac_header = offset;
 }
 
 static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
-- 
2.47.0.199.ga7371fff76-goog


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

* Re: [PATCH net-next 1/7] net: skb_reset_mac_len() must check if mac_header was set
  2024-11-05 17:43 ` [PATCH net-next 1/7] net: skb_reset_mac_len() must check if mac_header was set Eric Dumazet
@ 2024-11-05 17:56   ` Joe Damato
  0 siblings, 0 replies; 17+ messages in thread
From: Joe Damato @ 2024-11-05 17:56 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, netdev,
	eric.dumazet, En-Wei Wu

On Tue, Nov 05, 2024 at 05:43:57PM +0000, Eric Dumazet wrote:
> Recent discussions show that skb_reset_mac_len() should be more careful.
> 
> We expect the MAC header being set.
> 
> If not, clear skb->mac_len and fire a warning for CONFIG_DEBUG_NET=y builds.
> 
> If after investigations we find that not having a MAC header was okay,
> we can remove the warning.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Link: https://lore.kernel.org/netdev/CANn89iJZGH+yEfJxfPWa3Hm7jxb-aeY2Up4HufmLMnVuQXt38A@mail.gmail.com/T/
> Cc: En-Wei Wu <en-wei.wu@canonical.com>
> ---
>  include/linux/skbuff.h | 17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)

Reviewed-by: Joe Damato <jdamato@fastly.com>

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

* Re: [PATCH net-next 2/7] net: add debug check in skb_reset_inner_transport_header()
  2024-11-05 17:43 ` [PATCH net-next 2/7] net: add debug check in skb_reset_inner_transport_header() Eric Dumazet
@ 2024-11-05 17:57   ` Joe Damato
  0 siblings, 0 replies; 17+ messages in thread
From: Joe Damato @ 2024-11-05 17:57 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, netdev,
	eric.dumazet

On Tue, Nov 05, 2024 at 05:43:58PM +0000, Eric Dumazet wrote:
> Make sure (skb->data - skb->head) can fit in skb->inner_transport_header
> 
> This needs CONFIG_DEBUG_NET=y.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  include/linux/skbuff.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Joe Damato <jdamato@fastly.com>

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

* Re: [PATCH net-next 3/7] net: add debug check in skb_reset_inner_network_header()
  2024-11-05 17:43 ` [PATCH net-next 3/7] net: add debug check in skb_reset_inner_network_header() Eric Dumazet
@ 2024-11-05 17:57   ` Joe Damato
  0 siblings, 0 replies; 17+ messages in thread
From: Joe Damato @ 2024-11-05 17:57 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, netdev,
	eric.dumazet

On Tue, Nov 05, 2024 at 05:43:59PM +0000, Eric Dumazet wrote:
> Make sure (skb->data - skb->head) can fit in skb->inner_network_header
> 
> This needs CONFIG_DEBUG_NET=y.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  include/linux/skbuff.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Joe Damato <jdamato@fastly.com>

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

* Re: [PATCH net-next 4/7] net: add debug check in skb_reset_inner_mac_header()
  2024-11-05 17:44 ` [PATCH net-next 4/7] net: add debug check in skb_reset_inner_mac_header() Eric Dumazet
@ 2024-11-05 17:58   ` Joe Damato
  0 siblings, 0 replies; 17+ messages in thread
From: Joe Damato @ 2024-11-05 17:58 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, netdev,
	eric.dumazet

On Tue, Nov 05, 2024 at 05:44:00PM +0000, Eric Dumazet wrote:
> Make sure (skb->data - skb->head) can fit in skb->inner_mac_header
> 
> This needs CONFIG_DEBUG_NET=y.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  include/linux/skbuff.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Joe Damato <jdamato@fastly.com>

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

* Re: [PATCH net-next 5/7] net: add debug check in skb_reset_transport_header()
  2024-11-05 17:44 ` [PATCH net-next 5/7] net: add debug check in skb_reset_transport_header() Eric Dumazet
@ 2024-11-05 17:58   ` Joe Damato
  0 siblings, 0 replies; 17+ messages in thread
From: Joe Damato @ 2024-11-05 17:58 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, netdev,
	eric.dumazet

On Tue, Nov 05, 2024 at 05:44:01PM +0000, Eric Dumazet wrote:
> Make sure (skb->data - skb->head) can fit in skb->transport_header
> 
> This needs CONFIG_DEBUG_NET=y.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  include/linux/skbuff.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Joe Damato <jdamato@fastly.com>

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

* Re: [PATCH net-next 6/7] net: add debug check in skb_reset_network_header()
  2024-11-05 17:44 ` [PATCH net-next 6/7] net: add debug check in skb_reset_network_header() Eric Dumazet
@ 2024-11-05 17:58   ` Joe Damato
  0 siblings, 0 replies; 17+ messages in thread
From: Joe Damato @ 2024-11-05 17:58 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, netdev,
	eric.dumazet

On Tue, Nov 05, 2024 at 05:44:02PM +0000, Eric Dumazet wrote:
> Make sure (skb->data - skb->head) can fit in skb->network_header
> 
> This needs CONFIG_DEBUG_NET=y.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  include/linux/skbuff.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Joe Damato <jdamato@fastly.com>

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

* Re: [PATCH net-next 7/7] net: add debug check in skb_reset_mac_header()
  2024-11-05 17:44 ` [PATCH net-next 7/7] net: add debug check in skb_reset_mac_header() Eric Dumazet
@ 2024-11-05 17:59   ` Joe Damato
  0 siblings, 0 replies; 17+ messages in thread
From: Joe Damato @ 2024-11-05 17:59 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, netdev,
	eric.dumazet

On Tue, Nov 05, 2024 at 05:44:03PM +0000, Eric Dumazet wrote:
> Make sure (skb->data - skb->head) can fit in skb->mac_header
> 
> This needs CONFIG_DEBUG_NET=y.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  include/linux/skbuff.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Joe Damato <jdamato@fastly.com>

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

* Re: [PATCH net-next 0/7] net: add debug checks to skb_reset_xxx_header()
  2024-11-05 17:43 [PATCH net-next 0/7] net: add debug checks to skb_reset_xxx_header() Eric Dumazet
                   ` (6 preceding siblings ...)
  2024-11-05 17:44 ` [PATCH net-next 7/7] net: add debug check in skb_reset_mac_header() Eric Dumazet
@ 2024-11-06  9:52 ` Xuan Zhuo
  2024-11-07  2:00 ` patchwork-bot+netdevbpf
  8 siblings, 0 replies; 17+ messages in thread
From: Xuan Zhuo @ 2024-11-06  9:52 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: netdev, eric.dumazet, Eric Dumazet, David S . Miller,
	Jakub Kicinski, Paolo Abeni


For serial:

Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>

On Tue,  5 Nov 2024 17:43:56 +0000, Eric Dumazet <edumazet@google.com> wrote:
> Add debug checks (only enabled for CONFIG_DEBUG_NET=y builds),
> to catch bugs earlier.
>
> Eric Dumazet (7):
>   net: skb_reset_mac_len() must check if mac_header was set
>   net: add debug check in skb_reset_inner_transport_header()
>   net: add debug check in skb_reset_inner_network_header()
>   net: add debug check in skb_reset_inner_mac_header()
>   net: add debug check in skb_reset_transport_header()
>   net: add debug check in skb_reset_network_header()
>   net: add debug check in skb_reset_mac_header()
>
>  include/linux/skbuff.h | 47 +++++++++++++++++++++++++++++++-----------
>  1 file changed, 35 insertions(+), 12 deletions(-)
>
> --
> 2.47.0.199.ga7371fff76-goog
>
>

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

* Re: [PATCH net-next 0/7] net: add debug checks to skb_reset_xxx_header()
  2024-11-05 17:43 [PATCH net-next 0/7] net: add debug checks to skb_reset_xxx_header() Eric Dumazet
                   ` (7 preceding siblings ...)
  2024-11-06  9:52 ` [PATCH net-next 0/7] net: add debug checks to skb_reset_xxx_header() Xuan Zhuo
@ 2024-11-07  2:00 ` patchwork-bot+netdevbpf
  8 siblings, 0 replies; 17+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-11-07  2:00 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: davem, kuba, pabeni, netdev, eric.dumazet

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue,  5 Nov 2024 17:43:56 +0000 you wrote:
> Add debug checks (only enabled for CONFIG_DEBUG_NET=y builds),
> to catch bugs earlier.
> 
> Eric Dumazet (7):
>   net: skb_reset_mac_len() must check if mac_header was set
>   net: add debug check in skb_reset_inner_transport_header()
>   net: add debug check in skb_reset_inner_network_header()
>   net: add debug check in skb_reset_inner_mac_header()
>   net: add debug check in skb_reset_transport_header()
>   net: add debug check in skb_reset_network_header()
>   net: add debug check in skb_reset_mac_header()
> 
> [...]

Here is the summary with links:
  - [net-next,1/7] net: skb_reset_mac_len() must check if mac_header was set
    https://git.kernel.org/netdev/net-next/c/1e4033b53db4
  - [net-next,2/7] net: add debug check in skb_reset_inner_transport_header()
    https://git.kernel.org/netdev/net-next/c/cfe8394e06f2
  - [net-next,3/7] net: add debug check in skb_reset_inner_network_header()
    https://git.kernel.org/netdev/net-next/c/1732e4bedb3e
  - [net-next,4/7] net: add debug check in skb_reset_inner_mac_header()
    https://git.kernel.org/netdev/net-next/c/78a0cb2f45dc
  - [net-next,5/7] net: add debug check in skb_reset_transport_header()
    https://git.kernel.org/netdev/net-next/c/ae50ea52bdd7
  - [net-next,6/7] net: add debug check in skb_reset_network_header()
    https://git.kernel.org/netdev/net-next/c/305ae87dafc1
  - [net-next,7/7] net: add debug check in skb_reset_mac_header()
    https://git.kernel.org/netdev/net-next/c/3b6167e9bfc9

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2024-11-07  2:00 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-05 17:43 [PATCH net-next 0/7] net: add debug checks to skb_reset_xxx_header() Eric Dumazet
2024-11-05 17:43 ` [PATCH net-next 1/7] net: skb_reset_mac_len() must check if mac_header was set Eric Dumazet
2024-11-05 17:56   ` Joe Damato
2024-11-05 17:43 ` [PATCH net-next 2/7] net: add debug check in skb_reset_inner_transport_header() Eric Dumazet
2024-11-05 17:57   ` Joe Damato
2024-11-05 17:43 ` [PATCH net-next 3/7] net: add debug check in skb_reset_inner_network_header() Eric Dumazet
2024-11-05 17:57   ` Joe Damato
2024-11-05 17:44 ` [PATCH net-next 4/7] net: add debug check in skb_reset_inner_mac_header() Eric Dumazet
2024-11-05 17:58   ` Joe Damato
2024-11-05 17:44 ` [PATCH net-next 5/7] net: add debug check in skb_reset_transport_header() Eric Dumazet
2024-11-05 17:58   ` Joe Damato
2024-11-05 17:44 ` [PATCH net-next 6/7] net: add debug check in skb_reset_network_header() Eric Dumazet
2024-11-05 17:58   ` Joe Damato
2024-11-05 17:44 ` [PATCH net-next 7/7] net: add debug check in skb_reset_mac_header() Eric Dumazet
2024-11-05 17:59   ` Joe Damato
2024-11-06  9:52 ` [PATCH net-next 0/7] net: add debug checks to skb_reset_xxx_header() Xuan Zhuo
2024-11-07  2:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).