From: Jann Horn <jannh@google.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Linux-MM <linux-mm@kvack.org>,
Davidlohr Bueso <dave@stgolabs.net>,
Oleg Nesterov <oleg@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
clameter@sgi.com, guro@fb.com, kemi.wang@intel.com,
Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] mm/vmstat: fix outdated vmstat_text
Date: Wed, 3 Oct 2018 18:31:50 +0200 [thread overview]
Message-ID: <CAG48ez1f0pXx=ZJgjmwsxtF+v_w9eJYpJKtzP7MDK1eiUOyswA@mail.gmail.com> (raw)
In-Reply-To: <20181003162905.GK4714@dhcp22.suse.cz>
On Wed, Oct 3, 2018 at 6:29 PM Michal Hocko <mhocko@kernel.org> wrote:
>
> On Sat 29-09-18 03:36:11, Jann Horn wrote:
> > commit 7a9cdebdcc17 ("mm: get rid of vmacache_flush_all() entirely")
> > removed the VMACACHE_FULL_FLUSHES statistics, but didn't remove the
> > corresponding entry in vmstat_text. This causes an out-of-bounds access in
> > vmstat_show().
> >
> > Luckily this only affects kernels with CONFIG_DEBUG_VM_VMACACHE=y, which is
> > probably very rare.
> >
> > Having two gigantic arrays that must be kept in sync isn't exactly robust.
> > To make it easier to catch such issues in the future, add a BUILD_BUG_ON().
> >
> > Fixes: 7a9cdebdcc17 ("mm: get rid of vmacache_flush_all() entirely")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Jann Horn <jannh@google.com>
>
> Those could be two separate patches but anyway
> Acked-by: Michal Hocko <mhocko@suse.com>
>
> to both changes. I have burned myself on this in the past as well. Build
> bugon would save me a lot of debugging.
I actually sent a v2 that splits this into two patches, and adds
another fix for nr_tlb_remote_flush and nr_tlb_remote_flush_received
for systems with CONFIG_VM_EVENT_COUNTERS=y && CONFIG_DEBUG_TLBFLUSH=y
&& CONFIG_SMP=n. akpm has already added the v2 patches to the mm tree.
prev parent reply other threads:[~2018-10-03 16:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-29 1:36 Jann Horn
2018-09-29 3:07 ` kbuild test robot
2018-10-01 13:46 ` Jann Horn
2018-10-03 16:29 ` Michal Hocko
2018-10-03 16:31 ` Jann Horn [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAG48ez1f0pXx=ZJgjmwsxtF+v_w9eJYpJKtzP7MDK1eiUOyswA@mail.gmail.com' \
--to=jannh@google.com \
--cc=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--cc=dave@stgolabs.net \
--cc=guro@fb.com \
--cc=keescook@chromium.org \
--cc=kemi.wang@intel.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=oleg@redhat.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox