Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1546241

Re: [PATCH 2/2] kasan: add memcg kmem_cache test

From Vladimir Davydov <vdavydov@tarantool.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] kasan: add memcg kmem_cache test
Date 2016-12-22 10:30 +0100
Message-ID <sR7Rf-7F2-9@gated-at.bofh.it> (permalink)
References <sQxb3-BZ-1@gated-at.bofh.it> <sQxb3-BZ-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Dec 20, 2016 at 10:11:02AM -0800, Greg Thelen wrote:
> Make a kasan test which uses a SLAB_ACCOUNT slab cache.  If the test is
> run within a non default memcg, then it uncovers the bug fixed by
> "kasan: drain quarantine of memcg slab objects"[1].
> 
> If run without fix [1] it shows "Slab cache still has objects", and the
> kmem_cache structure is leaked.
> Here's an unpatched kernel test:
> $ dmesg -c > /dev/null
> $ mkdir /sys/fs/cgroup/memory/test
> $ echo $$ > /sys/fs/cgroup/memory/test/tasks
> $ modprobe test_kasan 2> /dev/null
> $ dmesg | grep -B1 still
> [ 123.456789] kasan test: memcg_accounted_kmem_cache allocate memcg accounted object
> [ 124.456789] kmem_cache_destroy test_cache: Slab cache still has objects
> 
> Kernels with fix [1] don't have the "Slab cache still has objects"
> warning or the underlying leak.
> 
> The new test runs and passes in the default (root) memcg, though in the
> root memcg it won't uncover the problem fixed by [1].
> 
> Signed-off-by: Greg Thelen <gthelen@google.com>

Reviewed-by: Vladimir Davydov <vdavydov.dev@gmail.com>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] kasan: drain quarantine of memcg slab objects Greg Thelen <gthelen@google.com> - 2016-12-20 19:20 +0100
  [PATCH 2/2] kasan: add memcg kmem_cache test Greg Thelen <gthelen@google.com> - 2016-12-20 19:20 +0100
    Re: [PATCH 2/2] kasan: add memcg kmem_cache test Vladimir Davydov <vdavydov@tarantool.org> - 2016-12-22 10:30 +0100
  Re: [PATCH 1/2] kasan: drain quarantine of memcg slab objects Vladimir Davydov <vdavydov@tarantool.org> - 2016-12-22 10:00 +0100

csiph-web