Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp336696ybi; Thu, 1 Aug 2019 20:06:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6cpnL7Dwt07JCUNdaIs7J0wAWxACSuwiEo+uMqLWqQa3Hk6+IobA1HH7vcu5VqqbmExdt X-Received: by 2002:a17:902:e306:: with SMTP id cg6mr129187423plb.263.1564715194260; Thu, 01 Aug 2019 20:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564715194; cv=none; d=google.com; s=arc-20160816; b=fgjArCgM0/thIbL5tv4+4M5NN2yyTCFjWYhNa88LmUkTveAd5Sinso8Otd5v3oBjXo Urgd6rUYeYpJMg1QQ7US3bcErl5fVvpeoxY6qB0WCuQNoZfgzHDwXa1s1jHjMlFt9Ope A1rqIo4QpPtHwcA6j/yvWBp3jQWgcjBepx4JjZwoAOGnWDPLrJHlmsxN088PxsIvcUaL 1aDKWBwQAinHh8u8pGDcZVI8LRq0qv5u6suRGsvs1eUNufcSGMTh75uF+mO3RU+Uy+BB LrULd9kQq0aa5RcLLIbesEeLcAmlNKYh4+b2FLGQGR87kwoaRlNrXUTGSNpPb0O2nf+7 /1aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=fMGiC+gHRydmpo5zkwmfgrAx10Xxrzh90eBI7yxp1tE=; b=ek3HNcMGdfzVgngC8gD7LDFaU8FNCrCf4a9v5ab1LF2yrQlcss0ZvT3czAdl6pWl0C VvsbOuGmNM81jmV5UOnm6Lf9cDF/6KutcptrnFvuRYsYVcuDp6u2eWx8y1bqy+3MfkUG NUqLsW+HXuX8FH80GY7YxmnbCOhi5m/vF8SrA8nxQ+56KVeivNuxhjAPAQJHmfCUIdDA PwSQFKQsjCurmoniXFXOiH3xVjfUcmwBtFTfzQMcHhbj5/yNdJMeYHN3K69J4BV8sEWd 2XOAtSQJd8zska+fZMPmr3YjpiY1dTXsGv15wUQGUukqak/rm8L+fM0I85Ythmfpofge kI7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id w11si35743705pgr.321.2019.08.01.20.06.18; Thu, 01 Aug 2019 20:06:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728308AbfHBDE3 (ORCPT + 99 others); Thu, 1 Aug 2019 23:04:29 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:41902 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726825AbfHBDE2 (ORCPT ); Thu, 1 Aug 2019 23:04:28 -0400 X-UUID: c92cdbe318cf414695363abda4ef831d-20190802 X-UUID: c92cdbe318cf414695363abda4ef831d-20190802 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0707 with TLS) with ESMTP id 160514836; Fri, 02 Aug 2019 11:04:20 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 2 Aug 2019 11:04:19 +0800 Received: from [172.21.84.99] (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 2 Aug 2019 11:04:19 +0800 Message-ID: <1564715059.4231.6.camel@mtksdccf07> Subject: Re: [PATCH v3] kasan: add memory corruption identification for software tag-based mode From: Walter Wu To: Andrey Ryabinin CC: Dmitry Vyukov , Alexander Potapenko , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Matthias Brugger , "Martin Schwidefsky" , Arnd Bergmann , "Vasily Gorbik" , Andrey Konovalov , "Jason A . Donenfeld" , Miles Chen , kasan-dev , LKML , Linux-MM , Linux ARM , , wsd_upstream Date: Fri, 2 Aug 2019 11:04:19 +0800 In-Reply-To: References: <20190613081357.1360-1-walter-zh.wu@mediatek.com> <1560447999.15814.15.camel@mtksdccf07> <1560479520.15814.34.camel@mtksdccf07> <1560744017.15814.49.camel@mtksdccf07> <1560774735.15814.54.camel@mtksdccf07> <1561974995.18866.1.camel@mtksdccf07> <1562640832.9077.32.camel@mtksdccf07> <1562839579.5846.12.camel@mtksdccf07> <37897fb7-88c1-859a-dfcc-0a5e89a642e0@virtuozzo.com> <1563160001.4793.4.camel@mtksdccf07> <9ab1871a-2605-ab34-3fd3-4b44a0e17ab7@virtuozzo.com> <1563789162.31223.3.camel@mtksdccf07> <1564144097.515.3.camel@mtksdccf07> <71df2bd5-7bc8-2c82-ee31-3f68c3b6296d@virtuozzo.com> <1564147164.515.10.camel@mtksdccf07> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-TM-SNTS-SMTP: EFC55C8D8568410C5734BD4FCFD4848B3C4EE4673A27E15E32FD2B157FABFEE12000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-07-31 at 20:04 +0300, Andrey Ryabinin wrote: > > On 7/26/19 4:19 PM, Walter Wu wrote: > > On Fri, 2019-07-26 at 15:52 +0300, Andrey Ryabinin wrote: > >> > >> On 7/26/19 3:28 PM, Walter Wu wrote: > >>> On Fri, 2019-07-26 at 15:00 +0300, Andrey Ryabinin wrote: > >>>> > >>> > >>>>> > >>>>> > >>>>> I remember that there are already the lists which you concern. Maybe we > >>>>> can try to solve those problems one by one. > >>>>> > >>>>> 1. deadlock issue? cause by kmalloc() after kfree()? > >>>> > >>>> smp_call_on_cpu() > >>> > >>>>> 2. decrease allocation fail, to modify GFP_NOWAIT flag to GFP_KERNEL? > >>>> > >>>> No, this is not gonna work. Ideally we shouldn't have any allocations there. > >>>> It's not reliable and it hurts performance. > >>>> > >>> I dont know this meaning, we need create a qobject and put into > >>> quarantine, so may need to call kmem_cache_alloc(), would you agree this > >>> action? > >>> > >> > >> How is this any different from what you have now? > > > > I originally thought you already agreed the free-list(tag-based > > quarantine) after fix those issue. If no allocation there, > > If no allocation there, than it must be somewhere else. > We known exactly the amount of memory we need, so it's possible to preallocate it in advance. > I see. We will implement an extend slub to record five free backtrack and free pointer tag, and determine whether it is oob or uaf by the free pointer tag. If you have other ideas, please tell me. Thanks.