From patchwork Mon Oct 1 14:31:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jann Horn X-Patchwork-Id: 10622233 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF00015A7 for ; Mon, 1 Oct 2018 14:31:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1907287F3 for ; Mon, 1 Oct 2018 14:31:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A58B929437; Mon, 1 Oct 2018 14:31:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48D3C287F3 for ; Mon, 1 Oct 2018 14:31:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3C1CE6B0003; Mon, 1 Oct 2018 10:31:47 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 372BF6B0005; Mon, 1 Oct 2018 10:31:47 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 262366B0006; Mon, 1 Oct 2018 10:31:47 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by kanga.kvack.org (Postfix) with ESMTP id EB03F6B0003 for ; Mon, 1 Oct 2018 10:31:46 -0400 (EDT) Received: by mail-qk1-f199.google.com with SMTP id v198-v6so9602473qka.16 for ; Mon, 01 Oct 2018 07:31:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:date:message-id:mime-version :subject:from:to:cc; bh=lo30T+L0jKOEUuumNZUlyrTjSMT4efbRQ6bhsYSjJ7M=; b=WJS1KzsUE77vrHNEDBVu8bNpU+vJBYkR6RareQ4nGXJWp1KXrT64W0Y7OBA6jGvXck 8tLp5tVW2p/FbVsHpK/SW5qg8GVjAL/09MnuhFOV8CuM69Niz2Pc0bnE+rtVKvZgl22r jDBxnReR7AzhYto0lN2ZflqJym0Vh3v3EjehcWpToQ/aQtLZQshLn95SAc78fEHkrU+G gwnhzEo1znWsvzxxjaq3kLU0aoszL2WF6OkkuEgX05lyJPUQ4iyue8VbKVrkyE5ozSym 97p7nFMTBgkJRLF7hU/zVYMRBwXPMpnpFnAmQpgsvkNJRAPNlSvmC+Jn2826s9se8cwu miKw== X-Gm-Message-State: ABuFfoipucLYpQgZI92QJIYXxH0IWErtyHZQtGs6jYvM3gVkPTFzB8dv bX8nTyxIkQgUyVFBlAATueZ4zVRC/cHw3Ec1GdZ2C9mNqiFgqb/g+arKq6UGaMGhX1IrdMSb/fn ufriIHgvP/dV5v4G0GE8FhXlyB8Pv3bkilFoKai8SixM6MZ7nPu73NVRFIrv99y/gt8PaWmU0ml t1IqeJP2UgHL8AS+Gr+idcpmbuRjjRkoedEfLKzyVhC466I6+y3miyUqndQSHPh1dk2YJRbK/3s kfqdHEDnbXzxIx7h2l3SqRFYwxv4sepEPSkBEoGYFM2wD+iPWAnpJ+Lytg1n1uwrexUe9Lt22X8 G3ZSAZMcQbpXKBKrTOECSRld+F8oPS9zO6WPevfxVkTu5Jg453dSMDQbuH21Mb1LokwcULTetYP I X-Received: by 2002:aed:2647:: with SMTP id z65-v6mr8400298qtc.301.1538404306700; Mon, 01 Oct 2018 07:31:46 -0700 (PDT) X-Received: by 2002:aed:2647:: with SMTP id z65-v6mr8400263qtc.301.1538404306188; Mon, 01 Oct 2018 07:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538404306; cv=none; d=google.com; s=arc-20160816; b=TrQVeHtEGxc04lh7uKEguB6fXGodPegauxBLWnGLc10MobkbgNfbDqNL/6styv5Ufx 4eMi0TBx9u/2xwyxj8gtbJ+ikopJnYKfNam87Taqf2NdP3LJUbXlKdOJNSqaK9LRCsfD NDw45Iw0oBowtxkFtSoqgVhHPgSivs183MRRysm7Rp4F5fJAQ+FYIHxMWyQxe+ThbsoX 2KEXF+P0h6I5djq79Bfo5Q6ilX8YSEKBa6qsMRLd3aWxG2R4gY9v1C8GJSXr5CExz3iQ Y8Ib+sbYO8+eEl2opCWqx4h/uo5NlIWPVkTAXe7YD1/vzLgy9Ywuz1q89zv0pyFfDsMC cpVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:mime-version:message-id:date:dkim-signature; bh=lo30T+L0jKOEUuumNZUlyrTjSMT4efbRQ6bhsYSjJ7M=; b=x+JZ4IItCMbHt7tQlvOI+hoRRtpAoPKXZThfSmAO5PeT90CZeH2JWKT3CicU4g2PVT 3WV9h3LFcnBpoN3C6VAzb1DOJk8nBYDw8sssAMA4AtZRX4a0PwFGoz6vh+KuHtJo8Blp AOkJE02t0cpoiqBBNMycMNY8beA9X93sYhMcmI5qSInGlMZvff0Wc6OpgghtetXhNlrS MrzHGixVLMbyLHglDDPmy1RqSbJ30fNSktYjBsaTYQGfxNFPCmlvTNazUXREghrF+Rx6 DgJ5BSbyQO9kiPp4EXoI0tdqo/46QNlyuHC0i7bg62GmpRMn+1q8aE0HtMAbVvSdDnQP gtxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Xb+1AOvQ; spf=pass (google.com: domain of 30s-ywwukcnwh8llfemmejc.amkjglsv-kkit8ai.mpe@flex--jannh.bounces.google.com designates 209.85.220.73 as permitted sender) smtp.mailfrom=30S-yWwUKCNwH8LLFEMMEJC.AMKJGLSV-KKIT8AI.MPE@flex--jannh.bounces.google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from mail-sor-f73.google.com (mail-sor-f73.google.com. [209.85.220.73]) by mx.google.com with SMTPS id p9-v6sor7931528qtq.153.2018.10.01.07.31.46 for (Google Transport Security); Mon, 01 Oct 2018 07:31:46 -0700 (PDT) Received-SPF: pass (google.com: domain of 30s-ywwukcnwh8llfemmejc.amkjglsv-kkit8ai.mpe@flex--jannh.bounces.google.com designates 209.85.220.73 as permitted sender) client-ip=209.85.220.73; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Xb+1AOvQ; spf=pass (google.com: domain of 30s-ywwukcnwh8llfemmejc.amkjglsv-kkit8ai.mpe@flex--jannh.bounces.google.com designates 209.85.220.73 as permitted sender) smtp.mailfrom=30S-yWwUKCNwH8LLFEMMEJC.AMKJGLSV-KKIT8AI.MPE@flex--jannh.bounces.google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=lo30T+L0jKOEUuumNZUlyrTjSMT4efbRQ6bhsYSjJ7M=; b=Xb+1AOvQQpBKaygW2Du8kfFjRhPyKjJ8wuLVdnZC8pIl9dTO+9MP1PZ8qYBqnUlYP2 ANmlrSHuQimdFzle5kiDxWq7XEDo2NhXgQNqNSBMC+Nm2eXB2mx9JsBuGuug2gB61pKq NvsLHdyic65F+KbzKpV2/jkFK/eD3x1IUngxFlB+G9ke/9fiVH9ETCRfoWrH8sY3fKa3 cJeQSJk2KzWGeojyD3WnZqQvLF4m6FAnyFNFfkW5MEFfNRoY6axYj57L6ed89kjmamdX nEjW5dzlQ/HyeZ6hv9hSi3lAm6SEShiRSaMdm1lfYRXSvfmv1GJ5hSX34zogj1brtmjg NMpg== X-Google-Smtp-Source: ACcGV62XKdsU04hKi1IeWYEnaxMg9RS0p+NhwRUivFkyIWrJLKjes7E+Ws1B0zcKyU63V3usnJtKHKp0aA== X-Received: by 2002:ac8:1969:: with SMTP id g38-v6mr8488895qtk.40.1538404305793; Mon, 01 Oct 2018 07:31:45 -0700 (PDT) Date: Mon, 1 Oct 2018 16:31:36 +0200 Message-Id: <20181001143138.95119-1-jannh@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog Subject: [PATCH v2 1/3] mm/vmstat: fix outdated vmstat_text From: Jann Horn To: Andrew Morton , linux-mm@kvack.org, jannh@google.com Cc: Davidlohr Bueso , Oleg Nesterov , Linus Torvalds , Christoph Lameter , Roman Gushchin , Kemi Wang , Kees Cook , Andy Lutomirski , Ingo Molnar X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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. Fixes: 7a9cdebdcc17 ("mm: get rid of vmacache_flush_all() entirely") Cc: stable@vger.kernel.org Signed-off-by: Jann Horn Reviewed-by: Kees Cook Acked-by: Michal Hocko --- mm/vmstat.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/vmstat.c b/mm/vmstat.c index 8ba0870ecddd..4cea7b8f519d 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1283,7 +1283,6 @@ const char * const vmstat_text[] = { #ifdef CONFIG_DEBUG_VM_VMACACHE "vmacache_find_calls", "vmacache_find_hits", - "vmacache_full_flushes", #endif #ifdef CONFIG_SWAP "swap_ra",