lkml.org 
[lkml]   [2002]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: AUDIT: copy_from_user is a deathtrap.


    On Mon, 20 May 2002, Rusty Russell wrote:
    >
    > If read always returns the amount read (ignoring any copy_to_user
    > errors), then you can repeat it by seeking backwards[1] and redoing the
    > read.

    No.

    > So copy_to_user can simply deliver a SIGSEGV and return "success", and
    > everything will work (except sockets, pipes, etc).

    I don't mind the SIGSEGV, but I refuse to make a stupid change that has
    absolutely _zero_ reason for it.

    The current "copy_to/from_user()" is perfectly fine. It's very simple to
    do

    if (copy_from_user(xxx))
    return -EFAULT;

    and it is not AT ALL simpler to do

    ret = copy_from_user(xxx);
    if (ret)
    return ret;

    which is apparently your suggestion.

    So a lot of people didn't get it? Arnaldo seems to have fixed a lot of
    them already, and maybe you who apparently care can add _documentation_,
    but the fact is that there is no reason to make a less powerful interface.

    Linus

    -
    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:26    [W:0.021 / U:62.904 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site