lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZXJdvmZCjRLDV50L@memverge.com>
Date:   Thu, 7 Dec 2023 19:05:18 -0500
From:   Gregory Price <gregory.price@...verge.com>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Gregory Price <gourry.memverge@...il.com>, linux-mm@...ck.org,
        jgroves@...ron.com, ravis.opensrc@...ron.com,
        sthanneeru@...ron.com, emirakhur@...ron.com, Hasan.Maruf@....com,
        linux-doc@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-api@...r.kernel.org, Linux-Arch <linux-arch@...r.kernel.org>,
        linux-kernel@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Andy Lutomirski <luto@...nel.org>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
        "H. Peter Anvin" <hpa@...or.com>, Michal Hocko <mhocko@...nel.org>,
        Tejun Heo <tj@...nel.org>, ying.huang@...el.com,
        Jonathan Corbet <corbet@....net>, rakie.kim@...com,
        hyeongtak.ji@...com, honggyu.kim@...com, vtavarespetr@...ron.com,
        Peter Zijlstra <peterz@...radead.org>,
        Frank van der Linden <fvdl@...gle.com>
Subject: Re: [RFC PATCH 07/11] mm/mempolicy: add userland mempolicy arg
 structure

On Thu, Dec 07, 2023 at 04:43:03PM +0100, Arnd Bergmann wrote:
> 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

I don't know that either is easier, it's basically just what annoying
way do you want to handle this annoying problem.  I'll poke at it
and decide which one I hate less.

One thing i didn't really think about, probably the iovec/len
fields should just be args for mbind2, rather than embedded in
mpol_args - since mpol_args is supposed to describe the mpol
while the iovec/len describes what it applies to.

Simplifies the mpol_args structure a bit. Doesn't change the handling
at all. (bit of a rubber ducky comment here)

As always, I appreciate the input

~Gregory

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ