Skip to contentSkip to conversation

chelsio: Annotate structs with __counted_by

PATCH Applied Kees Cook 6 participants 17 messages Sep 29, 2023 – Oct 6, 2023

Subsystems (4)
lore
Share & tools
lore

Kees Cook

author
#0 lore raw

cover chelsio: Annotate structs with __counted_by

Hi,

This annotates several chelsio structures with the coming __counted_by attribute for bounds checking of flexible arrays at run-time. For more details, see commit dd06e72e68bc ("Compiler Attributes: Add __counted_by macro").

Thanks!

-Kees

Kees Cook (5):
chelsio/l2t: Annotate struct l2t_data with __counted_by
cxgb4: Annotate struct clip_tbl with __counted_by
cxgb4: Annotate struct cxgb4_tc_u32_table with __counted_by
cxgb4: Annotate struct sched_table with __counted_by
cxgb4: Annotate struct smt_data with __counted_by

 drivers/net/ethernet/chelsio/cxgb3/l2t.h                | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/clip_tbl.h           | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/l2t.c                | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/sched.h              | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/smt.h                | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 1/5 chelsio/l2t: Annotate struct l2t_data with __counted_by

Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions).

As found with Coccinelle[1], add __counted_by for struct l2t_data.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Cc Raju Rangoju <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Paolo Abeni <[email protected]>
---
 drivers/net/ethernet/chelsio/cxgb3/l2t.h | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/l2t.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/chelsio/cxgb3/l2t.h +1 -1
index ea75f275023f..646ca0bc25bd 100644
@@ -76,7 +76,7 @@ struct l2t_data {
 	atomic_t nfree;		/* number of free entries */
 	rwlock_t lock;
 	struct rcu_head rcu_head;	/* to handle rcu cleanup */
-	struct l2t_entry l2tab[];
+	struct l2t_entry l2tab[] __counted_by(nentries);
 };
 
 typedef void (*arp_failure_handler_func)(struct t3cdev * dev,
drivers/net/ethernet/chelsio/cxgb4/l2t.c +1 -1
index a10a6862a9a4..1e5f5b1a22a6 100644
@@ -59,7 +59,7 @@ struct l2t_data {
 	rwlock_t lock;
 	atomic_t nfree;             /* number of free entries */
 	struct l2t_entry *rover;    /* starting point for next allocation */
-	struct l2t_entry l2tab[];  /* MUST BE LAST */
+	struct l2t_entry l2tab[] __counted_by(l2t_size);  /* MUST BE LAST */
 };
 
 static inline unsigned int vlan_prio(const struct l2t_entry *e)
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH 1/5] chelsio/l2t: Annotate struct l2t_data with __counted_by

Le 29/09/2023 à 20:11, Kees Cook a écrit :

Quoted 40 lines

Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions).

As found with Coccinelle[1], add __counted_by for struct l2t_data.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Cc Raju Rangoju <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Paolo Abeni <[email protected]>
---
  drivers/net/ethernet/chelsio/cxgb3/l2t.h | 2 +-
  drivers/net/ethernet/chelsio/cxgb4/l2t.c | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/chelsio/cxgb3/l2t.h +1 -1
index ea75f275023f..646ca0bc25bd 100644
@@ -76,7 +76,7 @@ struct l2t_data {
  	atomic_t nfree;		/* number of free entries */
  	rwlock_t lock;
  	struct rcu_head rcu_head;	/* to handle rcu cleanup */
-	struct l2t_entry l2tab[];
+	struct l2t_entry l2tab[] __counted_by(nentries);
  };
 
  typedef void (*arp_failure_handler_func)(struct t3cdev * dev,
drivers/net/ethernet/chelsio/cxgb4/l2t.c +0 -0
index a10a6862a9a4..1e5f5b1a22a6 100644

drivers/net/ethernet/chelsio/cxgb4/l2t.c struct l2t_data { · line 62

Quoted 5 lines
drivers/net/ethernet/chelsio/cxgb4/l2t.c +1 -1
@@ -59,7 +59,7 @@ struct l2t_data {
  	rwlock_t lock;
  	atomic_t nfree;             /* number of free entries */
  	struct l2t_entry *rover;    /* starting point for next allocation */
-	struct l2t_entry l2tab[];  /* MUST BE LAST */
+	struct l2t_entry l2tab[] __counted_by(l2t_size);  /* MUST BE LAST */

Nit: the comment is maybe unneeded.

Quoted 3 lines
drivers/net/ethernet/chelsio/cxgb4/l2t.c +0 -0
  };
 
  static inline unsigned int vlan_prio(const struct l2t_entry *e)
Reviewed-by on v1 1/5
#3 lore raw

Re: [PATCH 1/5] chelsio/l2t: Annotate struct l2t_data with __counted_by

In reply to Kees Cook
Quoted 10 lines · Kees Cook

Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions).

As found with Coccinelle[1], add __counted_by for struct l2t_data.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Quoted 7 lines
Cc Raju Rangoju <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Paolo Abeni <[email protected]>

Thanks
--
Gustavo

Quoted 31 lines
---
  drivers/net/ethernet/chelsio/cxgb3/l2t.h | 2 +-
  drivers/net/ethernet/chelsio/cxgb4/l2t.c | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/chelsio/cxgb3/l2t.h +1 -1
index ea75f275023f..646ca0bc25bd 100644
@@ -76,7 +76,7 @@ struct l2t_data {
  	atomic_t nfree;		/* number of free entries */
  	rwlock_t lock;
  	struct rcu_head rcu_head;	/* to handle rcu cleanup */
-	struct l2t_entry l2tab[];
+	struct l2t_entry l2tab[] __counted_by(nentries);
  };
 
  typedef void (*arp_failure_handler_func)(struct t3cdev * dev,
drivers/net/ethernet/chelsio/cxgb4/l2t.c +1 -1
index a10a6862a9a4..1e5f5b1a22a6 100644
@@ -59,7 +59,7 @@ struct l2t_data {
  	rwlock_t lock;
  	atomic_t nfree;             /* number of free entries */
  	struct l2t_entry *rover;    /* starting point for next allocation */
-	struct l2t_entry l2tab[];  /* MUST BE LAST */
+	struct l2t_entry l2tab[] __counted_by(l2t_size);  /* MUST BE LAST */
  };
 
  static inline unsigned int vlan_prio(const struct l2t_entry *e)
author
#4 lore raw

PATCH 2/5 cxgb4: Annotate struct clip_tbl with __counted_by

In reply to Kees Cook

Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions).

As found with Coccinelle[1], add __counted_by for struct clip_tbl.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Cc Raju Rangoju <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Paolo Abeni <[email protected]>
---
 drivers/net/ethernet/chelsio/cxgb4/clip_tbl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/clip_tbl.h +1 -1
index 290c1058069a..847c7fc2bbd9 100644
@@ -29,7 +29,7 @@ struct clip_tbl {
 	atomic_t nfree;
 	struct list_head ce_free_head;
 	void *cl_list;
-	struct list_head hash_list[];
+	struct list_head hash_list[] __counted_by(clipt_size);
 };
 
 enum {
Signature · 1 line
2.34.1
Reviewed-by on v1 2/5
#5 lore raw

Re: [PATCH 2/5] cxgb4: Annotate struct clip_tbl with __counted_by

Quoted 10 lines · Kees Cook

Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions).

As found with Coccinelle[1], add __counted_by for struct clip_tbl.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Quoted 7 lines
Cc Raju Rangoju <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Paolo Abeni <[email protected]>

Thanks
--
Gustavo

Quoted 17 lines
---
  drivers/net/ethernet/chelsio/cxgb4/clip_tbl.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/clip_tbl.h +1 -1
index 290c1058069a..847c7fc2bbd9 100644
@@ -29,7 +29,7 @@ struct clip_tbl {
  	atomic_t nfree;
  	struct list_head ce_free_head;
  	void *cl_list;
-	struct list_head hash_list[];
+	struct list_head hash_list[] __counted_by(clipt_size);
  };
 
  enum {
author
#6 lore raw

PATCH 3/5 cxgb4: Annotate struct cxgb4_tc_u32_table with __counted_by

In reply to Kees Cook

Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions).

As found with Coccinelle[1], add __counted_by for struct cxgb4_tc_u32_table.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Cc Raju Rangoju <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Paolo Abeni <[email protected]>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h +1 -1
index f59dd4b2ae6f..9050568a034c 100644
@@ -331,6 +331,6 @@ struct cxgb4_link {
 
 struct cxgb4_tc_u32_table {
 	unsigned int size;          /* number of entries in table */
-	struct cxgb4_link table[]; /* Jump table */
+	struct cxgb4_link table[] __counted_by(size); /* Jump table */
 };
 #endif /* __CXGB4_TC_U32_PARSE_H */
Signature · 1 line
2.34.1
Reviewed-by on v1 3/5
#7 lore raw

Re: [PATCH 3/5] cxgb4: Annotate struct cxgb4_tc_u32_table with __counted_by

Quoted 10 lines · Kees Cook

Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions).

As found with Coccinelle[1], add __counted_by for struct cxgb4_tc_u32_table.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Quoted 7 lines
Cc Raju Rangoju <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Paolo Abeni <[email protected]>

Thanks
--
Gustavo

Quoted 16 lines
---
  drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h +1 -1
index f59dd4b2ae6f..9050568a034c 100644
@@ -331,6 +331,6 @@ struct cxgb4_link {
 
  struct cxgb4_tc_u32_table {
  	unsigned int size;          /* number of entries in table */
-	struct cxgb4_link table[]; /* Jump table */
+	struct cxgb4_link table[] __counted_by(size); /* Jump table */
  };
  #endif /* __CXGB4_TC_U32_PARSE_H */
author
#8 lore raw

PATCH 4/5 cxgb4: Annotate struct sched_table with __counted_by

In reply to Kees Cook

Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions).

As found with Coccinelle[1], add __counted_by for struct sched_table.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Cc Raju Rangoju <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Paolo Abeni <[email protected]>
---
 drivers/net/ethernet/chelsio/cxgb4/sched.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/sched.h +1 -1
index 5f8b871d79af..6b3c778815f0 100644
@@ -82,7 +82,7 @@ struct sched_class {
 
 struct sched_table {      /* per port scheduling table */
 	u8 sched_size;
-	struct sched_class tab[];
+	struct sched_class tab[] __counted_by(sched_size);
 };
 
 static inline bool can_sched(struct net_device *dev)
Signature · 1 line
2.34.1
Reviewed-by on v1 4/5
#9 lore raw

Re: [PATCH 4/5] cxgb4: Annotate struct sched_table with __counted_by

Quoted 10 lines · Kees Cook

Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions).

As found with Coccinelle[1], add __counted_by for struct sched_table.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Quoted 7 lines
Cc Raju Rangoju <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Paolo Abeni <[email protected]>

Thanks
--
Gustavo

Quoted 17 lines
---
  drivers/net/ethernet/chelsio/cxgb4/sched.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/sched.h +1 -1
index 5f8b871d79af..6b3c778815f0 100644
@@ -82,7 +82,7 @@ struct sched_class {
 
  struct sched_table {      /* per port scheduling table */
  	u8 sched_size;
-	struct sched_class tab[];
+	struct sched_class tab[] __counted_by(sched_size);
  };
 
  static inline bool can_sched(struct net_device *dev)
author
#10 lore raw

PATCH 5/5 cxgb4: Annotate struct smt_data with __counted_by

In reply to Kees Cook

Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions).

As found with Coccinelle[1], add __counted_by for struct smt_data.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Cc Raju Rangoju <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Paolo Abeni <[email protected]>
---
 drivers/net/ethernet/chelsio/cxgb4/smt.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/smt.h +1 -1
index 541249d78914..109c1dff563a 100644
@@ -66,7 +66,7 @@ struct smt_entry {
 struct smt_data {
 	unsigned int smt_size;
 	rwlock_t lock;
-	struct smt_entry smtab[];
+	struct smt_entry smtab[] __counted_by(smt_size);
 };
 
 struct smt_data *t4_init_smt(void);
Signature · 1 line
2.34.1
Reviewed-by on v1 5/5
#11 lore raw

Re: [PATCH 5/5] cxgb4: Annotate struct smt_data with __counted_by

Quoted 10 lines · Kees Cook

Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions).

As found with Coccinelle[1], add __counted_by for struct smt_data.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Quoted 7 lines
Cc Raju Rangoju <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Paolo Abeni <[email protected]>

Thanks
--
Gustavo

Quoted 17 lines
---
  drivers/net/ethernet/chelsio/cxgb4/smt.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/smt.h +1 -1
index 541249d78914..109c1dff563a 100644
@@ -66,7 +66,7 @@ struct smt_entry {
  struct smt_data {
  	unsigned int smt_size;
  	rwlock_t lock;
-	struct smt_entry smtab[];
+	struct smt_entry smtab[] __counted_by(smt_size);
  };
 
  struct smt_data *t4_init_smt(void);
author
#12 lore raw
In reply to Kees Cook
Quoted 17 lines · Kees Cook

Hi,

This annotates several chelsio structures with the coming __counted_by attribute for bounds checking of flexible arrays at run-time. For more details, see commit dd06e72e68bc ("Compiler Attributes: Add __counted_by macro").

Thanks!

-Kees

Kees Cook (5):
chelsio/l2t: Annotate struct l2t_data with __counted_by
cxgb4: Annotate struct clip_tbl with __counted_by
cxgb4: Annotate struct cxgb4_tc_u32_table with __counted_by
cxgb4: Annotate struct sched_table with __counted_by
cxgb4: Annotate struct smt_data with __counted_by

Quoted 7 lines
 drivers/net/ethernet/chelsio/cxgb3/l2t.h                | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/clip_tbl.h           | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/l2t.c                | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/sched.h              | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/smt.h                | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

Hm, it looks like this is not "Supported" any more? I'm getting bounces from "Raju Rangoju <[email protected]>" ...

CXGB4 ETHERNET DRIVER (CXGB4)

M:      Raju Rangoju <[email protected]>
L:      [email protected]
S:      Supported
W:      http://www.chelsio.com
F:      drivers/net/ethernet/chelsio/cxgb4/

-Kees

Signature · 1 line
Kees Cook
maintainer
#13 lore raw
Quoted 29 lines · On Fri, 29 Sep 2023 12:44:45 -0700 Kees Cook wrote:
Quoted 17 lines · Kees Cook

Hi,

This annotates several chelsio structures with the coming __counted_by attribute for bounds checking of flexible arrays at run-time. For more details, see commit dd06e72e68bc ("Compiler Attributes: Add __counted_by macro").

Thanks!

-Kees

Kees Cook (5):
chelsio/l2t: Annotate struct l2t_data with __counted_by
cxgb4: Annotate struct clip_tbl with __counted_by
cxgb4: Annotate struct cxgb4_tc_u32_table with __counted_by
cxgb4: Annotate struct sched_table with __counted_by
cxgb4: Annotate struct smt_data with __counted_by

Quoted 7 lines
 drivers/net/ethernet/chelsio/cxgb3/l2t.h                | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/clip_tbl.h           | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/l2t.c                | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/sched.h              | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/smt.h                | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)  

Hm, it looks like this is not "Supported" any more? I'm getting bounces from "Raju Rangoju <[email protected]>" ...

Quoted 6 lines

CXGB4 ETHERNET DRIVER (CXGB4)

M:      Raju Rangoju <[email protected]>
L:      [email protected]
S:      Supported
W:      http://www.chelsio.com
F:      drivers/net/ethernet/chelsio/cxgb4/

Hi Ayush,

any idea who should be maintaining the Ethernet part of cxgb4 at this point?

#14 lore raw
Quoted 35 lines · Jakub Kicinski
Quoted 28 lines · On Fri, 29 Sep 2023 12:44:45 -0700 Kees Cook wrote:
Quoted 17 lines · Kees Cook

Hi,

This annotates several chelsio structures with the coming __counted_by attribute for bounds checking of flexible arrays at run-time. For more details, see commit dd06e72e68bc ("Compiler Attributes: Add __counted_by macro").

Thanks!

-Kees

Kees Cook (5):
chelsio/l2t: Annotate struct l2t_data with __counted_by
cxgb4: Annotate struct clip_tbl with __counted_by
cxgb4: Annotate struct cxgb4_tc_u32_table with __counted_by
cxgb4: Annotate struct sched_table with __counted_by
cxgb4: Annotate struct smt_data with __counted_by

Quoted 7 lines
  drivers/net/ethernet/chelsio/cxgb3/l2t.h                | 2 +-
  drivers/net/ethernet/chelsio/cxgb4/clip_tbl.h           | 2 +-
  drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h | 2 +-
  drivers/net/ethernet/chelsio/cxgb4/l2t.c                | 2 +-
  drivers/net/ethernet/chelsio/cxgb4/sched.h              | 2 +-
  drivers/net/ethernet/chelsio/cxgb4/smt.h                | 2 +-
  6 files changed, 6 insertions(+), 6 deletions(-)

Hm, it looks like this is not "Supported" any more? I'm getting bounces from "Raju Rangoju <[email protected]>" ...

Quoted 6 lines

CXGB4 ETHERNET DRIVER (CXGB4)

M:      Raju Rangoju <[email protected]>
L:      [email protected]
S:      Supported
W:      http://www.chelsio.com
F:      drivers/net/ethernet/chelsio/cxgb4/
Quoted 4 lines

Hi Ayush,

any idea who should be maintaining the Ethernet part of cxgb4 at this point?

Hi Jakub,

 The current maintainer for cxgb4 driver is Sourabh Sagar <[email protected]>, I have added him in the CC. He will update the MAINTAINERS file for cxgb4 driver.

 Thanks,
 Ayush

maintainer
#15 lore raw
Quoted 3 lines · On Fri, 6 Oct 2023 01:58:54 +0530 Ayush Sawal wrote:

 The current maintainer for cxgb4 driver is Sourabh Sagar
<[email protected]>, I have added him in the CC.
 He will update the MAINTAINERS file for cxgb4 driver.

Thanks & looking forward to the update!

#16 lore raw
In reply to Kees Cook
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Fri, 29 Sep 2023 11:11:44 -0700 you wrote:

Hi,

This annotates several chelsio structures with the coming __counted_by attribute for bounds checking of flexible arrays at run-time. For more details, see commit dd06e72e68bc ("Compiler Attributes: Add __counted_by macro").

Thanks!

[...]

Here is the summary with links:
- [1/5] chelsio/l2t: Annotate struct l2t_data with __counted_by

    https://git.kernel.org/netdev/net-next/c/3bbae5f1c651
  - [2/5] cxgb4: Annotate struct clip_tbl with __counted_by
    https://git.kernel.org/netdev/net-next/c/c3db467b0822
  - [3/5] cxgb4: Annotate struct cxgb4_tc_u32_table with __counted_by
    https://git.kernel.org/netdev/net-next/c/157c56a4fede
  - [4/5] cxgb4: Annotate struct sched_table with __counted_by
    https://git.kernel.org/netdev/net-next/c/ceba9725fb45
  - [5/5] cxgb4: Annotate struct smt_data with __counted_by
    https://git.kernel.org/netdev/net-next/c/1508cb7e0752

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html