From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Pool Date: Thu, 23 Oct 2003 08:33:16 +0000 Subject: Re: [RFC] prevent "dd if=/dev/mem" crash Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-ia64@vger.kernel.org On 19 Oct 2003, Pavel Machek wrote: > Hi! > > > > Old behavior: > > > > > > # dd if=/dev/mem of=/dev/null > > > > > > > I recently fixed this for ia32 by changing copy_to_user() to not oops if > > the source address generated a fault. Similarly copy_from_user() returns > > an error if the destination generates a fault. > > Are you sure this is not hiding real errors? If you pass wrong > kernel ptr to copy_*_user, it should oops, not mask error with > -EFAULT. > Maybe another copy_user_unsafe should be created? I think the problem is that reading memory that is mapped but doesn't physically exist causes a Machine Check Assertion (like an NMI) rather than a regular fault. -- Martin