From patchwork Tue May 22 09:55:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10417789 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 50E766053B for ; Tue, 22 May 2018 09:55:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F4331FE8A for ; Tue, 22 May 2018 09:55:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33FBF1FF60; Tue, 22 May 2018 09:55:22 +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=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE 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 D963A1FE8A for ; Tue, 22 May 2018 09:55:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 413F16B0007; Tue, 22 May 2018 05:55:20 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 39AA86B0008; Tue, 22 May 2018 05:55:20 -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 2B1206B000A; Tue, 22 May 2018 05:55:20 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f197.google.com (mail-qk0-f197.google.com [209.85.220.197]) by kanga.kvack.org (Postfix) with ESMTP id F3DE46B0007 for ; Tue, 22 May 2018 05:55:19 -0400 (EDT) Received: by mail-qk0-f197.google.com with SMTP id t143-v6so9221845qke.18 for ; Tue, 22 May 2018 02:55:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=hbS1PvjY8n6bEFwFi4ocpvaHqkjKEZtAdRKFOeFULZU=; b=gzI2QZVa8QpWUwUlG5C61N9wNZJ2d2rXyHwDYnHN/Tb3P4jVirb5F1PjtTRjzlV3Wn wekr2fHAqYSM+OuchJ3j+O9011TvxtBkBpBsunyJrQXcLhXlPyixL4bxgqonghDwygW8 GldY1IV1paLFQ+X1oH6Z+7QJQR36u2ost9w+lTfDUfqTlqXn5gla0tgQEWkyUaC9pWtA rTLJnHIFaaY5EQbU3FUEbgqEgHse+bp1pUuxLhjqhSMe84LOnuM6+kcliXskeHza+S9M V3PiJ1UeRL6pAm43+22B5hzem4E20N/uxU/nXZE/NslOojmYzmjT3bN2QT151iceZE/9 FbfQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: ALKqPweMKzn8PtEmTgWWggTTg2NGfH97VT9cvgz9j2HAKEEauWygamlz UnRn7hnRhPNBnbWDAGneAOrtluYvzR0mPKLNiuWB1m5jeu0MmMgihqjQGPcV82h07ovljYfNQaF Fpq2FvcmAaY0BaLHrG90Qg3vDlU9BM+nB8spGgG+BeDo5NMDNQiqcV+wri8ZMvLZwRQ== X-Received: by 2002:ac8:1766:: with SMTP id u35-v6mr21917466qtk.209.1526982919815; Tue, 22 May 2018 02:55:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqPy2hIl9HPxUYC+pnQHNj8U+yJMOmN+ZrAlyhVCc1kp/vo3Hrstj51SSexnYIiC7q7UxGz X-Received: by 2002:ac8:1766:: with SMTP id u35-v6mr21917447qtk.209.1526982919368; Tue, 22 May 2018 02:55:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526982919; cv=none; d=google.com; s=arc-20160816; b=g7HnaQj9eUJVqu57+dH0hjAHINe/QIXyaYkZiHp43warCtBMPOwBZvOoBhlvJqhchB FZjYoYPmTV1uU4qA1FsAl2D4d1RIitqgQXViJQfzzDvhUFjARzmS1g6I8HQZgr1hzjF+ 1nxFUc5jRDWPkHj9B/7ycAX2UVl2Z5mUaH1oz0Bl4VPF90qcjtCB+WVYYU1F8hC2Af6Y uARrjOBp2rJAUY+zxzqB/pUcCECSh9y0Yf6ecMJJKiPco7O+ycds69IOaAIGFiMGCxdi VPO2dBq1iz5ycvW3lGP3b9fK4vVAGpIe4JWA/7BWowBEXila2wWsleuFF7yKDWtnAgJJ 9Zew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=hbS1PvjY8n6bEFwFi4ocpvaHqkjKEZtAdRKFOeFULZU=; b=pB4uiVuhonoIRnirBlLrQPXREheNU7TRHqyH1wKsO0Kl1jOOTSQVDCU+Snf023SVAn sUoleYFUDa0xCeubdAWbi/TPPwytSEI2YwFSXqrUdrEg43d1pvO/FlUdgxaMU5XnO3SI QAUy2VhrxPhUACwt6ppITOUrTz5kiIltv/3rJPve48UEwBtvu+ezDXoCCn5gS5qwM3rL Pbdl8vMaTsxZBDet+Q5yf+xUaVFG+2+hXwncQAs+u3TdosD8ofCv4y7zPISkQrJARUx1 dgHulvItQi4K2q6pI/JwdNtBkuk0zoyrjFi9llHkt8fLnBNMs/XVBCCidsTfkyEsGaa6 2JAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id h4-v6si638756qva.43.2018.05.22.02.55.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 02:55:19 -0700 (PDT) Received-SPF: pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) client-ip=66.187.233.73; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 069C7401EF0F; Tue, 22 May 2018 09:55:19 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-125.ams2.redhat.com [10.36.117.125]) by smtp.corp.redhat.com (Postfix) with ESMTP id 983DA2023585; Tue, 22 May 2018 09:55:17 +0000 (UTC) From: David Hildenbrand To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, David Hildenbrand , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , kasan-dev@googlegroups.com (open list:KASAN) Subject: [PATCH v1 1/2] kasan: free allocated shadow memory on MEM_CANCEL_OFFLINE Date: Tue, 22 May 2018 11:55:14 +0200 Message-Id: <20180522095515.2735-2-david@redhat.com> In-Reply-To: <20180522095515.2735-1-david@redhat.com> References: <20180522095515.2735-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 22 May 2018 09:55:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 22 May 2018 09:55:19 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' 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 We have to free memory again when we cancel onlining, otherwise a later onlining attempt will fail. Signed-off-by: David Hildenbrand --- mm/kasan/kasan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c index 135ce2838c89..8baefe1a674b 100644 --- a/mm/kasan/kasan.c +++ b/mm/kasan/kasan.c @@ -867,6 +867,7 @@ static int __meminit kasan_mem_notifier(struct notifier_block *nb, kmemleak_ignore(ret); return NOTIFY_OK; } + case MEM_CANCEL_OFFLINE: case MEM_OFFLINE: { struct vm_struct *vm;