[lkml]   [2005]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: select() for delay.
    Hi Maduhu,

    On Mon, 2005-10-24 at 16:25 +0530, wrote:

    > + put_user(sec, &tvp->tv_sec);
    > + put_user(usec, &tvp->tv_usec);

    I won't comment on the rest of the patch, but this part is definitely
    wrong. The pointer tvp is a user space address and once you dereference
    that pointer to get to tv_sec, you can have a fault, which might
    segfault the processes.

    What you really want is something like:

    timeval tv;

    tv.tv_sec = sec;
    tv.tv_usec = usec;
    copy_to_user(tvp, &tv, sizeof(tv));

    -- Steve

    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-10-24 15:22    [W:0.019 / U:0.232 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site