lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sat, 20 Oct 2007 01:14:57 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [Git pull] arch/x86 updates


* Linus Torvalds <torvalds@...ux-foundation.org> wrote:

> On Fri, 19 Oct 2007, Thomas Gleixner wrote:
> > 
> > Pavel Emelyanov (1):
> >       i386: consolidate show_regs and show_registers for i386
> 
> While I think this is good otherwise, why does it do
> 
> 	printk(".. comm: %.*s .."
> 		TASK_COMM_LEN, current->comm,
> 
> instead of just using "%s" and "current->comm"? I only noticed because 
> there was an unrelated conflict around that thing.
> 
> That "current->comm" had better be NUL-terminated already, we use it 
> as such all over the place. And if it's not, *that* should be fixed.
> 
> I'm editing it back to the simpler pure string.

it might make some marginal sense to get an oops message out when 
there's stack overflow/corruption that damages task->comm. I've seen a 
good number of traces that printed out task->comm as an overlength 
string - which obscured other, possibly more important info that could 
have been printed until the system became so hosed that it would not 
print anything.

but ... this is really splitting hairs and even when the stack and hence 
the task struct is corrupted, an accidental NIL character is almost 
always a certainty. I remember only a single case in the past ~10 years 
where an oops would print a "never ending" p->comm because the 
corruption was a runaway memset to a non-0 value.

so printing it as %s should be perfectly fine too, for all practical 
purposes. (and printing it _without_ the TASK_COMM_LEN complication 
might help get out information faster in some other crash situations - 
so the argument can be made in the opposite direction too.)

	Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ