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] [day] [month] [year] [list]
Date:	Wed, 3 Aug 2016 17:31:17 +0300
From:	Vladimir Davydov <vdavydov@...tuozzo.com>
To:	Johannes Weiner <hannes@...xchg.org>
CC:	Michal Hocko <mhocko@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	<stable@...r.kernel.org>, <linux-mm@...ck.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/3] mm: memcontrol: fix swap counter leak on swapout
 from offline cgroup

On Wed, Aug 03, 2016 at 10:12:03AM -0400, Johannes Weiner wrote:
> On Wed, Aug 03, 2016 at 02:46:40PM +0300, Vladimir Davydov wrote:
...
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index 1c0aa59fd333..8c8e68becee9 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -4044,7 +4044,7 @@ static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
> >  		 * The root cgroup cannot be destroyed, so it's refcount must
> >  		 * always be >= 1.
> >  		 */
> > -		if (memcg == root_mem_cgroup) {
> > +		if (WARN_ON_ONCE(memcg == root_mem_cgroup)) {
> >  			VM_BUG_ON(1);
> >  			break;
> >  		}
> 
> The WARN_ON_ONCE() makes sense to me. But if we warn on all configs
> anyway, the VM_BUG_ON() doesn't provide any additional value. Anybody
> who is testing new code and enables DEBUG_VM should notice a warning
> without requiring the kernel to blow up in their face; it also allows
> them to check other state that is not necessarily available in BUG().

Personally, I prefer to crash the kernel as early as possible when
debugging to get vmcore for further investigation. Judging by
mem_cgroup_update_lru_size(), I'm not alone.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ