* [RESEND][PATCH] sparc: use %s for unaligned panic
@ 2014-06-30 20:37 Kees Cook
2014-07-14 14:06 ` Sam Ravnborg
2014-07-22 4:38 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Kees Cook @ 2014-06-30 20:37 UTC (permalink / raw)
To: linux-kernel; +Cc: David S. Miller, Sam Ravnborg, sparclinux
Since unaligned_panic() takes a literal string, make sure it can never
accidentally be used as a format string.
Signed-off-by: Kees Cook <keescook@chromium.org>
---
arch/sparc/kernel/unaligned_32.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/sparc/kernel/unaligned_32.c b/arch/sparc/kernel/unaligned_32.c
index c5c61b3c6b56..32b61d1b6379 100644
--- a/arch/sparc/kernel/unaligned_32.c
+++ b/arch/sparc/kernel/unaligned_32.c
@@ -166,7 +166,7 @@ unsigned long safe_compute_effective_address(struct pt_regs *regs,
/* This is just to make gcc think panic does return... */
static void unaligned_panic(char *str)
{
- panic(str);
+ panic("%s", str);
}
/* una_asm.S */
--
1.7.9.5
--
Kees Cook
Chrome OS Security
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RESEND][PATCH] sparc: use %s for unaligned panic
2014-06-30 20:37 [RESEND][PATCH] sparc: use %s for unaligned panic Kees Cook
@ 2014-07-14 14:06 ` Sam Ravnborg
2014-07-22 4:38 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Sam Ravnborg @ 2014-07-14 14:06 UTC (permalink / raw)
To: Kees Cook; +Cc: linux-kernel, David S. Miller, sparclinux
On Mon, Jun 30, 2014 at 01:37:59PM -0700, Kees Cook wrote:
> Since unaligned_panic() takes a literal string, make sure it can never
> accidentally be used as a format string.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> arch/sparc/kernel/unaligned_32.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/sparc/kernel/unaligned_32.c b/arch/sparc/kernel/unaligned_32.c
> index c5c61b3c6b56..32b61d1b6379 100644
> --- a/arch/sparc/kernel/unaligned_32.c
> +++ b/arch/sparc/kernel/unaligned_32.c
> @@ -166,7 +166,7 @@ unsigned long safe_compute_effective_address(struct pt_regs *regs,
> /* This is just to make gcc think panic does return... */
> static void unaligned_panic(char *str)
> {
> - panic(str);
> + panic("%s", str);
> }
>
> /* una_asm.S */
The feedback last time was that this patch is silly.
panic() has only two callsites within the same file.
Sam
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RESEND][PATCH] sparc: use %s for unaligned panic
2014-06-30 20:37 [RESEND][PATCH] sparc: use %s for unaligned panic Kees Cook
2014-07-14 14:06 ` Sam Ravnborg
@ 2014-07-22 4:38 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-07-22 4:38 UTC (permalink / raw)
To: keescook; +Cc: linux-kernel, sam, sparclinux
From: Kees Cook <keescook@chromium.org>
Date: Mon, 30 Jun 2014 13:37:59 -0700
> Since unaligned_panic() takes a literal string, make sure it can never
> accidentally be used as a format string.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
Unnecessary, but harmless, so applied to sparc-next, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-22 4:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-30 20:37 [RESEND][PATCH] sparc: use %s for unaligned panic Kees Cook
2014-07-14 14:06 ` Sam Ravnborg
2014-07-22 4:38 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox