[PATCH v2] lsm: Add a __counted_by() annotation to lsm_ctx.ctx

Paul Moore paul at paul-moore.com
Fri Dec 22 23:00:36 UTC 2023


On Dec 22, 2023 Mark Brown <broonie at kernel.org> wrote:
> 
> The ctx in struct lsm_ctx is an array of size ctx_len, tell the compiler
> about this using __counted_by() where supported to improve the ability to
> detect overflow issues.
> 
> Reported-by: Aishwarya TCV <aishwarya.tcv at arm.com>
> Signed-off-by: Mark Brown <broonie at kernel.org>
> ---
> Changes in v2:
> - Add explicit stddef.h inclusion in case __counted_by() definition
>   isn't otherwise pulled in.
> - Link to v1: https://lore.kernel.org/r/20231221-lsm-fix-counted-by-v1-1-12cc27597cdf@kernel.org
> ---
>  include/uapi/linux/lsm.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied to lsm/dev, thanks!

--
paul-moore.com



More information about the Linux-security-module-archive mailing list