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: <CAEUSe79Ze92eB2kpTZUYvo357ca0C81BOxK+RCbr9h8C--SpSA@mail.gmail.com>
Date:   Fri, 17 Jul 2020 13:03:09 -0500
From:   Daniel Díaz <daniel.diaz@...aro.org>
To:     "Paul E. McKenney" <paulmck@...nel.org>
Cc:     Dexuan-Linux Cui <dexuan.linux@...il.com>,
        Naresh Kamboju <naresh.kamboju@...aro.org>,
        madhuparnabhowmik10@...il.com,
        Josh Triplett <josh@...htriplett.org>,
        Joel Fernandes <joel@...lfernandes.org>,
        Paolo Bonzini <pbonzini@...hat.com>, rcu@...r.kernel.org,
        open list <linux-kernel@...r.kernel.org>,
        X86 ML <x86@...nel.org>, kvm list <kvm@...r.kernel.org>,
        frextrite@...il.com, lkft-triage@...ts.linaro.org,
        Dexuan Cui <decui@...rosoft.com>, juhlee@...rosoft.com
Subject: Re: [PATCH 2/2] kvm: mmu: page_track: Fix RCU list API usage

Hello!

On Fri, 17 Jul 2020 at 12:07, Paul E. McKenney <paulmck@...nel.org> wrote:
>
> On Thu, Jul 16, 2020 at 05:19:52PM -0700, Dexuan-Linux Cui wrote:
> > On Thu, Jul 16, 2020 at 7:47 AM Naresh Kamboju
> > <naresh.kamboju@...aro.org> wrote:
> > >
> > > On Sun, 12 Jul 2020 at 21:39, Paul E. McKenney <paulmck@...nel.org> wrote:
> > > >
> > > > On Sun, Jul 12, 2020 at 06:40:03PM +0530, madhuparnabhowmik10@...il.com wrote:
> > > > > From: Madhuparna Bhowmik <madhuparnabhowmik10@...il.com>
> > > > >
> > > > > Use hlist_for_each_entry_srcu() instead of hlist_for_each_entry_rcu()
> > > > > as it also checkes if the right lock is held.
> > > > > Using hlist_for_each_entry_rcu() with a condition argument will not
> > > > > report the cases where a SRCU protected list is traversed using
> > > > > rcu_read_lock(). Hence, use hlist_for_each_entry_srcu().
> > > > >
> > > > > Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@...il.com>
> > > >
> > > > I queued both for testing and review, thank you!
> > > >
> > > > In particular, this one needs an ack by the maintainer.
> > > >
> > > >                                                         Thanx, Paul
> > > >
> > > > >  arch/x86/kvm/mmu/page_track.c | 6 ++++--
> > > > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > > >
> > > > > diff --git a/arch/x86/kvm/mmu/page_track.c b/arch/x86/kvm/mmu/page_track.c
> > > > > index a7bcde34d1f2..a9cd17625950 100644
> > > > > --- a/arch/x86/kvm/mmu/page_track.c
> > > > > +++ b/arch/x86/kvm/mmu/page_track.c
> > > > > @@ -229,7 +229,8 @@ void kvm_page_track_write(struct kvm_vcpu *vcpu, gpa_t gpa, const u8 *new,
> > > > >               return;
> > > > >
> > > > >       idx = srcu_read_lock(&head->track_srcu);
> > > > > -     hlist_for_each_entry_rcu(n, &head->track_notifier_list, node)
> > > > > +     hlist_for_each_entry_srcu(n, &head->track_notifier_list, node,
> > > > > +                             srcu_read_lock_held(&head->track_srcu))
> > >
> > > x86 build failed on linux -next 20200716.
> > >
> > > arch/x86/kvm/mmu/page_track.c: In function 'kvm_page_track_write':
> > > include/linux/rculist.h:727:30: error: left-hand operand of comma
> > > expression has no effect [-Werror=unused-value]
> > >   for (__list_check_srcu(cond),     \
> > >                               ^
> > > arch/x86/kvm/mmu/page_track.c:232:2: note: in expansion of macro
> > > 'hlist_for_each_entry_srcu'
> > >   hlist_for_each_entry_srcu(n, &head->track_notifier_list, node,
> > >   ^~~~~~~~~~~~~~~~~~~~~~~~~
> > > arch/x86/kvm/mmu/page_track.c: In function 'kvm_page_track_flush_slot':
> > > include/linux/rculist.h:727:30: error: left-hand operand of comma
> > > expression has no effect [-Werror=unused-value]
> > >   for (__list_check_srcu(cond),     \
> > >                               ^
> > > arch/x86/kvm/mmu/page_track.c:258:2: note: in expansion of macro
> > > 'hlist_for_each_entry_srcu'
> > >   hlist_for_each_entry_srcu(n, &head->track_notifier_list, node,
> > >   ^~~~~~~~~~~~~~~~~~~~~~~~~
> > > cc1: all warnings being treated as errors
> > > make[3]: *** [arch/x86/kvm/mmu/page_track.o] Error 1
> > >
> > > build link,
> > > https://ci.linaro.org/view/lkft/job/openembedded-lkft-linux-next/DISTRO=lkft,MACHINE=intel-corei7-64,label=docker-lkft/815/consoleText
> > >
> >
> > Hi, we're seeing the same building failure with the latest linux-next tree.
>
> I am not seeing this here.  Could you please let us know what compiler
> and command-line options you are using to generate this?

It fails with gcc-8 and gcc-9, but it builds with gcc-10. Quick way to
reproduce:
  [host] docker run --rm -it -v /linux:/linux -w /linux
tuxbuild/build-gcc-9_mips
  [docker] make ARCH=mips CROSS_COMPILE=mips-linux-gnu- defconfig
  [docker] make ARCH=mips CROSS_COMPILE=mips-linux-gnu- mm

You can use these other Docker containers: tuxbuild/build-gcc-8_mips
and tuxbuild/build-gcc-10_mips.

Logs for those builds (and allnoconfig, tinyconfig, with gcc-8, gcc-9
and gcc-10) can also be found here:
  https://gitlab.com/Linaro/lkft/kernel-runs/-/jobs/643978135

Greetings!

Daniel Díaz
daniel.diaz@...aro.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ