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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 8 Feb 2008 13:58:44 -0800 (PST)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Jan Kiszka <jan.kiszka@....de>
cc:	Andi Kleen <andi@...stfloor.org>,
	Maxim Levitsky <maximlevitsky@...il.com>,
	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Jason Wessel <jason.wessel@...driver.com>
Subject: Re: [RFC][PATCH] KGDB: remove kgdb-own fault handling (was: Re: [git
 pull] x86 arch updates for v2.6.25)



On Fri, 8 Feb 2008, Jan Kiszka wrote:
> 
> Well, let's try it this way: Find below a patch against kgdb.git that
> removes the special fault handling (this wouldn't be the first feature I
> recently removed from kgdb :->). Light testing revealed no obvious
> problems yet.

That is indeed horrible code. No way will I merge anything that has things 
like that even in it's *history* (ie somebody needs to re-generate the 
tree without code like that - some things should not be allowed to exist).

That said, while just using "probe_kernel_addr()" is certainly much 
better, it's still really inefficient. If you actually want to do a "safe 
memory copy", then the right way to do that is basically to do

	pagefault_disable();
	leftover = __copy_from_user_inatomic(dst, src, count);
	pagefault_enable();

	if (leftover)
		handle_the_fact_that_the_copy_didnt_complete();

which should even be reasonably efficient and should work in all contexts 
(hardware interrupts disabled, spinlocks held, you name it).

So all those "kgdb_{get|set}_mem()" things seem bogus (they also have 
insane calling semantics - return NULL or errptr? Why not just return an 
integer error code?

		Linus
--
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