[RESEND PATCH v4] ext4: Annotate struct ext4_xattr_inode_array with __counted_by()

2024-08-13 Thread Thorsten Blum
Add the __counted_by compiler attribute to the flexible array member inodes to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Remove the now obsolete comment on the count field. In ext4_expand_inode_array(), use struct_size() instead of offsetof() and remove the

Re: [PATCH][next] wifi: mwl8k: Use static_assert() to check struct sizes

2024-08-13 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > Commit 5c4250092fad ("wifi: mwl8k: Avoid -Wflex-array-member-not-at-end > warnings") introduced tagged `struct mwl8k_cmd_pkt_hdr`. We want to > ensure that when new members need to be added to the flexible structure, > they are always included within this tagged str

[PATCH 0/3] kprobes: Annotate structs with __counted_by()

2024-08-13 Thread Jinjie Ruan
Annotate structs with __counted_by() for kprobe and do some cleanup. Jinjie Ruan (3): kprobes: Annotate structs with __counted_by() kprobes: Cleanup the config comment kprobes: Cleanup collect_one_slot() and __disable_kprobe() kernel/kprobes.c | 87 -

[PATCH 1/3] kprobes: Annotate structs with __counted_by()

2024-08-13 Thread Jinjie Ruan
Add the __counted_by compiler attribute to the flexible array member stripes to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Signed-off-by: Jinjie Ruan --- kernel/kprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/kprobes.c b

[PATCH 2/3] kprobes: Cleanup the config comment

2024-08-13 Thread Jinjie Ruan
The CONFIG_KPROBES_ON_FTRACE #if/#else/#endif section is small and doesn't nest additional #ifdefs so the comment is useless and should be removed, but the __ARCH_WANT_KPROBES_INSN_SLOT and CONFIG_OPTPROBES() nest is long, it is better to add comment for reading. Signed-off-by: Jinjie Ruan --- k

[PATCH 3/3] kprobes: Cleanup collect_one_slot() and __disable_kprobe()

2024-08-13 Thread Jinjie Ruan
If kip->nused is not zero, collect_one_slot() return false, otherwise do a lot of linked list operations, reverse the processing order to make the code if nesting more concise. __disable_kprobe() is the same as well. Signed-off-by: Jinjie Ruan --- kernel/kprobes.c | 79 --

[PATCH] bpf: Annotate struct bpf_cand_cache with __counted_by()

2024-08-13 Thread Thorsten Blum
Add the __counted_by compiler attribute to the flexible array member cands to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Increment cnt before adding a new struct to the cands array. Signed-off-by: Thorsten Blum --- kernel/bpf/btf.c | 6 +++--- 1 file chang

Re: [PATCH] bpf: Annotate struct bpf_cand_cache with __counted_by()

2024-08-13 Thread Alexei Starovoitov
On Tue, Aug 13, 2024 at 8:19 AM Thorsten Blum wrote: > > Add the __counted_by compiler attribute to the flexible array member > cands to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and > CONFIG_FORTIFY_SOURCE. > > Increment cnt before adding a new struct to the cands array. why? What h

Re: [PATCH] bpf: Annotate struct bpf_cand_cache with __counted_by()

2024-08-13 Thread Thorsten Blum
On 13. Aug 2024, at 18:28, Alexei Starovoitov wrote: > On Tue, Aug 13, 2024 at 8:19 AM Thorsten Blum > wrote: >> >> Add the __counted_by compiler attribute to the flexible array member >> cands to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and >> CONFIG_FORTIFY_SOURCE. >> >> Incre

Re: [PATCH] bpf: Annotate struct bpf_cand_cache with __counted_by()

2024-08-13 Thread Alexei Starovoitov
On Tue, Aug 13, 2024 at 10:59 AM Thorsten Blum wrote: > > On 13. Aug 2024, at 18:28, Alexei Starovoitov > wrote: > > On Tue, Aug 13, 2024 at 8:19 AM Thorsten Blum > > wrote: > >> > >> Add the __counted_by compiler attribute to the flexible array member > >> cands to improve access bounds-check

Re: [PATCH v2 06/11] dt-bindings: nfc: nxp,nci: Document PN553 compatible

2024-08-13 Thread Rob Herring
On Fri, Aug 09, 2024 at 07:39:53AM +0200, Krzysztof Kozlowski wrote: > On 08/08/2024 20:40, Danila Tikhonov wrote: > > The PN553 is another NFC chip from NXP, document the compatible in the > > bindings. > > > > Signed-off-by: Danila Tikhonov > > --- > > Documentation/devicetree/bindings/net/nfc

Re: [PATCH v2 06/11] dt-bindings: nfc: nxp,nci: Document PN553 compatible

2024-08-13 Thread Rob Herring (Arm)
On Thu, 08 Aug 2024 21:40:20 +0300, Danila Tikhonov wrote: > The PN553 is another NFC chip from NXP, document the compatible in the > bindings. > > Signed-off-by: Danila Tikhonov > --- > Documentation/devicetree/bindings/net/nfc/nxp,nci.yaml | 1 + > 1 file changed, 1 insertion(+) > Acked-by

Re: [PATCH] bpf: Annotate struct bpf_cand_cache with __counted_by()

2024-08-13 Thread Eduard Zingerman
On Tue, 2024-08-13 at 11:57 -0700, Alexei Starovoitov wrote: > On Tue, Aug 13, 2024 at 10:59 AM Thorsten Blum > wrote: > > > > On 13. Aug 2024, at 18:28, Alexei Starovoitov > > wrote: > > > On Tue, Aug 13, 2024 at 8:19 AM Thorsten Blum > > > wrote: > > > > > > > > Add the __counted_by compile

Re: [PATCH] bpf: Annotate struct bpf_cand_cache with __counted_by()

2024-08-13 Thread Thorsten Blum
On 13. Aug 2024, at 20:57, Alexei Starovoitov wrote: > On Tue, Aug 13, 2024 at 10:59 AM Thorsten Blum > wrote: >> On 13. Aug 2024, at 18:28, Alexei Starovoitov >> wrote: >>> On Tue, Aug 13, 2024 at 8:19 AM Thorsten Blum >>> wrote: Add the __counted_by compiler attribute to the fl

[PATCH 0/2][next] UAPI: net/sched - cxgb4: Fix -Wflex-array-member-not-at-end warning

2024-08-13 Thread Gustavo A. R. Silva
Small patch series aimed at fixing a -Wflex-array-member-not-at-end warning by creating a new tagged struct within a flexible structure. We then use this new struct type to fix a problematic middle-flex-array declaration in a composite struct. Gustavo A. R. Silva (2): UAPI: net/sched: Use __stru

[PATCH 1/2][next] UAPI: net/sched: Use __struct_group() in flex struct tc_u32_sel

2024-08-13 Thread Gustavo A. R. Silva
Use the `__struct_group()` helper to create a new tagged `struct tc_u32_sel_hdr`. This structure groups together all the members of the flexible `struct tc_u32_sel` except the flexible array. As a result, the array is effectively separated from the rest of the members without modifying the memory l

[PATCH 2/2][next] cxgb4: Avoid -Wflex-array-member-not-at-end warning

2024-08-13 Thread Gustavo A. R. Silva
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. Change the type of the middle struct member currently causing trouble from `struct tc_u32_sel` to `struct tc_u32_sel_hdr`. Fix the following warning: drivers/net/ethernet/chelsio/cxgb4/cxgb4

[PATCH V7 0/2] Add support for aw96103/aw96105 proximity sensor

2024-08-13 Thread wangshuaijie
From: shuaijie wang Add drivers that support Awinic aw96103/aw96105 proximity sensors. The aw9610x series are high-sensitivity capacitive proximity detection sensors. This device detects human proximity and assists electronic devices in reducing specific absorption rate (SAR) to pass SAR related

[PATCH V7 1/2] dt-bindings: iio: aw96103: Add bindings for aw96103/aw96105 sensor

2024-08-13 Thread wangshuaijie
From: shuaijie wang Add device tree bindings for aw96103/aw96105 proximity sensor. Reviewed-by: Krzysztof Kozlowski Signed-off-by: shuaijie wang --- .../iio/proximity/awinic,aw96103.yaml | 63 +++ 1 file changed, 63 insertions(+) create mode 100644 Documentation/devi

[PATCH V7 2/2] iio: proximity: aw96103: Add support for aw96103/aw96105 proximity sensor

2024-08-13 Thread wangshuaijie
From: shuaijie wang AW96103 is a low power consumption capacitive touch and proximity controller. Each channel can be independently config as sensor input, shield output. Channel Information: aw96103: 3-channel aw96105: 5-channel Signed-off-by: shuaijie wang --- drivers/iio/proximity/Kcon

Re: [PATCH v2 06/11] dt-bindings: nfc: nxp,nci: Document PN553 compatible

2024-08-13 Thread Krzysztof Kozlowski
On 13/08/2024 21:33, Rob Herring wrote: > On Fri, Aug 09, 2024 at 07:39:53AM +0200, Krzysztof Kozlowski wrote: >> On 08/08/2024 20:40, Danila Tikhonov wrote: >>> The PN553 is another NFC chip from NXP, document the compatible in the >>> bindings. >>> >>> Signed-off-by: Danila Tikhonov >>> --- >>>