Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2884416pxb; Sun, 15 Nov 2020 22:34:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzo4eMPGzFuPBqkwge/cio+DUtctErSTYEMnpzle2ROMXEPitNAAaAED7Rui4tZKk/MxHR2 X-Received: by 2002:a17:906:1a1a:: with SMTP id i26mr13577172ejf.478.1605508490544; Sun, 15 Nov 2020 22:34:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605508490; cv=none; d=google.com; s=arc-20160816; b=F6zmS/s4Hgy1A6p6vUu5Ng4KgB5hOZ2ad2jPDry9DnCVp7tO7uMKxCbtxIZ/+2BQ6i 7N58HY2PSf5mRiN2Uz7NpzeiF4Mlh1+MQLtVhM+wLtnyJaMyZuR1iy38jyGxLfcc+wjD Itq1buM4cR3D++DzHhKpWJzEIRB+wNLfq6GFyuKPSwwsTH4u2zWyiEbl0x3tFWb12njA 3erE+6Zkg+feoWwqZI30UhI0zSCBrEglDb8Mu3G7iKD1vzsiJQWyPoL/9+bl6wPDo6RS TCPYx2xMbtFoejf8vuSD39xK6By9uAT2Q5obvqUAQlLie+dhMo7KUbKM5fMBfekAMWf6 zWlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=dGKqQGTsHliY3FZsBlGIbzNAwCXc9W3VOgntOqA5xBk=; b=bkoGzIFNA9UyDA+WwqXHC6JWbKM6mF9UpneRxE8/f3UefSgi6jAzhF6OS9FHN8hDfC XOBxECGgmRi97N5evHiuFfpN4WmQ3qXPRYzZg9v/oWaaeCBrGba2exseSm7TDOpoyoD9 nUh8OxJ+u55k/EVyoqRTUn5HC7sbn0Z79uN9UW/enbqrhsLjoP/4AodBNR7aiAgaMtc8 mSLguaxJh1HDF3xojxI1jMUBSlv4pOp8sLrlQl7hhUi2lshqlJKeQTlBv1OsX8XJrdUy wd8M5X3Kotqzs+U3zghDOo2IHHVVC7LMJIO1QiuSZV9U6yb+05dZkWEqmTDz6VQ2zn59 Yk/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si10926886ejr.364.2020.11.15.22.34.27; Sun, 15 Nov 2020 22:34:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726912AbgKPGa1 (ORCPT + 99 others); Mon, 16 Nov 2020 01:30:27 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:42060 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725819AbgKPGa1 (ORCPT ); Mon, 16 Nov 2020 01:30:27 -0500 X-UUID: 41ff020b6eec4a2580c9b73b5e5d3933-20201116 X-UUID: 41ff020b6eec4a2580c9b73b5e5d3933-20201116 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1805354627; Mon, 16 Nov 2020 14:30:21 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 16 Nov 2020 14:29:31 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 16 Nov 2020 14:29:31 +0800 From: Kuan-Ying Lee To: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Andrew Morton , Matthias Brugger CC: , , , , , , , , , Kuan-Ying Lee Subject: [PATCH v2 0/1] Fix object remain in offline per-cpu quarantine Date: Mon, 16 Nov 2020 14:29:27 +0800 Message-ID: <1605508168-7418-1-git-send-email-Kuan-Ying.Lee@mediatek.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 75B8CD20D38641DB5CDC7A8379557EE33EB44A40F207B979FD7759BFA4468E852000:8 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes object remain in the offline per-cpu quarantine as describe below. Free objects will get into per-cpu quarantine if enable generic KASAN. If a cpu is offline and users use kmem_cache_destroy, kernel will detect objects still remain in the offline per-cpu quarantine and report error. Register a cpu hotplug function to remove all objects in the offline per-cpu quarantine when cpu is going offline. Set a per-cpu variable to indicate this cpu is offline. Changes since v2: - Thanks for Dmitry suggestion - Remove unnecessary code - Put offline variable into cpu_quarantine - Use single qlist_free_all call instead of iteration over all slabs - Add bug reporter in commit message Kuan-Ying Lee (1): kasan: fix object remain in offline per-cpu quarantine mm/kasan/quarantine.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) -- 2.18.0