Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1630210pxb; Thu, 4 Mar 2021 16:57:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTJ1+NjSWd4Zz+djhxzXus3R9El16eBOhkD3adLH5ictYnwfZLBSz1bxKjPlvsKBPiYrSj X-Received: by 2002:a05:6638:58f:: with SMTP id a15mr6862447jar.35.1614905875214; Thu, 04 Mar 2021 16:57:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614905875; cv=none; d=google.com; s=arc-20160816; b=V4Pp5wTjH7iL7Mv1DntZHiBtBQXEgFInX9r9u9Z5WVjiXQKfBfqOZTLDJ1/ejSc9Cw Spa2vtrkBXwLeeq6Z7D39TNW3njojJc2wb2Msn+XhhPIPyXGro+IcA6fFG1n/xXHPsJs KXM6McXlTwMy3PCHpEtezI1N75sbWRozcq9S1ZMSQjZ9Ovvqf+EibhH0rj2Fd3xCAi8C gMk+CoHY5K5vLAVkp342ghsN9lzv3UuQauP6VEvWIyJnbRZY0dOwLPWwKwiVlg9v4J3X MJHSdYiA5+StzgJz0tVv+/RAd9oHpekbd/St9bpfMzohZ2YGcA1xkHOP/I7aLIIdD0lZ FAAw== 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=lgdkSDcMMDWh1SRt3hQoa5/TwUrpy7W6CPuK58HsLUg=; b=zkEWEDZA7xY7+vSmGNvDNTBbK/Tny1FjKHCzyHuh+XPPdEOGcMg1v3Kh9a6P2B/F6O 7WOF6DSDzqYqonEl4Htfwz81vj1YzMCcphFBQswq65Opp4JvjYgxINfREGCvTCF3Lmtn 4V0xADD9zxWFMBzNixkqvCnpVqpbKrxzTHRF4v2+5aoIeoqacTTau43wBywByt4NwUiZ j3Zs+I1+VkIlWR9pfesNrRRIsE7gKPwfVPpVV0viGYlYRVgOCVSKj9IWGoAWlzGz68Eb ry70zR47Cji08zsG6Uw6PCXy/wP+QUoo1dkR6ppSJP+25gRogRZpnrQIxoQStYbIpKDE LTPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=E1DX7PZs; 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 a8si832549ilj.125.2021.03.04.16.57.42; Thu, 04 Mar 2021 16:57:55 -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=E1DX7PZs; 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 S234557AbhCDVHG (ORCPT + 99 others); Thu, 4 Mar 2021 16:07:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232783AbhCDVGl (ORCPT ); Thu, 4 Mar 2021 16:06:41 -0500 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCB82C061574 for ; Thu, 4 Mar 2021 13:06:00 -0800 (PST) Received: by mail-qk1-x730.google.com with SMTP id 130so14762700qkh.11 for ; Thu, 04 Mar 2021 13:06:00 -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=lgdkSDcMMDWh1SRt3hQoa5/TwUrpy7W6CPuK58HsLUg=; b=E1DX7PZs5hFH2/Uww4LEeP0Z3hUElD/Z50FBpEidIfYNm73tdl4HxZ7ZgUGTCbOf8G Cae6dxwro3QySC0N3Md6i6iwtLazR3+zhoQ++LMM/8MEFu3SqIyOxjVC9yySHR6WnLop YUSxz1LtpVtp0V2gOIE68CUHxXaEP7xQv6mz/+ReaPio9y+JmYoroR+JG8aBzu6pMSdU Ybav276o3MN9TyPflzCLQboFY6S0hEtDC/CrSpLpJH5J6MkMBNrSR9wADMO3AesrMEHB Ofa+A99/jMNz7fLDNej/W+t3K36ZD4ADNbt4dpcDDDopRuvEOqnah44F0bmmLn9cQEmx AocQ== 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=lgdkSDcMMDWh1SRt3hQoa5/TwUrpy7W6CPuK58HsLUg=; b=K/Acare15tWzoDqC3RJOtRz55mjG7jcBKmaJXjRuNzDWIVpkNB73JFYGAq1BRgddEC Rzhn+bJ5O/fDoyb2ROjz+aNDzFQ5OYsI2pJmGFOtkKpEpEhCMzGs7FacQ+Vh3AzH2SHX jVhHOdiMUjmjUhl2x+3Nn+xDl+ig48ViHlHX2MqeRTGyyLvJWM/FLyktPWqbmHZfLesy v3ni5ymqejPsGk01XsCjSZUCMlc94700qccYWOsc6F/X8Rx56EZG3naF4RaCEahS6egS SGZ7+muaSxvOuEpm3Y3oKdopnX1rW3B2zFZcFuzrW+BqipGWQGEAmPGtP6UZD2P8zHXk x33Q== X-Gm-Message-State: AOAM531b/tA81weGmEO2+x9Oqfaa/+VFNsqc0jxEg40xJFA7a79QdKsk ImsPPhHWnx5MW1TBNe5yleJ7nhIYANXLbpPfu86otw== X-Received: by 2002:a05:620a:1353:: with SMTP id c19mr6192822qkl.392.1614891959772; Thu, 04 Mar 2021 13:05:59 -0800 (PST) MIME-Version: 1.0 References: <20210304205256.2162309-1-elver@google.com> In-Reply-To: <20210304205256.2162309-1-elver@google.com> From: Alexander Potapenko Date: Thu, 4 Mar 2021 22:05:48 +0100 Message-ID: Subject: Re: [PATCH mm] kfence, slab: fix cache_alloc_debugcheck_after() for bulk allocations To: Andrew Morton Cc: Dmitriy Vyukov , Andrey Konovalov , Jann Horn , LKML , Linux Memory Management List , kasan-dev , Marco Elver Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 4, 2021 at 9:53 PM Marco Elver wrote: > > cache_alloc_debugcheck_after() performs checks on an object, including > adjusting the returned pointer. None of this should apply to KFENCE > objects. While for non-bulk allocations, the checks are skipped when we > allocate via KFENCE, for bulk allocations cache_alloc_debugcheck_after() > is called via cache_alloc_debugcheck_after_bulk(). @Andrew, is this code used by anyone? As far as I understand, it cannot be enabled by any config option, so nobody really tests it. If it is still needed, shall we promote #if DEBUGs in slab.c to a separate config option, or maybe this code can be safely removed? Alex