kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] sparc64: make string buffers large enough
@ 2016-11-25 11:03 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2016-11-25 11:03 UTC (permalink / raw)
  To: kernel-janitors

My static checker complains that if "lvl" is ULONG_MAX (this is 64 bit)
then some of the strings will overflow.  I don't know if that's possible
but it seems simple enough to make the buffers slightly larger.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
index 4094a51..496fa92 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -85,7 +85,7 @@ static void dump_tl1_traplog(struct tl1_traplog *p)
 
 void bad_trap(struct pt_regs *regs, long lvl)
 {
-	char buffer[32];
+	char buffer[36];
 	siginfo_t info;
 
 	if (notify_die(DIE_TRAP, "bad trap", regs,
@@ -116,7 +116,7 @@ void bad_trap(struct pt_regs *regs, long lvl)
 
 void bad_trap_tl1(struct pt_regs *regs, long lvl)
 {
-	char buffer[32];
+	char buffer[36];
 	
 	if (notify_die(DIE_TRAP_TL1, "bad trap tl1", regs,
 		       0, lvl, SIGTRAP) = NOTIFY_STOP)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] sparc64: make string buffers large enough
@ 2016-12-12  2:18 David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-12-12  2:18 UTC (permalink / raw)
  To: kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 25 Nov 2016 14:03:55 +0300

> My static checker complains that if "lvl" is ULONG_MAX (this is 64 bit)
> then some of the strings will overflow.  I don't know if that's possible
> but it seems simple enough to make the buffers slightly larger.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-12  2:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-25 11:03 [patch] sparc64: make string buffers large enough Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2016-12-12  2:18 David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).