Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp705733pxb; Thu, 12 Nov 2020 14:23:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfHd553v5bbGCqra1HHwBWlap7azPMGJHmCR4pATe27/7w8a5a7sXw6LWSV94bZOnk2QYx X-Received: by 2002:a17:906:5bda:: with SMTP id w26mr1468328ejs.233.1605219797602; Thu, 12 Nov 2020 14:23:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605219797; cv=none; d=google.com; s=arc-20160816; b=pzdYolIaZjVhHsvYHhx0DWvj0XNwSK8DNM9aVRjLH8Ab3+jcNlX7fiTnE+Nc1ryYXt 1OBc095NOqXtZwiFXFc+kw8bbyTFJuFogbWe7p4UwzluCdNjETmafGZC7KVSvv5Psrvu rq3vMQqaNCxw2R1KcJx7azsbwE4P66xEWvzuDvHu8J8GqqsY6Ok+BBwvtivl8qAVvFh6 TtL0yCcjll/ITuHB9Hq7h359Ctpa/hAob7XOCgkrbfN3BqLfxh5uiElr0v67ICNUyV6l /54J7Zksw1+VmaygT7PXRy19R5c7DKA/AyohDtt37VhSp1JmbqWbT6i5wYG7Kko8Zomf b3gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=qTAA2mjTH1s5gJvXfoqFOnb2RIhffz7/HPf/PMilg1s=; b=M6bb+iI/xU74VbCKWlOWYiN9TMWctk427Qywfpc26GapKKHskS63fuMF5dIuxeycch UqqHI9KB4CJw14u/HfUlTAyRA7ZeYJG8ehSW1rH5rPt8Ttj6UmsSGfOqcLRQErIfzHMk EJSj0s1JROoghunZaRF7SGrn7ldsQuodi+bBG7v4ZEgGb5jWohzXKIlIiOEpWRVfYYiF uXCanJnGYymlNF61J5E2ZA7vsjee+lADX8Q+C+fvmjAiVlBiQQa0JZPfLH91LiDJb/jZ B9nf5l/fpJ4J50MGCvw8SMNGq3XDqvA/TJwf65imR82EWTXbYJ8l+x/NcbvXyPHU2sIZ 1uzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dFN+5nhP; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do10si5094137ejc.675.2020.11.12.14.22.53; Thu, 12 Nov 2020 14:23:17 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=dFN+5nhP; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726146AbgKLWUk (ORCPT + 99 others); Thu, 12 Nov 2020 17:20:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbgKLWUk (ORCPT ); Thu, 12 Nov 2020 17:20:40 -0500 Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A899C0613D1 for ; Thu, 12 Nov 2020 14:20:40 -0800 (PST) Received: by mail-ot1-x344.google.com with SMTP id j14so7199567ots.1 for ; Thu, 12 Nov 2020 14:20:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qTAA2mjTH1s5gJvXfoqFOnb2RIhffz7/HPf/PMilg1s=; b=dFN+5nhP2JgNsIO+pN31g3PQMctzBg5Wp/ncFqisaXZKXLFc1gjnImkp1mqP4HzxON /6vtZoMbWfQBequoH+jOBoXPCJkahX7hmHKD5aCZNUSIVyUWnm1HzYhnxssg0THcn2kl YI8ecBu65VO7pscM9wkv1zVNMwoUkGC9rPEY9TUXiOsvH/YC+GwQxEqve3H00ZgdThWH DGILd7UgTmn2cTjSHq8lqRpZyINt3ffKMXVqA56W5EYUV3K8Y1wULP94qqdAM2dO9wm8 sw5W0GmZTrRf1vtd82BIDHftPFaLSvE7gAsG4aEJSHcR+dvf1FcfCHOUeT7xh7t3X2F6 ZrFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qTAA2mjTH1s5gJvXfoqFOnb2RIhffz7/HPf/PMilg1s=; b=NEE/jKddvldIMk7FkWK0/KISQzAD909LwLNcaihEVg1gtXK6R/jwCP70NtyA+jrSF8 ZDOPpVCxPJcfxrh/1OaeiEOJToJDKvCDFusotCD5V7EqX8Na4pFJr37ydcRVIou27/fM T/YhjqpBa4O0LgwulpWrEyZQtJDkc89e/pAWkth8eK9HPl1AArxaJn7Zp8//nycfQOS2 RmxBibe1yiz61nP0H6St9bQWi3IORcaNeN/r5rYb6kK1aWFVBn7W57ID0Cx1s6nXl9vU R7xgxRrF01YE7L2XEAOfA8ofdlXPOSC5L6Wz1mQXe0brE97QETkXNFGnt53fs5K/Q+26 vR1Q== X-Gm-Message-State: AOAM531L/yc7QK+0xoPNZ2dKCI2oxa5EkN9DuomKaVmfG+AnGq+4+NfE ymyJs+plYO9FJiIJs0al4E2L3FgyNwK069+C+pgueg== X-Received: by 2002:a9d:649:: with SMTP id 67mr1045852otn.233.1605219638578; Thu, 12 Nov 2020 14:20:38 -0800 (PST) MIME-Version: 1.0 References: <0a9b63bff116734ab63d99ebd09c244332d71958.1605046662.git.andreyknvl@google.com> <20201111174902.GK517454@elver.google.com> In-Reply-To: From: Marco Elver Date: Thu, 12 Nov 2020 23:20:27 +0100 Message-ID: Subject: Re: [PATCH v2 10/20] kasan: inline and rename kasan_unpoison_memory To: Andrey Konovalov Cc: Dmitry Vyukov , Alexander Potapenko , Catalin Marinas , Will Deacon , Vincenzo Frascino , Evgenii Stepanov , Andrey Ryabinin , Branislav Rankov , Kevin Brodsky , Andrew Morton , kasan-dev , Linux ARM , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 12 Nov 2020 at 21:54, Andrey Konovalov wrote: > > On Thu, Nov 12, 2020 at 8:52 PM Marco Elver wrote: > > > > On Thu, 12 Nov 2020 at 20:45, Andrey Konovalov wrote: > > > > > > On Wed, Nov 11, 2020 at 6:49 PM Marco Elver wrote: > > > > > > > > On Tue, Nov 10, 2020 at 11:20PM +0100, Andrey Konovalov wrote: > > > > > Currently kasan_unpoison_memory() is used as both an external annotation > > > > > and as an internal memory poisoning helper. Rename external annotation to > > > > > kasan_unpoison_data() and inline the internal helper for hardware > > > > > tag-based mode to avoid undeeded function calls. > > > > > > > > I don't understand why this needs to be renamed again. The users of > > > > kasan_unpoison_memory() outweigh those of kasan_unpoison_slab(), of > > > > which there seems to be only 1! > > > > > > The idea is to make kasan_(un)poison_memory() functions inlinable for > > > internal use. It doesn't have anything to do with the number of times > > > they are used. > > > > > > Perhaps we can drop the kasan_ prefix for the internal implementations > > > though, and keep using kasan_unpoison_memory() externally. > > > > Whatever avoids changing the external interface, because it seems > > really pointless. I can see why it's done, but it's a side-effect of > > the various wrappers being added. > > It looks like unposion_memory() is already taken. Any suggestions for > internal KASAN poisoning function names? I still don't like that one of these functions just forwards to the other, but we could use it to also give the external function a more descriptive name. I propose 2 options: 1. Name the internal helpers *poison_range(). 2. Name the external function kasan_unpoison_range() instead of kasan_unpoison_data(). Anything "memory" (or "data") in the allocators might not be too helpful w.r.t. descriptive function names (i.e. stripping "memory" from function names won't lessen descriptiveness given our context). Perhaps kasan_poison_range() for the external function might in fact improve the external interface (without looking at its arguments). If we need to keep the internal helpers, I'd probably go so far as to suggest renaming them to simply kasan_{poison,unpoison}(), and then building the external kasan_{poison,unpoison}_foo() on top. But maybe that's too much for now if it doesn't fit here. :-) Thanks, -- Marco