Re: [PATCH RFC v2] m68k: remove get_fs()/set_fs()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 9, 2021 at 12:52 PM Michael Schmitz <schmitzmic@xxxxxxxxx> wrote:

That one got called from sys_llseek+0x5c/0x86

That's the

        if (offset >= 0) {
                retval = -EFAULT;
                if (!copy_to_user(result, &offset, sizeof(offset)))
                        retval = 0;
        }

and it might be worth doing a put_user() for. That would actually
simplify the code to just

        if (offset >= 0)
                retval = put_user(offset, result);

or something like that.

Except maybe there's some 32-bit architecture that doesn't support
8-byte get/put_user(), which may be why it's a copy_to_user().

I _think_ we made the rule be that everybody had to support 1/2/4/8
byte accesses, but maybe I remember incorrectly.

             Linus



[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux