[lkml]   [2002]   [May]   [21]   [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, Andrew Morton wrote:
    > Pavel makes a reasonable point that copy_*_user may elect
    > to copy the data in something other than strictly ascending
    > user virtual addresses. In which case it's not possible to return
    > a sane "how much was copied" number.

    I don't agree that that is true.

    Do you have _any_ reasonable implementation taht would do that_

    > And copy_*_user is buggy at present: it doesn't correctly handle
    > the case where the source and destination of the copy are overlapping
    > in the same physical page. Example code below.

    So we have memcpy() semantics for read()/write(), big deal.

    The same way you aren't supposed to use memcpy() for overlapping areas,
    you're not supposed to read/write into such areas, for all the same

    > One fix is to
    > do the copy with descending addresses if src<dest or whatever.

    No. That wouldn't work anyway, because the addresses are totally different

    > But then how to return the number of bytes??

    The way we do now, which is the CORRECT way.

    Stop this idiocy.

    The current interface is quite well-defined, and has good semantics. Every
    single argument against it has been totally bogus, with no redeeming


    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:4.068 / U:1.260 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site