diff options
| author | Thorsten Blum <[email protected]> | 2025-02-13 22:13:52 +0000 |
|---|---|---|
| committer | Petr Pavlu <[email protected]> | 2025-03-10 10:54:46 +0000 |
| commit | 3690f4a86005b4b15fabc606d2bbf39bb6290aff (patch) | |
| tree | 8f689ee55a365a7ddad1738aeb7d0e056db2bdc3 /scripts/generate_rust_analyzer.py | |
| parent | bug: Use RCU instead RCU-sched to protect module_bug_list. (diff) | |
| download | kernel-3690f4a86005b4b15fabc606d2bbf39bb6290aff.tar.gz kernel-3690f4a86005b4b15fabc606d2bbf39bb6290aff.zip | |
params: Annotate struct module_param_attrs with __counted_by()
Add the __counted_by compiler attribute to the flexible array member
attrs to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.
Increment num before adding a new param_attribute to the attrs array and
adjust the array index accordingly. Increment num immediately after the
first reallocation such that the reallocation for the NULL terminator
only needs to add 1 (instead of 2) to mk->mp->num.
Use struct_size() instead of manually calculating the size for the
reallocation.
Use krealloc_array() for the additional NULL terminator.
Cc: Andy Shevchenko <[email protected]>
Cc: Luis Chamberlain <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Signed-off-by: Thorsten Blum <[email protected]>
Reviewed-by: Luis Chamberlain <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Petr Pavlu <[email protected]>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions
