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] [day] [month] [year] [list]
Date:   Wed, 1 Mar 2023 13:51:11 +0100
From:   Eric Dumazet <edumazet@...gle.com>
To:     Florian Westphal <fw@...len.de>
Cc:     Brian Vazquez <brianvv@...gle.com>, netdev@...r.kernel.org,
        davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
        shakeelb@...gle.com, soheil@...gle.com
Subject: Re: [PATCH net] net: avoid indirect memory pressure calls

On Wed, Mar 1, 2023 at 1:31 PM Florian Westphal <fw@...len.de> wrote:
>
> Eric Dumazet <edumazet@...gle.com> wrote:
> > BTW I was curious why Google was not seeing this, and it appears Brian Vasquez
> > forgot to upstream this change...
> >
> > commit 5ea2f21d6c1078d2c563cb455ad5877b4ada94e1
> > Author: Brian Vazquez <brianvv@...gle.com>
> > Date:   Thu Mar 3 19:09:49 2022 -0800
> >
> >     PRODKERNEL: net-directcall: annotate tcp_leave_memory_pressure and
> >     tcp_getsockopt
> >
> > diff --git a/net/core/sock.c b/net/core/sock.c
> > index 05032b399c873984e5297898d647905ca9f21f2e..54cb989dc162f3982380ac12cf5a150214e209a2
> > 100644
> > --- a/net/core/sock.c
> > +++ b/net/core/sock.c
> > @@ -2647,10 +2647,13 @@ static void sk_enter_memory_pressure(struct sock *sk)
> >         sk->sk_prot->enter_memory_pressure(sk);
> >  }
> >
> > +INDIRECT_CALLABLE_DECLARE(void tcp_leave_memory_pressure(struct sock *sk));
> > +
> >  static void sk_leave_memory_pressure(struct sock *sk)
> >  {
> >         if (sk->sk_prot->leave_memory_pressure) {
> > -               sk->sk_prot->leave_memory_pressure(sk);
> > +               INDIRECT_CALL_1(sk->sk_prot->leave_memory_pressure,
> > +                               tcp_leave_memory_pressure, sk);
> >         } else {
> >                 unsigned long *memory_pressure = sk->sk_prot->memory_pressure;
>
> re-tested: this change also resolves the regression i was seeing.
>
> If you prefer to upstream this instead of the proposed change then I'm
> fine with that.

This seems a bit less risky, if the plan is to add this to stable trees.
( We had this mitigation for ~4 years at Google)

I will rebase Brian patch (only the tcp_leave_memory_pressure part) and send it.

Thanks !

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ