Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2236508pxu; Mon, 7 Dec 2020 00:45:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/MakSGlx4oFsLWxaxt3Rwvp8B88+nDH/JZWqu950lQSsgGaPe5/1hNhFWKTHSBm+QxUB4 X-Received: by 2002:a50:d5d5:: with SMTP id g21mr19522418edj.41.1607330738627; Mon, 07 Dec 2020 00:45:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607330738; cv=none; d=google.com; s=arc-20160816; b=xnhho0CuIsL/Nn5TuVCRQ1RCjJKhh9ZT8gEQl1pIH0ahof5PrVWUQCkeRwpdqXurxh 6thfgCXQVTcOIZfrxryz3k6IOpB3MpWCS2P3WWleKmlNgc2d0u3Wu9Ut4q0qW4c6YHqt dryBxP+Qm2PcJXpOM8rZvf00dY6AOy5q01AbA9Nb/12H7V2HcPm9jrNpnbhTOFfe6yg0 rU7okzFklpAsMKpLSNpip8nihlRID1/wLlsFVSZpSGqvXeNETxVCzP9gZzXpVchx7lCq lDJmKaZMrIrXmZfL5z/MSrETiBVchWJbUPcI+9OftZo13Pyz7BTHXkCLeaoUK8/KUOSf 3IzA== 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=l+9j/MJ7j0lmC2v45gU4N0XrvCt1N7cPIreqO6JUb8g=; b=LRcuROJFHoYNKfsGYWS+FaFWnkQJu242AgKwQtZ+93Nn9XfmUCoS/cRiMRpvAeSJge rdpp0bds3M1SXj9uxwCjsYJVeoq4TTIx26cXLGzosAtgOVVwiLnuLeCSg5wwrNo8FM6P IcXJ6dcEs7kgpW1ubjMKr2Kv88QZqXKRknDppNMsPxO9bFZXcC5yaS/l1PlXekVogjab ILi9fnUQVo7h8nOOXZd+xbzdyFL9QC6ZtdTK8ci9dlGzsIiXxCmdBuJpQijEuhDoJRx9 2PegdSAelpzA+sSfBqPQefTdW26RQfykEsvdvhXP+hynDew/COMAxK40F3v4bC0EKXXI wbuA== 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 q4si5087786eds.576.2020.12.07.00.45.15; Mon, 07 Dec 2020 00:45:38 -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 S1726226AbgLGIoC (ORCPT + 99 others); Mon, 7 Dec 2020 03:44:02 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:42262 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726087AbgLGIoB (ORCPT ); Mon, 7 Dec 2020 03:44:01 -0500 X-UUID: 8450566103d24bb199fd8f928400b60c-20201207 X-UUID: 8450566103d24bb199fd8f928400b60c-20201207 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 425649347; Mon, 07 Dec 2020 16:43:18 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 7 Dec 2020 16:43:08 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 7 Dec 2020 16:43:08 +0800 From: Kuan-Ying Lee To: Zqiang , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Andrew Morton , Matthias Brugger CC: , , , , , , Kuan-Ying Lee Subject: [PATCH v4 0/1] Fix object remain in offline per-cpu quarantine Date: Mon, 7 Dec 2020 16:42:57 +0800 Message-ID: <1607330578-417-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: F870CAB994CC304B1F71C8C2A04196A3049B21FA10F0E5842595FF682C5B255B2000: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 v4: - Rebase to linux-next - Remove the qlist_free for double free issue - Thanks Qiang, Qian Changes since v3: - Add a barrier to ensure the ordering - Rename the init function 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 | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) -- 2.18.0