Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4006055pxt; Tue, 10 Aug 2021 17:21:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzl5t2X1MKNU3s8E3xS2dB01MLDl0w8H5ehjf5HhYJPTEXVEkDVgzogRJ1aKXT2CT6/b2mr X-Received: by 2002:aa7:c844:: with SMTP id g4mr7534235edt.123.1628641289152; Tue, 10 Aug 2021 17:21:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628641289; cv=none; d=google.com; s=arc-20160816; b=o65vmIP7NxE3Dvq38CvzwSKs41kof9W7LVQh8rPVlHjYCW2DYl8HrFPam4UM96GUzE t15xuEfx7YVR8c3VXK2PJWq3kDPCaNfvfUU+MNLJ0DNZWgQbJoDhhx1RVuRBgiiu21RB T+lUlgLKrEmXQkccDoDHddiwKhHYmOUpTPybM/NvMDV25fvFYvAkMDIcVb3nO1EiH0sF ojw5+C/ndEdUe5KfJmahyD9/pQ9uKIEnJE3Q/IzFBRfGZ2cpcApkPkfMesFyHOxPE/1y FJ2Pzdk1gs880DVqLlSirWlzHslweadgmb9BLFFJgE7H1wEOI7lEHTAQgPEyaG77BSQJ 4rqA== 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=KkFE6Z56Mr1EKMwPtDhJ4HsMjjvC1ODc/Bi7DtZL3y4=; b=B26EungsD4qvAT6PoWHhpig6my7lcE/wQcUSdOvJdGcK4HtZ9A3IeSKO0JVD8lRUXI g81RiCBY+zcOLxd4uenZIZn0sp2blxNtN16ZK8Moz0rbHgDuWnQGqUfYBkUHzsef45qL BcPONXKb/eT/RylkCWBEMrtO68JNk5itJPJbUnR+/VXpu7ert1B4Eez5es2wCIEt02iR jX3dgNPPo5EwSKjD+68AOXnifgwAhXwcN1e81qD+owPcfGC9eN4/Jc7TP8AGik/TeX4z zmX6YwV5fcbimwV36MGWCXdNvR9O92h6/fSsjq9ZKs1w0buz+L9lh5YDj0KdmUGPcOpa P+qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=KjMIw7uH; 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 di3si495487edb.166.2021.08.10.17.21.05; Tue, 10 Aug 2021 17:21:29 -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=@google.com header.s=20161025 header.b=KjMIw7uH; 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 S235768AbhHKATG (ORCPT + 99 others); Tue, 10 Aug 2021 20:19:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235742AbhHKASb (ORCPT ); Tue, 10 Aug 2021 20:18:31 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCD11C06179C for ; Tue, 10 Aug 2021 17:18:07 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id z20so1695195lfd.2 for ; Tue, 10 Aug 2021 17:18:07 -0700 (PDT) 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=KkFE6Z56Mr1EKMwPtDhJ4HsMjjvC1ODc/Bi7DtZL3y4=; b=KjMIw7uHjs9/YFLEilGT6TLdaKipi6iIbPCY43mmgLVcnbQgJph4S5OZ7tmYL0z102 ASyygdAuIVEWbPB+5xylWE8nG874v/uIuTBOPiH+ZvgyoAzHAdmKTrK2t/lqz3aW5zzI k4cK1w/KhthEZqa9FydIVOnNXA1pZBZCfINF19J0oFDF1kQrnvw1TLg3uh1b9xMBXh9m Ok/7PeN9IsfUD8s+QtEEktIB3hafsmo1ZVpoEGxsbh/z6YWAK06ACu+mWkLhcXkgs4Tz y8lGeKym94+EFHQv3ZucB+1rEFd7TQk0B6oWb6EVhOexgOdOAF+dt9jKIuFuKlvSwFWP IjTg== 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=KkFE6Z56Mr1EKMwPtDhJ4HsMjjvC1ODc/Bi7DtZL3y4=; b=Jz8rYw9alWRFY0B8GxmuGVrsL7atQyTKi/Tv4cuFgBxgsm6m/yEcQ02ZUXgB2yqHs2 7jlwRXnKbnFU0QPUw/Q8qZN4k8Gj59d/DMAl0aB1Zxvf4wwAZMWpSAIIlFlR2b9K3PhK Kmd1FWgVSpIs0YV9j/Aok+q2cXtKCVY2CgZnwmnJd5gHFJC5eXrzA4GFafGDpvgy/zic GZfG9uP00hq9OnIV6iU06qWCRNmrmGhiLFps0YhaEhhBCeOS7rOaTNAdb334kY9Bd+BQ dYUSmc6qlRc/cHK6GColz+RP+VmkeuvkLLplARQG8p350wx/Wcbt0YTd1EQABkUCs0Zk rc+A== X-Gm-Message-State: AOAM530XcWOX8iF9qMyxI19yzJKSql300IGjpa46cMU2Cz15Z49SAF9q sitnitkatpNeuTgEJlgQRKvNTw5sIbCjOMHI9upzsQ== X-Received: by 2002:ac2:57cd:: with SMTP id k13mr24099569lfo.117.1628641086038; Tue, 10 Aug 2021 17:18:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Shakeel Butt Date: Tue, 10 Aug 2021 17:17:53 -0700 Message-ID: Subject: Re: [PATCH] mm/slub, kasan: fix checking page_alloc allocations on free To: andrey.konovalov@linux.dev Cc: Andrew Morton , Andrey Konovalov , kasan-dev@googlegroups.com, Linux MM , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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