From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B923C4361B for ; Fri, 11 Dec 2020 19:39:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A103423D50 for ; Fri, 11 Dec 2020 19:39:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A103423D50 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B63E76B0036; Fri, 11 Dec 2020 14:39:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AEE236B005C; Fri, 11 Dec 2020 14:39:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B4476B005D; Fri, 11 Dec 2020 14:39:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 80C0B6B0036 for ; Fri, 11 Dec 2020 14:39:12 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 45F87381E for ; Fri, 11 Dec 2020 19:39:12 +0000 (UTC) X-FDA: 77582014944.22.twig45_630c2ae27403 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 231A21808F265 for ; Fri, 11 Dec 2020 19:39:12 +0000 (UTC) X-HE-Tag: twig45_630c2ae27403 X-Filterd-Recvd-Size: 3012 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Fri, 11 Dec 2020 19:39:11 +0000 (UTC) Date: Fri, 11 Dec 2020 11:39:09 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1607715550; bh=U5rxTv/oE3jx6HklcCmBGmro94C4bmSbpwe8ZVtbESs=; h=From:To:Cc:Subject:In-Reply-To:References:From; b=tGaPNds9nNLIuZR3ejOz+yBohOgC7o2Q5h0m/NYNa9zd3uyUnGP/IP4+kW9R5Klpf ww7M2K+hdZO6jYV7elyNeRzaTtP4WsT6sCZElRWWE9lkbWbLyEygFlEho9rV2A3BLV 362MqgQHWa/jgbGJVMKxfO/qT9+2CbZ95+dC4qCQ= From: Andrew Morton To: Chris Down Cc: Kuan-Ying Lee , "qiang.zhang@windriver.com" , "sfr@canb.auug.org.au" , "aryabinin@virtuozzo.com" , "dvyukov@google.com" , "andreyknvl@google.com" , "qcai@redhat.com" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , walter-zh.wu@mediatek.com Subject: Re: [PATCH] kasan: fix slab double free when cpu-hotplug Message-Id: <20201211113909.230e68fcb66193aa71661ddd@linux-foundation.org> In-Reply-To: References: <20201204102206.20237-1-qiang.zhang@windriver.com> <1607083295.22062.15.camel@mtksdccf07> <20201204172521.ed9f77164ff9f9fc91f35ee0@linux-foundation.org> <1607185035.22062.42.camel@mtksdccf07> <20201205170914.e380173074b2deded2ade3d3@linux-foundation.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: On Fri, 11 Dec 2020 13:43:39 +0000 Chris Down wrot= e: > Hi folks, >=20 > Andrew Morton writes: > >@@ -188,6 +190,10 @@ void quarantine_put(struct kasan_free_me > > local_irq_save(flags); > > > > q =3D this_cpu_ptr(&cpu_quarantine); > >+ if (q->offline) { > >+ local_irq_restore(flags); > >+ return; > >+ } > > qlist_put(q, &info->quarantine_link, cache->size); > > if (unlikely(q->bytes > QUARANTINE_PERCPU_SIZE)) { > > qlist_move_all(q, &temp); >=20 > I'm afraid as well as the issues already identified, this also fails, b= ecause=20 > `quarantine_put` now returns a bool after "kasan: sanitize objects when= =20 > metadata doesn't fit": >=20 > mm/kasan/quarantine.c: In function =E2=80=98quarantine_put=E2=80=99= : > mm/kasan/quarantine.c:198:3: error: =E2=80=98return=E2=80=99 with = no value, in function returning non-void [-Werror=3Dreturn-type] > 198 | return; > | ^~~~~~ > mm/kasan/quarantine.c:171:6: note: declared here > 171 | bool quarantine_put(struct kmem_cache *cache, void *object= ) Yup, thanks. I think I have this all fixed now, using the old apply-one-patch-compile-everything-repeat approach.