Thread (18 messages) flat view 18 messages, 4 authors, 2021-07-30

Re: [PATCH v5 4/6] mm: simplify compat numa syscalls

From: Arnd Bergmann <arnd@kernel.org>
Date: 2021-07-27 17:40:37
Also in: linux-api, linux-arch, linux-mips, linux-mm, linux-s390, linuxppc-dev, lkml, sparclinux

On Tue, Jul 27, 2021 at 7:27 PM Heiko Carstens [off-list ref] wrote:
On Tue, Jul 27, 2021 at 04:48:57PM +0200, Arnd Bergmann wrote:
quoted
---
 include/linux/compat.h |  17 ++--
 mm/mempolicy.c         | 175 +++++++++++++----------------------------
 2 files changed, 63 insertions(+), 129 deletions(-)
...
quoted
+static int get_bitmap(unsigned long *mask, const unsigned long __user *nmask,
+                   unsigned long maxnode)
+{
+     unsigned long nlongs = BITS_TO_LONGS(maxnode);
+     int ret;
+
+     if (in_compat_syscall())
+             ret = compat_get_bitmap(mask,
+                                     (const compat_ulong_t __user *)nmask,
+                                     maxnode);
compat_ptr() conversion for e.g. nmask is missing with the next patch
which removes the compat system calls.
Is that intended or am I missing something?
I don't think it's needed here, since the pointer comes from the system
call argument, which has the compat_ptr() conversion applied in
arch/s390/include/asm/syscall_wrapper.h, not from a compat_uptr_t
that gets passed indirectly. The compat_get_bitmap() conversion
is only needed for byte order adjustment, not for converting pointers.

It's also possible that I'm the one who's missing something.

        Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help