lkml.org 
[lkml]   [2003]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] prevent "dd if=/dev/mem" crash
On 19 Oct 2003, Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
> > > Old behavior:
> > >
> > > # dd if=/dev/mem of=/dev/null
> > > <unrecoverable machine check>
> >
> > 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.087 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site