* [PATCH] lkdtm/bugs: Improve warning message for compilers without counted_by support
@ 2024-03-21 20:18 Nathan Chancellor
2024-03-21 20:34 ` Gustavo A. R. Silva
2024-03-22 3:37 ` Kees Cook
0 siblings, 2 replies; 3+ messages in thread
From: Nathan Chancellor @ 2024-03-21 20:18 UTC (permalink / raw)
To: keescook; +Cc: gustavoars, linux-hardening, patches, Nathan Chancellor
The current message for telling the user that their compiler does not
support the counted_by attribute in the FAM_BOUNDS test does not make
much sense either grammatically or semantically. Fix it to make it
correct in both aspects.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
drivers/misc/lkdtm/bugs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/lkdtm/bugs.c b/drivers/misc/lkdtm/bugs.c
index b92767d6bdd2..5178c02b21eb 100644
--- a/drivers/misc/lkdtm/bugs.c
+++ b/drivers/misc/lkdtm/bugs.c
@@ -417,7 +417,7 @@ static void lkdtm_FAM_BOUNDS(void)
pr_err("FAIL: survived access of invalid flexible array member index!\n");
if (!__has_attribute(__counted_by__))
- pr_warn("This is expected since this %s was built a compiler supporting __counted_by\n",
+ pr_warn("This is expected since this %s was built with a compiler that does not support __counted_by\n",
lkdtm_kernel_info);
else if (IS_ENABLED(CONFIG_UBSAN_BOUNDS))
pr_expected_config(CONFIG_UBSAN_TRAP);
---
base-commit: 8d8b79685237b15f4bb676781f6bf241beb068a8
change-id: 20240321-lkdtm-improve-lack-of-counted_by-msg-d3b9006bd6e3
Best regards,
--
Nathan Chancellor <nathan@kernel.org>
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] lkdtm/bugs: Improve warning message for compilers without counted_by support
2024-03-21 20:18 [PATCH] lkdtm/bugs: Improve warning message for compilers without counted_by support Nathan Chancellor
@ 2024-03-21 20:34 ` Gustavo A. R. Silva
2024-03-22 3:37 ` Kees Cook
1 sibling, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2024-03-21 20:34 UTC (permalink / raw)
To: Nathan Chancellor, keescook; +Cc: gustavoars, linux-hardening, patches
On 3/21/24 14:18, Nathan Chancellor wrote:
> The current message for telling the user that their compiler does not
> support the counted_by attribute in the FAM_BOUNDS test does not make
> much sense either grammatically or semantically. Fix it to make it
> correct in both aspects.
>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Looks good to me :)
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Thanks!
--
Gustavo
> ---
> drivers/misc/lkdtm/bugs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/lkdtm/bugs.c b/drivers/misc/lkdtm/bugs.c
> index b92767d6bdd2..5178c02b21eb 100644
> --- a/drivers/misc/lkdtm/bugs.c
> +++ b/drivers/misc/lkdtm/bugs.c
> @@ -417,7 +417,7 @@ static void lkdtm_FAM_BOUNDS(void)
> pr_err("FAIL: survived access of invalid flexible array member index!\n");
>
> if (!__has_attribute(__counted_by__))
> - pr_warn("This is expected since this %s was built a compiler supporting __counted_by\n",
> + pr_warn("This is expected since this %s was built with a compiler that does not support __counted_by\n",
> lkdtm_kernel_info);
> else if (IS_ENABLED(CONFIG_UBSAN_BOUNDS))
> pr_expected_config(CONFIG_UBSAN_TRAP);
>
> ---
> base-commit: 8d8b79685237b15f4bb676781f6bf241beb068a8
> change-id: 20240321-lkdtm-improve-lack-of-counted_by-msg-d3b9006bd6e3
>
> Best regards,
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] lkdtm/bugs: Improve warning message for compilers without counted_by support
2024-03-21 20:18 [PATCH] lkdtm/bugs: Improve warning message for compilers without counted_by support Nathan Chancellor
2024-03-21 20:34 ` Gustavo A. R. Silva
@ 2024-03-22 3:37 ` Kees Cook
1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2024-03-22 3:37 UTC (permalink / raw)
To: Nathan Chancellor; +Cc: Kees Cook, gustavoars, linux-hardening, patches
On Thu, 21 Mar 2024 13:18:17 -0700, Nathan Chancellor wrote:
> The current message for telling the user that their compiler does not
> support the counted_by attribute in the FAM_BOUNDS test does not make
> much sense either grammatically or semantically. Fix it to make it
> correct in both aspects.
>
>
Applied to for-next/hardening, thanks!
[1/1] lkdtm/bugs: Improve warning message for compilers without counted_by support
https://git.kernel.org/kees/c/8b93450af173
Take care,
--
Kees Cook
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-03-22 3:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-21 20:18 [PATCH] lkdtm/bugs: Improve warning message for compilers without counted_by support Nathan Chancellor
2024-03-21 20:34 ` Gustavo A. R. Silva
2024-03-22 3:37 ` Kees Cook
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox