Re: [RFC PATCH 07/11] mm/mempolicy: add userland mempolicy arg structure

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

 



On Thu, Dec 7, 2023, at 15:58, Gregory Price wrote:
> On Thu, Dec 07, 2023 at 08:13:22AM +0100, Arnd Bergmann wrote:
>> On Thu, Dec 7, 2023, at 01:27, Gregory Price wrote:
>> 
>> Aside from this, you should avoid holes in the data structure.
>> On 64-bit architectures, the layout above has holes after
>> policy_node and after addr_node.
>> 
>>       Arnd
>
> doh, clearly i didn't stop to think about alignment. Good eye.
> I'll redo this with __u/s members and fix the holes.
>
> Didn't stop to think about compat pointers.  I don't think the
> u64_to_user_ptr pattern is offensive, so i'll make that change.
> At least I don't see what the other options are beyond compat.

Ok, sounds good.

I see you already call wrappers for compat mode to convert
iovec and nodemask layouts for the indirect pointers, and they
look correct. If you wanted to do handle the compat syscalls
using the same entry point, you could add the same kind of
helper to copy the mempolicy args from user space with an
optional conversion, but not having to do this is clearly
easier.

     Arnd




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux