Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4018104pxt; Tue, 10 Aug 2021 17:44:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzifJdwTL2Bjp4mMvLLLj0L3YBt+it3TyqGutgThSvLcZoUa8BhE7VaEsmXWoAetWkqcm4G X-Received: by 2002:a05:6402:550:: with SMTP id i16mr8177597edx.177.1628642654199; Tue, 10 Aug 2021 17:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628642654; cv=none; d=google.com; s=arc-20160816; b=yQmaFdyLWYOBQc9wB7oP9Tqc3oHohzVWIxlMq1xxQpZi5Av5L+0AMYhTBveH5z7x0g T2x8uxu49sMv/z0ImOla2fOZBA/iseMULcd2++c3bqAePl5R+2NerwNv0LMqlPx8Zjki Aa7zJgZKBYEe3wDjTUr+h6W9GImTAVLv/C4ePfx8R+u6zQjJH38sAoPKkbdy089uop3J kNw5eo1aEFjqAhh4ez4yRpFGb+iRZ2wiimmW/SYKg+iciqQpdP0hVJVZvdKbt7b0eX+3 aZZneBQac3I6CXYr8i5CAmzG4cO7bykWcMMe2E7SdEYFmfIkdIQr/Dv+rSAiMkUDal83 7TCQ== 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=+IKe5IV7lT/U5uUeCk8dwVAQVUVWQi0SX4MD0PFARrk=; b=ErvbLMFCrpQlfcrk/bEWGM5YJCTIWsQKhNyPt9oxGpxsjzEvQl2LUopiwEeMPnhcVS Wv4nsUOyle0hkx2S4ZOl9imshb/gWamnXOULdqSJh9VywMqrtjSu51CjGP/9b2PmOx73 XyDAquneWht+A/JI5CRzkvO77y8PjVRVMeoz1OqwaFRWttfTN2N9tCbHcDGXaDy8r2XU 6dZGXca8WbbkmFhA6AT5m6nzDKHqpJkyCmDXjuemN8WSsQjJMOBRSywixCcW1UxTjYfb OOylsKMUThiTFrzTkkq4GlJskZuo/VMGQWTDO66SRgk88TYU/8BOVpmsU5qCm1pRmCRb oJMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VpErF9Be; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l1si22153492edw.438.2021.08.10.17.43.37; Tue, 10 Aug 2021 17:44:14 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=VpErF9Be; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235756AbhHKAl6 (ORCPT + 99 others); Tue, 10 Aug 2021 20:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231423AbhHKAl5 (ORCPT ); Tue, 10 Aug 2021 20:41:57 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 810FAC061765 for ; Tue, 10 Aug 2021 17:41:34 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id d11so690330eja.8 for ; Tue, 10 Aug 2021 17:41:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+IKe5IV7lT/U5uUeCk8dwVAQVUVWQi0SX4MD0PFARrk=; b=VpErF9BeqvJ1lvp3C6qQVShFP+IPiAWshgdKLp0P6z5k1tr0AEcTxGz7UXnNvecgkT YT99OYu7LRWl/Fy8NL6FIcxXcEsQLWAxQyNk05Zd8sc8Qx8x7XwvaM2sLY8/poHHrPu/ DyjfK5DuBXeRhweChIlCA1+mwEa406UsmTGdff6uEJHY9SaVQJnQwoVW60I0hdrHNxvT B7PAjoDqxdm+RkuigKCXFaq8jWVK9FfgEfezb2NHeiW/Q1qHn1shnvOneg5hIHS3xcg3 YHRkeLwJ1ju+oYqRCy4vCIsyP4fSsn+uZS9kDF6Io8A5TEIZ4DCoY+wVtUa1vrnoYB34 k4Kw== 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=+IKe5IV7lT/U5uUeCk8dwVAQVUVWQi0SX4MD0PFARrk=; b=J/fTj8tqb6Vdf6DAOd9zXX0GReQmJP9GPPR46gCQX4/Tg7bRf8wbfAQlVcTXU9f067 FhW2hN8gM9eUkeCRX7zuV9TY4oy1Smb42PnM337kYo77VBTG1O7xCZWUXd1DvIpBQr/k 8bctohRqaw4dLO+PD9fNj/9aH5x7TUkRJlwDLl25qXTcojqJAfjeQrccQ0pU2R8E657j igZiyXusRosv4lAi0kMikguztPp9/YLBlzs7tuSL/JHMgGHLFRXaGS3JxUhjpiFSu8z0 UDeKILw9PcuLv2hEnnbFE9ayN2o3Q7AS9T5SX42Ji8qqga1Xf752Ka6+yRHlIWbeLvDf MdSA== X-Gm-Message-State: AOAM533IvfSmFeixrRxsh43yKXne5GtFVgBO4B7iem5SDaKWVQMzllvK n55UgpqKM89QnPRIG0d/Cals9KPJnsiJRdpl6eM= X-Received: by 2002:a17:906:d147:: with SMTP id br7mr1138362ejb.126.1628642493014; Tue, 10 Aug 2021 17:41:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andrey Konovalov Date: Wed, 11 Aug 2021 02:41:22 +0200 Message-ID: Subject: Re: [PATCH] mm/slub, kasan: fix checking page_alloc allocations on free To: Shakeel Butt Cc: andrey.konovalov@linux.dev, Andrew Morton , kasan-dev , Linux MM , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 11, 2021 at 2:18 AM Shakeel Butt wrote: > > On Tue, Aug 10, 2021 at 4:47 PM wrote: > > > > From: Andrey Konovalov > > > > A fix for stat counters f227f0faf63b ("slub: fix unreclaimable slab stat > > for bulk free") used page_address(page) as kfree_hook() argument instead > > of object. While the change is technically correct, it breaks KASAN's > > ability to detect improper (unaligned) pointers passed to kfree() and > > causes the kmalloc_pagealloc_invalid_free test to fail. > > > > This patch changes free_nonslab_page() to pass object to kfree_hook() > > instead of page_address(page) as it was before the fix. > > > > Fixed: f227f0faf63b ("slub: fix unreclaimable slab stat for bulk free") > > Signed-off-by: Andrey Konovalov > > The fix is already in the mm tree: > https://lkml.kernel.org/r/20210802180819.1110165-1-shakeelb@google.com Ah, I missed this. Please CC kasan-dev for KASAN-related fixes. Thanks!