From patchwork Tue May 22 10:07:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10417837 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 79BA36016C for ; Tue, 22 May 2018 10:08:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF8D128997 for ; Tue, 22 May 2018 10:08:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E49F928BB8; Tue, 22 May 2018 10:08:05 +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 7C8A228997 for ; Tue, 22 May 2018 10:08:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 399BD6B000A; Tue, 22 May 2018 06:08:03 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 321D26B000C; Tue, 22 May 2018 06:08:03 -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 14B7F6B000D; Tue, 22 May 2018 06:08:03 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt0-f197.google.com (mail-qt0-f197.google.com [209.85.216.197]) by kanga.kvack.org (Postfix) with ESMTP id D770B6B000A for ; Tue, 22 May 2018 06:08:02 -0400 (EDT) Received: by mail-qt0-f197.google.com with SMTP id f1-v6so17517297qtm.12 for ; Tue, 22 May 2018 03:08:02 -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=uHJkjOyRxl+B5mcYfENdOtIVvRa792dN8Lcg1wu3A1g=; b=AUAHCQDey0bj4kuDoaSjYJkORcvVi9cZiNK6FL112ufvgrIcD5tSAEIdd5zgu/oagi 1nw98BWy3oeblTMXuAtz/KaAvkObaiS2hCqqZ5Nx+RoD16jlJy0D5ghEhDyhFkcCoPZD z81sMfI082WsNq9+iwgI9OU5vmpMKWEUApGTuNCbvvNpj+G4u6fPKBPcP1hDaghYGFtb pDKUi6BBubT8pA/Gc6ZSvrBsVsVzu0yqovDdkC2P/ecMsadLR6qhiAqILiOBJHgd9elw 0tp4DPgzkqs2IEtSxw9LyVJF5AyeX/9zFMJkLQiexKToJBHxDOhwb/xMKZxlkhSFfyYP BNSA== 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: ALKqPwdphoi1YkAiiig4Jq//s4kg0eDrcQAB5o56Y3Auia+3d8l90YMT RdspnQoynncMZ4HVC9rTodrVAhrvkvdWwHyHO6uOKPc+w2TepubQMulvqj5Js4H+cpR1zkieArH PbwyAOZT9V17U4kxGV9nZ38MJNpcDG73TaEMjeJRvEPsuNH3KWbbXOkuHncs9ZgLGSw== X-Received: by 2002:a37:b8c:: with SMTP id 134-v6mr1851629qkl.290.1526983682697; Tue, 22 May 2018 03:08:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqWRq155Swce3YEbql8ynvJmaQ1f0C9cVSYkBzQNMzwcriIpm0jarEKQBGoCwCxN+MrZO+o X-Received: by 2002:a37:b8c:: with SMTP id 134-v6mr1851607qkl.290.1526983682225; Tue, 22 May 2018 03:08:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526983682; cv=none; d=google.com; s=arc-20160816; b=XMPWTdQT6a+j1lUTP1MiG+6fPX+HIbTZel/M7YTTYN7MLlWjmeauDIiWryx3ufV5E8 +kT61MyJNMDKhF8HyzfNU1nfqkxpqD76aA2bhJuIaldj26BjQwtZYW5h5wXt7Ja4gwCb FKmW5ya7X2zUy/CsasVRZ78o4iY6fyTpTWBVGBupPVCL6m0qa+DrShP1rhlACl/Y4n1T bGO8Sm2xOOoIK1HfO6LXiTrdjCNns2WDugqgxLNw7X4rOEUy/3GaMHQGXRcA/uVWZvjA Ltk0bkDljtGO+vo5i4jNeWBNMogGQ1mrlkQdzuXLscKN0yBUQvR9+qrp8BPS9sgnJw58 bYgg== 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=uHJkjOyRxl+B5mcYfENdOtIVvRa792dN8Lcg1wu3A1g=; b=pcw/41pfoJHlG+sedaTmGu7bt7IdmqXj8haq4zxMeK2cCXLcGUb2X1zenxNcssy6fg CVh4Is1SQjkXGmSzrJYMuBwYNbRPeZPuwmPRcQBOUaCRbvFoLMPq9fz5kl+6Puzlp2HA HR/rAgfzZArdZLLe4P1M6oDfh4tq0t5+R4sr67l0pNQfwFrlCaEee7aDUl558+LXEFdv czcIq1m4DK95l86/2WGWI92g1hFmpgsU0d2Q27JAZgc/8HZ8isNCgZthbzDhCf8zZahS Ubu4I4yblYK0X05pZ21Wy9zHr6+LvQHRRpxQ/Ov+ucA4fLDIvS5ZI1ghc29s2puSgz83 p+Vg== 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 56-v6si1266683qvf.10.2018.05.22.03.08.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 03:08:02 -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-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DF7FB7D83A; Tue, 22 May 2018 10:08:01 +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 AB51E1134CCC; Tue, 22 May 2018 10:08:00 +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 v2 1/2] kasan: free allocated shadow memory on MEM_CANCEL_ONLINE Date: Tue, 22 May 2018 12:07:55 +0200 Message-Id: <20180522100756.18478-2-david@redhat.com> In-Reply-To: <20180522100756.18478-1-david@redhat.com> References: <20180522100756.18478-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 22 May 2018 10:08:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 22 May 2018 10:08:01 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 Acked-by: Andrey Ryabinin --- mm/kasan/kasan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c index 135ce2838c89..53564229674b 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_ONLINE: case MEM_OFFLINE: { struct vm_struct *vm;