diff options
| author | Bill Wendling <morbo@google.com> | 2026-09-23 06:10:27 +0000 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2026-10-02 18:12:43 +1000 |
| commit | e620245bff228aa8e482a19b72b8469366305d4c (patch) | |
| tree | d7c265bbdfd9d07e9bf9f74f478d4039a33ee81d /include/linux | |
| parent | 973eb89550d347aa4bc4e58452cf7a0d13fde29e (diff) | |
| download | linux-next-e620245bff228aa8e482a19b72b8469366305d4c.tar.gz linux-next-e620245bff228aa8e482a19b72b8469366305d4c.zip | |
crypto: hisilicon/qm - add __counted_by_ptr to dfx_diff_registers
Annotate the pointer field 'regs' in 'struct dfx_diff_registers' with
the '__counted_by_ptr' attribute, referencing the 'reg_len' member
which holds the element count of the allocated memory.
In 'drivers/crypto/hisilicon/debugfs.c', the 'dfx_regs_init' function
allocates the 'diff_regs' array and initializes each element's 'regs'
pointer after setting its 'reg_len'.
Since 'reg_len' is set before 'regs' is assigned, the compiler's bounds
sanitizer can correctly associate the pointer with its allocated size.
Cc: codemender-patching+linux@google.com
Assisted-by: LLM
Signed-off-by: Bill Wendling <morbo@google.com>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/hisi_acc_qm.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/hisi_acc_qm.h b/include/linux/hisi_acc_qm.h index 8dc49fa2123b..f2885d60b468 100644 --- a/include/linux/hisi_acc_qm.h +++ b/include/linux/hisi_acc_qm.h @@ -196,7 +196,7 @@ struct qm_dev_dfx { }; struct dfx_diff_registers { - u32 *regs; + u32 *regs __counted_by_ptr(reg_len); u32 reg_offset; u32 reg_len; }; |
