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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.1.10.0807280846320.3486@nehalem.linux-foundation.org>
Date:	Mon, 28 Jul 2008 08:48:41 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Vitaly Mayatskikh <v.mayatskih@...il.com>
cc:	linux-kernel@...r.kernel.org, Andi Kleen <andi@...stfloor.org>,
	Ingo Molnar <mingo@...e.hu>
Subject: Re: [PATCH] x86: Optimize tail handling for copy_user



On Mon, 28 Jul 2008, Vitaly Mayatskikh wrote:
>
> Reduce protection faults count in copy_user_handle_tail routine by
> limiting clear length to the end of page as was suggested by Linus.

No, you did it wrong.

The page _clearing_ has to be to the end of the copy. Yes, in practice, I 
don't think the kernel actually very often does "copy_from_user()" calls 
that are page crossers in the kernel, but they do happen.

It's the _copy_ part that needn't cross pages, because we know that 
something faulted, and we _know_ that it wasn't the clearing.

Really: the clearing should be just a "memset()" with no limitations. It 
can never fault without it being a serious bug, and then we should not fix 
it up, but we should oops!

			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