From patchwork Wed May 23 12:33:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Ryabinin X-Patchwork-Id: 10421131 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 E76C860327 for ; Wed, 23 May 2018 12:32:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D525728F6A for ; Wed, 23 May 2018 12:32:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9A9628F79; Wed, 23 May 2018 12:32:27 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 A6AA328F6A for ; Wed, 23 May 2018 12:32:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA3466B0003; Wed, 23 May 2018 08:32:24 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C53A86B0005; Wed, 23 May 2018 08:32:24 -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 B1C7D6B0006; Wed, 23 May 2018 08:32:24 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f72.google.com (mail-pg0-f72.google.com [74.125.83.72]) by kanga.kvack.org (Postfix) with ESMTP id 740546B0003 for ; Wed, 23 May 2018 08:32:24 -0400 (EDT) Received: by mail-pg0-f72.google.com with SMTP id r4-v6so4021618pgq.2 for ; Wed, 23 May 2018 05:32:24 -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:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding:spamdiagnosticoutput :spamdiagnosticmetadata; bh=U01klOlooLdKqkXLi9WPj8wKbR4NPdQuRj2VGFu2Ilc=; b=pVWnHP/xIE5i6ebttd1ABwyqk1wSKvlFLIYeyqWKeg+C2baHcYiaCmc8YGOYCmSa4A 6L7ZBqaWRrSTLNu9UMcTm4iArwEUWPrZEc22VddrbM0Itmp5IIIxfoyikM7Z/2a4K6L1 dmPh/prI8yDCP3Q6xfAYZzssZAs3aS1wXoOf9q4th4TGTXIO726xNojyATUbPyeSNhk+ NTdk5JogYoD/PMMYUjS4PXTuO2KavKrZvFrIMSYS7iGBuUTC/S+GodirI42ybvqVQqs0 kI/smtMw18uw1iPOprXI46ycia9XoH9+joNMrnTM30VTHzk9eInYYjwMhp4zhDHBeT75 GB2A== X-Gm-Message-State: ALKqPwfGvB24w8+Bf7Pw2p13iUKEqJGLrovE8uW0V75m8nI+SVfwfeu9 i0AZ62NzpaXI14u2lTLKlG/gKpd+N9E//+wx+vTVVOUQPN9WPpkh5LkeelM9AibAPJHVWysgczF tBalkPTYJNv6OS71SIHvmYvbeghz7s+po4Nbzg98dJd0fOKrBW4vK5PjgR0L60N3GRA== X-Received: by 2002:a17:902:6ac3:: with SMTP id i3-v6mr2749793plt.378.1527078744158; Wed, 23 May 2018 05:32:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpHvaOQtvYWJz4+drCDJa6Q5w7xHKYgoxqd4/wSc0gSmHvId/Ss+GEbq49ky5Qk/CgJRA8f X-Received: by 2002:a17:902:6ac3:: with SMTP id i3-v6mr2749688plt.378.1527078742575; Wed, 23 May 2018 05:32:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527078742; cv=none; d=google.com; s=arc-20160816; b=kXxYFwXafYqbmL/0FFnoooQihroEwy20ubciKvSlonEITEpe6uQKbBGiOYEtD3pTAI PWFU7dZBUZl/nn2bwlIIclzUeUEw3SPBKKr/UFkaHq/Kfwt08tCwU+/3EJMny2XsME1y XChO0pdUs4xC1JC+ky9a1WusWNP5/hJe6MajWoGJvGkipiAzGv7U4JvDDJnIVTBpVNPH 3PHX3eqL24kzfDrj/r/n8q73WhxbdWJ1S3IMoGo6CJTbnXYWt3zK+SWeF1p88VTinj69 QWjAe4hWIQR1omoS5+rRMjGqj1Oj3V/lOctU071WnkOBmsCzNuRvHLw7lWN1inflQNl3 ZCQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=spamdiagnosticmetadata:spamdiagnosticoutput :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=U01klOlooLdKqkXLi9WPj8wKbR4NPdQuRj2VGFu2Ilc=; b=Fy/NyPnV7QRid43PHmJ7pbDbRdFj0LqCd9XRmkiTDlz6x60f5ADPKOqeHqdfOA6f/P 4tWUGYCfD9lu8tdf3A43jvC9vB2EaexykGZv2HkfYc73mv/QwCHr1RItJulDYzFzmEDO LpA4BU60g8Wz62qgYNwpGGM96UEbTT9OIe+HWQXyl3Y0FZ5GryAz7ST/wo+8z+0rBUS7 sBOKVUaxS0aSRXC4g5rbSoQunSrHsq2rPGSH9MoVnbdn2vkVaJu3xV9ElRNUHxBO4wFw h6x5gFnMp/uDRixJCnWvdoqiyDRAyvGNjjqCtwKixR+EeOOB8bL67NVBzTcBnZhdUT18 7XCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=AqmcTsJe; spf=pass (google.com: domain of aryabinin@virtuozzo.com designates 104.47.2.112 as permitted sender) smtp.mailfrom=aryabinin@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0112.outbound.protection.outlook.com. [104.47.2.112]) by mx.google.com with ESMTPS id d25-v6si19061713plj.344.2018.05.23.05.32.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 May 2018 05:32:22 -0700 (PDT) Received-SPF: pass (google.com: domain of aryabinin@virtuozzo.com designates 104.47.2.112 as permitted sender) client-ip=104.47.2.112; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=AqmcTsJe; spf=pass (google.com: domain of aryabinin@virtuozzo.com designates 104.47.2.112 as permitted sender) smtp.mailfrom=aryabinin@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U01klOlooLdKqkXLi9WPj8wKbR4NPdQuRj2VGFu2Ilc=; b=AqmcTsJeYulfvD6c4FHC5xE/cwdYY/dbaxwY1DUARc449JqrSIrLRX0knmVXQ2hfTF2OCz/+xzmWInnmfgfrMOjrg7Zk4v5UYFegvvbWxqh2iMAAgbF7yYu+NQx/5fQmCuE/M6IZYUIO5xTHtIVGH0BGrlMeRtz5097Mm+c5C5Y= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aryabinin@virtuozzo.com; Received: from [172.16.25.12] (195.214.232.6) by VI1PR08MB3263.eurprd08.prod.outlook.com (2603:10a6:803:3d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.797.11; Wed, 23 May 2018 12:32:17 +0000 Subject: Re: [PATCH] mm/kasan: Don't vfree() nonexistent vm_area. To: Andrew Morton Cc: Paul Menzel , Alexander Potapenko , Dmitry Vyukov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org, Matthew Wilcox References: <12c9e499-9c11-d248-6a3f-14ec8c4e07f1@molgen.mpg.de> <20180201163349.8700-1-aryabinin@virtuozzo.com> <4fc394ae-65e8-7c51-112a-81bee0fb8429@virtuozzo.com> <20180522140305.5e0f8c62dcc2d735ed4ee84c@linux-foundation.org> From: Andrey Ryabinin Message-ID: Date: Wed, 23 May 2018 15:33:34 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180522140305.5e0f8c62dcc2d735ed4ee84c@linux-foundation.org> Content-Language: en-US X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR0701CA0078.eurprd07.prod.outlook.com (2603:10a6:3:64::22) To VI1PR08MB3263.eurprd08.prod.outlook.com (2603:10a6:803:3d::18) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:VI1PR08MB3263; X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB3263; 3:GQKOVPMTOVehZIze3vTeKzWs1AwHnucXGZuK3XGFjNHxhEB0g099COLcvAKCl/2nQ7Wx2IAoTLpVtIIoy87DaxB7cRvQV15crxWZEe2uF+TlCzeK7J7jJ/uQrHtWjVLsh6bdJqExZULMl5KtFxU0AVn5b77jmvnnA2Pe4u4kJj1WkL6Xq2qkSKfsvZm+xQWGQd8DajfwlpCx35Ij1tSrsJMJdrOOzEvNpCTkIrAYk/jqzluyQUd0WjsYXamYMUhD; 25:iVKsSELP3XWFTyXgThHTx6S5gvFrbjF7SNkIukYZX0YelGHOiGrUPXqMYRWjJSzu1NfL8eODWbFv4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+U; 4:MNjRsQm7PbS0HLxq/FcvkFxSpLsE2ei8pvUeDT9nYZGqNAAxCaiAWOSPwk9lG691SpzR9CFdjYwqqxzjFnwvyVAHWm5hpNpSbImFU58/WOfzO8lYJcnTOanC82IhniSvP0B77DCrUm1B/sdayflC9KW72ccW8QIPmHGG7nAGGYHyUBbG2Gvr5vk/29+TFdUZqqoiXXOZnW9+uE2TBJJf0bBs+Y+ABEM5ROS3GjT5tjyMrBJBqTFsTu8TU3nyqKqPESAv6rIE7fXY/vqswtQSHoM5jaz1uiEoCdqTYGQmDbpn3LQLj3IdCccKI9A4uurKxuk6NddjrDTnnVByUOYcmZNPhPcPvIMJ7B2knYqptVk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(209352067349851)(9452136761055); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231254)(944501410)(52105095)(3002001)(93006095)(93001095)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:VI1PR08MB3263; BCL:0; PCL:0; RULEID:; SRVR:VI1PR08MB3263; X-Forefront-PRVS: 06818431B9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6049001)(376002)(346002)(396003)(39850400004)(366004)(39380400002)(189003)(199004)(31696002)(4326008)(25786009)(54906003)(86362001)(575784001)(52116002)(52146003)(2486003)(55236004)(229853002)(76176011)(6486002)(230700001)(6246003)(16526019)(316002)(3846002)(6116002)(53936002)(16576012)(58126008)(36756003)(186003)(77096007)(68736007)(8936002)(81166006)(81156014)(5660300001)(26005)(65826007)(93886005)(7736002)(8676002)(97736004)(478600001)(305945005)(23676004)(66066001)(386003)(53546011)(65956001)(50466002)(65806001)(105586002)(6916009)(106356001)(31686004)(6666003)(956004)(2616005)(486006)(446003)(11346002)(2906002)(47776003)(476003)(64126003); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR08MB3263; H:[172.16.25.12]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjA4TUIzMjYzOzIzOnEzNmFJTFlrUUV5WUtPMm5Dc1pHd3czSXd5?= =?utf-8?B?OUVjVXZyZjM3Nks3UzZHdEJTRGZ1cmViQlREejdjVy8yNzJSdU9NZmhZenNC?= =?utf-8?B?TGxJR1U4U3ZPdWg2Zmh5QTd3b1ZUSWhBdUgvK05Sb3ZvS0toamF6UzYvYzQy?= =?utf-8?B?MkF4WjFTZTBRRElJaExmbjVhR056UCt4RTNEWFJ6ODZGdUx4SDJ5OFFjKzgw?= =?utf-8?B?T3Zaa1B4em5sWmpVaDFyV3hPaGpQQzM2b3JnaGN6TzRpSEpCR0dkMlJwNjM0?= =?utf-8?B?OW8vbnlESkVJVjF1QU9tNlo4SFpZUDNJdkRwNXpaV0h1dWJ5UStaOFVCYU8z?= =?utf-8?B?RVMxMVBPOEFvUzhxYkVNM050WWFSSHVBMzRCbU1FQVRTWmk0STZvS0tqL3N0?= =?utf-8?B?TWUwZlFHblV3bElvL0F1V2o5Y3F2TDU5S29tSFhwaE1pMTVIMXdDaUYwUjVB?= =?utf-8?B?SmFxdjB5YTRoUkpCaE9lWENPSUhYaWlLTm1aeXdlWWlOZ3lDRmw1TTNCK0U4?= =?utf-8?B?UzBsYUk3cXc1SHdUTEswZUgvL3lKNHpZenFKQWMwdXJabS9wZERNbHN4UlBO?= =?utf-8?B?T3ZLYmpCRDF5R0pBcG56WFZxWHFaZ0RUNUVKalV4d3JDOVVKcVRiOVd3RmhB?= =?utf-8?B?TTZBOGtHQy81ZXp4NklQVHdDMUFDZ09pZFNzOVRRSTd0SGdvY3JubVdJNGsx?= =?utf-8?B?SXd1c1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VeLg96S7YNYAFk7Hylgjjb8+tuMZ3C+71ZlHeUCDFlcARbL/+alIwPKJ6ZehTLfeEBlqWzkp89ruA045gr13AOAYNF9H4A+WRp2BdWLANDbtHAEejpiuRVSSppXLZgnJYjXnojrgMGo8lgNPaWtUuTtERhEoPWSsQthvDg+cqY6ErSmIyg==; 5:uDoJqeA31+V1mvqelpUKuxZs8lxCcujni2SiC9VvcrsLG46Dz76Vrge9gah3Kkt1mEBhUPOP5CIIaT/uycA+B4a9r4MGoVskSYjL/IhpA8ObYq6HoYZwJELwPME9aZBVnsxc2eSDnpMSnLyMqp+HAwWK8rEovELmb/Tg60xwCTs=; 24:UyzVdsW18iiYvvMkkkZDGIX5R0PN4KnuvLIZuQmkq1Ap1oMJMfbMJj1ffRLcsgK+XzUg9peye+C/RjFV9IUHnyg2EJpRK/LzpAx0uEaieNA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB3263; 7:/AQjvdPLOT+K6HZkrvfeuFMSYPBSPZVHV7vYTK/d9Z2RFnIUajMe2OmEVoVaQcI4pwLQYAPiaMeoe+xj0dUG38uk4ljVbiL9kP6PDFTQ8+QcwG+j4gX6jx+WwEyh3Hz2cKTdXqTrSENwlt8KALSa5XF0yRrNnlAWnkU/sE/PB6Qkzn6qaheuSHj56/wbORSwXLYuyc7vCpf3iwUKEGCe9UGMHJ/bHrxMoE3M67PqOLLz+lVXhkgUfBA2YFMJz+8A; 20:EC/18PC3Pa8Z7yNQdl/Xvgzv8ElwVFWYxQTxt3gpntl2iSqzEG+xykv01Jxscm7JJtrd9l4UzyJ55dTFpQXfpNjA6a1QtY2yn0ahh0uqST7ncOcPbi38PRLiK9TIxpUcTiG1x68FkSOH5z0BIqPM0kt0GbHh4c/9wSlxJJ3hmM4= X-MS-Office365-Filtering-Correlation-Id: c8a73caf-b2ae-4b93-311a-08d5c0a93959 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2018 12:32:17.9445 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c8a73caf-b2ae-4b93-311a-08d5c0a93959 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3263 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 On 05/23/2018 12:03 AM, Andrew Morton wrote: > On Tue, 22 May 2018 19:44:06 +0300 Andrey Ryabinin wrote: > >>> Obviously we can't call vfree() to free memory that wasn't allocated via >>> vmalloc(). Use find_vm_area() to see if we can call vfree(). >>> >>> Unfortunately it's a bit tricky to properly unmap and free shadow allocated >>> during boot, so we'll have to keep it. If memory will come online again >>> that shadow will be reused. >>> >>> Fixes: fa69b5989bb0 ("mm/kasan: add support for memory hotplug") >>> Reported-by: Paul Menzel >>> Signed-off-by: Andrey Ryabinin >>> Cc: >>> --- >> >> This seems stuck in -mm. Andrew, can we proceed? > > OK. > > Should there be a code comment explaining the situation that Matthew > asked about? It's rather obscure. > Ok. Here is my attempt to improve the situation. If something is still not clear, I'm open to suggestions. From: Andrey Ryabinin Subject: [PATCH] mm-kasan-dont-vfree-nonexistent-vm_area-fix Improve comments. Signed-off-by: Andrey Ryabinin --- mm/kasan/kasan.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c index 135ce2838c89..ea44dd0bc4e7 100644 --- a/mm/kasan/kasan.c +++ b/mm/kasan/kasan.c @@ -812,7 +812,7 @@ static bool shadow_mapped(unsigned long addr) /* * We can't use pud_large() or pud_huge(), the first one * is arch-specific, the last one depend on HUGETLB_PAGE. - * So let's abuse pud_bad(), if bud is bad it's has to + * So let's abuse pud_bad(), if pud is bad than it's bad * because it's huge. */ if (pud_bad(*pud)) @@ -871,9 +871,16 @@ static int __meminit kasan_mem_notifier(struct notifier_block *nb, struct vm_struct *vm; /* - * Only hot-added memory have vm_area. Freeing shadow - * mapped during boot would be tricky, so we'll just - * have to keep it. + * shadow_start was either mapped during boot by kasan_init() + * or during memory online by __vmalloc_node_range(). + * In the latter case we can use vfree() to free shadow. + * Non-NULL result of the find_vm_area() will tell us if + * that was the second case. + * + * Currently it's not possible to free shadow mapped + * during boot by kasan_init(). It's because the code + * to do that hasn't been written yet. So we'll just + * leak the memory. */ vm = find_vm_area((void *)shadow_start); if (vm)