Messages in this thread | | | From | Arnd Bergmann <> | Date | Thu, 25 Apr 2019 17:32:05 +0200 | Subject | Re: [PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl |
| |
On Thu, Apr 25, 2019 at 5:22 PM Mauro Carvalho Chehab <mchehab+samsung@kernel.org> wrote: > Em Tue, 16 Apr 2019 22:25:33 +0200 Arnd Bergmann <arnd@arndb.de> escreveu: > > If I understand your patch description well, using compat_ptr_ioctl > only works if the driver is not for s390, right?
No, the purpose of compat_ptr_ioctl() is to make sure it works everywhere including s390.
Even on s390 it tends to work most of the time, but for correctness the upper bit of a 32-bit pointer needs to be cleared, as compat_ptr_ioctl does, in case some application passes a pointer with that bit set. [IIRC, in the instruction pointer, the high bit is set, in data references it is ignored but usually cleared, but it may be left on for IP-relative address generation]
Arnd
| |