[lkml]   [2002]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: AUDIT: copy_from_user is a deathtrap.
    On Tue, 21 May 2002 14:46:08 -0700
    Andrew Morton <> wrote:
    > Is it safe to stick a nose in here with some irrelevancies?

    Well, if you can do it, I guess I can too...

    Someone who knows x86 asm better than I can change everything in uaccess.h
    to always return 0, like so:

    #define copy_from_user(to, from, n) \
    ({ \
    /* Returns non-zero only if hit fault handler */ \
    if (general_copy_user((to), (from), (n))) \
    memset(to, 0, n); \
    0; \

    So the fault handler sends a SIGSEGV, and makes generic_copy_user return 1
    immediately (if you were ambitious, it could do the memset too).

    If someone wants to write the asm for that, I'll fix the SEGV delivery code
    and mount option reading (two places where we must not deliver a signal),
    and we can see what it looks like.

    there are those who do and those who hang on and you don't see too
    many doers quoting their contemporaries. -- Larry McVoy
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:26    [W:0.047 / U:112.212 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site