Re: [PATCH v4 3/4] dt-bindings: interconnect: add clock property to enable QOS on SC7280

2024-03-26 Thread Krzysztof Kozlowski
On 25/03/2024 19:16, Odelu Kukatla wrote: > Added clock property to enable clocks required for accessing > qos registers. > > Signed-off-by: Odelu Kukatla > --- > .../bindings/interconnect/qcom,sc7280-rpmh.yaml| 14 ++ > 1 file changed, 14 insertions(+) > > diff --git > a/Docum

Re: [PATCH][next] fs: Annotate struct file_handle with __counted_by() and use struct_size()

2024-03-26 Thread Jan Kara
On Mon 25-03-24 19:34:01, Gustavo A. R. Silva wrote: > 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 via CONFIG_UBSAN_BOUNDS (for > array indexing) and C

Re: [PATCH v3 4/7] kunit: Handle test faults

2024-03-26 Thread Mickaël Salaün
On Sat, Mar 23, 2024 at 03:37:21PM +0800, David Gow wrote: > On Tue, 19 Mar 2024 at 18:49, Mickaël Salaün wrote: > > > > Previously, when a kernel test thread crashed (e.g. NULL pointer > > dereference, general protection fault), the KUnit test hanged for 30 > > seconds and exited with a timeout e

[PATCH v4 1/7] kunit: Handle thread creation error

2024-03-26 Thread Mickaël Salaün
Previously, if a thread creation failed (e.g. -ENOMEM), the function was called (kunit_catch_run_case or kunit_catch_run_case_cleanup) without marking the test as failed. Instead, fill try_result with the error code returned by kthread_run(), which will mark the test as failed and print "internal

[PATCH v4 3/7] kunit: Fix timeout message

2024-03-26 Thread Mickaël Salaün
The exit code is always checked, so let's properly handle the -ETIMEDOUT error code. Cc: Brendan Higgins Cc: Shuah Khan Reviewed-by: Kees Cook Reviewed-by: David Gow Reviewed-by: Rae Moar Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240326095118.126696-4-...@digikod.net --

[PATCH v4 0/7] Handle faults in KUnit tests

2024-03-26 Thread Mickaël Salaün
Hi, This patch series teaches KUnit to handle kthread faults as errors, and it brings a few related fixes and improvements. Shuah, everything should be OK now, could you please merge this series? All these tests pass (on top of v6.8): ./tools/testing/kunit/kunit.py run --alltests ./tools/testing

[PATCH v4 5/7] kunit: Fix KUNIT_SUCCESS() calls in iov_iter tests

2024-03-26 Thread Mickaël Salaün
Fix KUNIT_SUCCESS() calls to pass a test argument. This is a no-op for now because this macro does nothing, but it will be required for the next commit. Cc: Brendan Higgins Cc: Rae Moar Cc: Shuah Khan Reviewed-by: Kees Cook Reviewed-by: David Gow Signed-off-by: Mickaël Salaün Link: https://

[PATCH v4 6/7] kunit: Print last test location on fault

2024-03-26 Thread Mickaël Salaün
This helps identify the location of test faults with opportunistic calls to _KUNIT_SAVE_LOC(). This can be useful while writing tests or debugging them. It is possible to call KUNIT_SUCCESS() to explicit save last location. Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Cc: Shuah Khan Review

[PATCH v4 7/7] kunit: Add tests for fault

2024-03-26 Thread Mickaël Salaün
Add a test case to check NULL pointer dereference and make sure it would result as a failed test. The full kunit_fault test suite is marked as skipped when run on UML because it would result to a kernel panic. Tested with: ./tools/testing/kunit/kunit.py run --arch x86_64 kunit_fault ./tools/testi

[PATCH v4 2/7] kunit: Fix kthread reference

2024-03-26 Thread Mickaël Salaün
There is a race condition when a kthread finishes after the deadline and before the call to kthread_stop(), which may lead to use after free. Cc: Brendan Higgins Cc: Shuah Khan Reviewed-by: Kees Cook Fixes: adf505457032 ("kunit: fix UAF when run kfence test case test_gfpzero") Reviewed-by: Davi

[PATCH v4 4/7] kunit: Handle test faults

2024-03-26 Thread Mickaël Salaün
Previously, when a kernel test thread crashed (e.g. NULL pointer dereference, general protection fault), the KUnit test hanged for 30 seconds and exited with a timeout error. Fix this issue by waiting on task_struct->vfork_done instead of the custom kunit_try_catch.try_completion, and track the ex

Re: [PATCH v2][next] fsnotify: Avoid -Wflex-array-member-not-at-end warning

2024-03-26 Thread Jan Kara
On Mon 25-03-24 19:36:02, Gustavo A. R. Silva wrote: > Use the `DEFINE_FLEX()` helper for an on-stack definition of a > flexible structure where the size of the flexible-array member > is known at compile-time, and refactor the rest of the code, > accordingly. > > So, with these changes, fix the f

Re: [PATCH][next] fs: Annotate struct file_handle with __counted_by() and use struct_size()

2024-03-26 Thread Christian Brauner
On Mon, 25 Mar 2024 19:34:01 -0600, Gustavo A. R. Silva wrote: > 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 via CONFIG_UBSAN_BOUNDS (for > array index

Re: [PATCH v2][next] ALSA: firewire-lib: Avoid -Wflex-array-member-not-at-end warning

2024-03-26 Thread Takashi Iwai
On Tue, 26 Mar 2024 02:59:34 +0100, Gustavo A. R. Silva wrote: > > Use the `DEFINE_FLEX()` helper for an on-stack definition of a > flexible structure where the size of the flexible-array member > is known at compile-time, and refactor the rest of the code, > accordingly. > > So, with these chang

[PATCH net-next 0/3] compiler_types: add Endianness-dependent __counted_by_{le,be}

2024-03-26 Thread Alexander Lobakin
Some structures contain flexible arrays at the end and the counter for them, but the counter has explicit Endianness and thus __counted_by() can't be used directly. To increase test coverage for potential problems without breaking anything, introduce __counted_by_{le,be} defined depending on platf

[PATCH net-next 1/3] compiler_types: add Endianness-dependent __counted_by_{le,be}

2024-03-26 Thread Alexander Lobakin
Some structures contain flexible arrays at the end and the counter for them, but the counter has explicit Endianness and thus __counted_by() can't be used directly. To increase test coverage for potential problems without breaking anything, introduce __counted_by_{le,be}() defined depending on pla

[PATCH net-next 2/3] idpf: make virtchnl2.h self-contained

2024-03-26 Thread Alexander Lobakin
To ease maintaining of virtchnl2.h, which already is messy enough, make it self-contained by adding missing if_ether.h include due to %ETH_ALEN usage. At the same time, virtchnl2_lan_desc.h is not used anywhere in the file, so remove this include to speed up C preprocessing. Acked-by: Kees Cook S

[PATCH net-next 3/3] idpf: sprinkle __counted_by{,_le}() in the virtchnl2 header

2024-03-26 Thread Alexander Lobakin
Both virtchnl2.h and its consumer idpf_virtchnl.c are very error-prone. There are 10 structures with flexible arrays at the end, but 9 of them has flex member counter in Little Endian. Make the code a bit more robust by applying __counted_by_le() to those 9. LE platforms is the main target for this

Re: [PATCH net-next 1/3] compiler_types: add Endianness-dependent __counted_by_{le,be}

2024-03-26 Thread Gustavo A. R. Silva
On 3/26/24 10:41, Alexander Lobakin wrote: Some structures contain flexible arrays at the end and the counter for them, but the counter has explicit Endianness and thus __counted_by() can't be used directly. To increase test coverage for potential problems without breaking anything, introduce

Re: [PATCH net-next 3/3] idpf: sprinkle __counted_by{,_le}() in the virtchnl2 header

2024-03-26 Thread Gustavo A. R. Silva
On 3/26/24 10:41, Alexander Lobakin wrote: Both virtchnl2.h and its consumer idpf_virtchnl.c are very error-prone. There are 10 structures with flexible arrays at the end, but 9 of them has flex member counter in Little Endian. Make the code a bit more robust by applying __counted_by_le() to t

Re: [PATCH net-next 2/3] idpf: make virtchnl2.h self-contained

2024-03-26 Thread Gustavo A. R. Silva
On 3/26/24 10:41, Alexander Lobakin wrote: To ease maintaining of virtchnl2.h, which already is messy enough, make it self-contained by adding missing if_ether.h include due to %ETH_ALEN usage. At the same time, virtchnl2_lan_desc.h is not used anywhere in the file, so remove this include to s

Re: [PATCH v2 0/9] slab: Introduce dedicated bucket allocator

2024-03-26 Thread julien . voisin
25 March 2024 at 19:24, "Kees Cook" wrote: > > On Mon, Mar 25, 2024 at 10:03:23AM +0100, Vlastimil Babka wrote: > > > > > On 3/5/24 11:10 AM, Kees Cook wrote: > > > > Hi, > > > > > > > > Repeating the commit logs for patch 4 here: > > > > > > > > Dedicated caches are available Fo

[PATCH][next] platform/chrome: cros_ec_proto: avoid -Wflex-array-member-not-at-end warnings

2024-03-26 Thread Gustavo A. R. Silva
Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of a flexible structure where the size of the flexible-array member is known at compile-time, and refactor the rest of the code, accordingly. So, with these changes, fix the following warning: drivers/platform/chrome/cros_ec_proto_test.

Re: [PATCH v2 0/9] slab: Introduce dedicated bucket allocator

2024-03-26 Thread Kees Cook
On Tue, Mar 26, 2024 at 06:07:07PM +, julien.voi...@dustri.org wrote: > 25 March 2024 at 19:24, "Kees Cook" wrote: > > On Mon, Mar 25, 2024 at 10:03:23AM +0100, Vlastimil Babka wrote: > > > On 3/5/24 11:10 AM, Kees Cook wrote: > > > Hi, > > > > > > Repeating the commit logs for patch 4 her

[PATCH][next] Bluetooth: L2CAP: Avoid -Wflex-array-member-not-at-end warnings

2024-03-26 Thread Gustavo A. R. Silva
-Wflex-array-member-not-at-end is coming in GCC-14, and we are getting ready to enable it globally. There are currently a couple of objects (`req` and `rsp`), in a couple of structures, that contain flexible structures (`struct l2cap_ecred_conn_req` and `struct l2cap_ecred_conn_rsp`), for example:

Re: [PATCH v4 1/4] interconnect: qcom: icc-rpmh: Add QoS configuration support

2024-03-26 Thread Konrad Dybcio
qcom_icc_node { > u64 max_peak[QCOM_ICC_NUM_BUCKETS]; > struct qcom_icc_bcm *bcms[MAX_BCM_PER_NODE]; > size_t num_bcms; > + const struct qcom_icc_qosbox *qosbox; I believe I came up with a better approach for storing this.. see [1] Konrad [1] https://lore.kerne

Re: [PATCH][next] Bluetooth: L2CAP: Avoid -Wflex-array-member-not-at-end warnings

2024-03-26 Thread Luiz Augusto von Dentz
Hi Gustavo, On Tue, Mar 26, 2024 at 4:02 PM Gustavo A. R. Silva wrote: > > -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting > ready to enable it globally. > > There are currently a couple of objects (`req` and `rsp`), in a couple > of structures, that contain flexible struct

Re: [PATCH][next] Bluetooth: L2CAP: Avoid -Wflex-array-member-not-at-end warnings

2024-03-26 Thread Gustavo A. R. Silva
On 3/26/24 15:12, Luiz Augusto von Dentz wrote: Hi Gustavo, On Tue, Mar 26, 2024 at 4:02 PM Gustavo A. R. Silva wrote: -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting ready to enable it globally. There are currently a couple of objects (`req` and `rsp`), in a couple

[GIT PULL] execve fixes for v6.9-rc2

2024-03-26 Thread Kees Cook
Hi Linus, Please pull these execve fixes for v6.9-rc2. Thanks! -Kees The following changes since commit 725d50261285ccf02501f2a1a6d10b31ce014597: exec: Simplify remove_arg_zero() error path (2024-03-09 13:46:30 -0800) are available in the Git repository at: https://git.kernel.org/pub/scm

[PATCH][next] wifi: wil6210: Annotate struct wmi_set_link_monitor_cmd with __counted_by()

2024-03-26 Thread Gustavo A. R. Silva
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 via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). S

[PATCH][next] wifi: wil6210: Avoid -Wflex-array-member-not-at-end warning

2024-03-26 Thread Gustavo A. R. Silva
Use the `DEFINE_FLEX()` helper for an on-stack definition of a flexible structure where the size of the flexible-array member is known at compile-time, and refactor the rest of the code, accordingly. So, with these changes, fix the following warning: drivers/net/wireless/ath/wil6210/wmi.c:4018:49:

Re: [PATCH net-next 2/3] idpf: make virtchnl2.h self-contained

2024-03-26 Thread Jakub Kicinski
On Tue, 26 Mar 2024 17:41:15 +0100 Alexander Lobakin wrote: > To ease maintaining of virtchnl2.h, which already is messy enough, > make it self-contained by adding missing if_ether.h include due to > %ETH_ALEN usage. > At the same time, virtchnl2_lan_desc.h is not used anywhere in the > file, so re

Re: [PATCH][next] platform/chrome: cros_ec_proto: avoid -Wflex-array-member-not-at-end warnings

2024-03-26 Thread patchwork-bot+chrome-platform
Hello: This patch was applied to chrome-platform/linux.git (for-kernelci) by Tzung-Bi Shih : On Tue, 26 Mar 2024 12:55:10 -0600 you wrote: > Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of > a flexible structure where the size of the flexible-array member > is known at compile-ti

Re: [PATCH][next] platform/chrome: cros_ec_proto: avoid -Wflex-array-member-not-at-end warnings

2024-03-26 Thread patchwork-bot+chrome-platform
Hello: This patch was applied to chrome-platform/linux.git (for-next) by Tzung-Bi Shih : On Tue, 26 Mar 2024 12:55:10 -0600 you wrote: > Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of > a flexible structure where the size of the flexible-array member > is known at compile-time,