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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210416112945.04f30644@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Fri, 16 Apr 2021 11:29:45 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Eric Dumazet <edumazet@...gle.com>
Cc:     Eric Dumazet <eric.dumazet@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        netdev <netdev@...r.kernel.org>,
        Soheil Hassas Yeganeh <soheil@...gle.com>
Subject: Re: [PATCH net-next] scm: optimize put_cmsg()

On Fri, 16 Apr 2021 20:28:40 +0200 Eric Dumazet wrote:
> On Fri, Apr 16, 2021 at 7:57 PM Jakub Kicinski <kuba@...nel.org> wrote:
> >
> > On Thu, 15 Apr 2021 10:37:53 -0700 Eric Dumazet wrote:  
> > > From: Eric Dumazet <edumazet@...gle.com>
> > >
> > > Calling two copy_to_user() for very small regions has very high overhead.
> > >
> > > Switch to inlined unsafe_put_user() to save one stac/clac sequence,
> > > and avoid copy_to_user().
> > >
> > > Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> > > Cc: Soheil Hassas Yeganeh <soheil@...gle.com>  
> >
> > Hi Eric!
> >
> > This appears to break boot on my systems.
> >
> > IDK how exactly, looks like systemd gets stuck waiting for nondescript
> > services to start in initramfs. I have lots of debug enabled and didn't
> > spot anything of note in kernel logs.
> >
> > I'll try to poke at this more, but LMK if you have any ideas. The
> > commit looks "obviously correct" :S  
> 
> Oops, my rebase went wong, sorry for that

Ah, my eyes failed to spot that :)

> Can you check this  patch (on top of the buggy one) ?
> 
> If that works, I'll submit a v2

It's already merged. Let me try the fix now...

> diff --git a/net/core/scm.c b/net/core/scm.c
> index bd96c922041d22a2f3b7ee73e4b3183316f9b616..ae3085d9aae8adb81d3bb42c8a915a205476a0ee
> 100644
> --- a/net/core/scm.c
> +++ b/net/core/scm.c
> @@ -232,7 +232,7 @@ int put_cmsg(struct msghdr * msg, int level, int
> type, int len, void *data)
>                 if (!user_write_access_begin(cm, cmlen))
>                         goto efault;
> 
> -               unsafe_put_user(len, &cm->cmsg_len, efault_end);
> +               unsafe_put_user(cmlen, &cm->cmsg_len, efault_end);
>                 unsafe_put_user(level, &cm->cmsg_level, efault_end);
>                 unsafe_put_user(type, &cm->cmsg_type, efault_end);
>                 unsafe_copy_to_user(CMSG_USER_DATA(cm), data,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ