Re: FAILED: patch "[PATCH] tee: add overflow check in register_shm_helper()" failed to apply to 5.4-stable tree

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

 



On Sun, Aug 21, 2022 at 12:00 AM <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
>
> The patch below does not apply to the 5.4-stable tree.

Yeah, there's some major re-org made by commit 53e16519c2ec ("tee:
replace tee_shm_register()") and related in this area in v5.18.

I think you need to just add that

        if (!access_ok((void __user *)data.addr, data.length))
                return -EFAULT;

to tee_ioctl_shm_register() just before the call to tee_shm_register().

It's where it checks "data.flags" too:

        /* Currently no input flags are supported */
        if (data.flags)
                return -EINVAL;

so it lines up with that whole "check ioctl arguments in the memory
block we just copied".

But Jens should probably double-check that.

                Linus



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux