lkml.org 
[lkml]   [2020]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 2/2] dlmfs: convert dlmfs_file_read() to copy_to_user()
    On Thu, May 28, 2020 at 08:42:25PM -0700, Linus Torvalds wrote:

    > > struct sigset_argpack argpack = { NULL, 0 };
    > >
    > > if (get_sigset_argpack(sig, &argpack))
    > > return -EFAULT;
    >
    > and now you can use "argpack.sigset" and "argpack.sigset_size".
    >
    > No?
    >
    > Same exact deal for the compat case, where you'd just need that compat
    > struct (using "compat_uptr_t" and "compat_size_t"), and then
    >
    > > struct compat_sigset_argpack argpack = { 0, 0 };
    > >
    > > + if (get_compat_sigset_argpack(sig, &argpack))
    > > + return -EFAULT;
    >
    > and then you use the result with "compat_ptr(argpack.sigset)" and
    > "argpack.sigset_size".
    >
    > Or did I mis-read anything and get confused by that code in your patch?

    Umm... I'd been concerned about code generation, but it actually gets
    split into a pair of scalars just fine...

    Al, trying to resist the temptation to call those struct bad_idea and
    struct bad_idea_32...

    All jokes aside, when had we (or anybody else, really) _not_ gotten
    into trouble when passing structs across the kernel boundary? Sure,
    sometimes you have to (stat, for example), but just look at the amount
    of PITA stat() has spawned...

    \
     
     \ /
      Last update: 2020-05-29 22:48    [W:2.375 / U:0.184 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site