Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp64013rdh; Wed, 22 Nov 2023 18:32:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IEvMI1o67AQLlHOu9EVg8Wwhw3V0XTiatuCeguWzmj4lT0K8cuy+N4HIgeEJFqhsJOXb1pb X-Received: by 2002:a05:6808:20a9:b0:3ae:126b:8bfc with SMTP id s41-20020a05680820a900b003ae126b8bfcmr6005712oiw.4.1700706757995; Wed, 22 Nov 2023 18:32:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700706757; cv=none; d=google.com; s=arc-20160816; b=EWpjiFibIaD7505oOL5Dv7okseLvD7L2H7h167C59o7d4mpcasrw2KS24Qv6iXRRCj gd4okhGzWJGg4UzfbvTmE64AvIH4ZOGq+zURQEIYTxCkUiZclIZgFy/FByg6RebkC5My 3zAGEoU4RZDsm6FMiKyo451i+K4sk+LFco/xU/csgyrvuvnOmx1ap8x81zonnQgI84Vw y/lDxMP9Z0NIbNiqJlHYoTqPHqHP046CxCMEDzTQRQryb/0tjGuOGAT+MZol+YVODFKo 3D8GusPVaEPOhAg6eFXnxEDjHhP1mTD4bhRFPpik8R7qfIGBiK/ur/EKRUoI6t1l4lLU nl/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=U7iDnp8t+KdyeiUT7D88qTOqMxvRmmiP2r4q7q2VrCw=; fh=DMpuiuGddKAd9gJK1ZWZ3xeGsMHnmViVLNra/uemh1o=; b=AFok4qxlR38demg2vPH+d0HCC/7idmeD21+VPEUL+8aHxMq5nFk7H5xQKQLkJI4CoC GZE223O1sBQFxgblQtx2O1NRRAaJo8agyf1sEZLGsudjEnri2ct4UbLtjdCEYUEJZKQk 59cv2VCeWL1SBP8VRZzDHtEd0cLLPlBkc+lAGiTzG0NRZAgr2WH2E5qCeXeBfO7BrbsK 6kOq/RwcQJL5Ptm1oTnpY5LcJCkmq9EQCIg/UKiapYg2fAtwMJ1FTYjiKo8sy5+NUMOF WObfvOh8g28T4d+DjZ+8xwarhhZiI3zf7DQnlq+vTznRl4zfrzcUH6y9wY9YclGuFW1N 6+vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="m6oRr/as"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id ca18-20020a056a02069200b005b99eb9ea1dsi401076pgb.441.2023.11.22.18.32.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 18:32:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="m6oRr/as"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id CA2E68067E24; Wed, 22 Nov 2023 18:31:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344097AbjKWCbI (ORCPT + 99 others); Wed, 22 Nov 2023 21:31:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344116AbjKWCbG (ORCPT ); Wed, 22 Nov 2023 21:31:06 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B070DA for ; Wed, 22 Nov 2023 18:31:02 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-27ff83feb29so382534a91.3 for ; Wed, 22 Nov 2023 18:31:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700706661; x=1701311461; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=U7iDnp8t+KdyeiUT7D88qTOqMxvRmmiP2r4q7q2VrCw=; b=m6oRr/ashOEGHxXSBYmK8cuDJfLqU1gwdiI4l++ERA9V/qRFW/RUUHRfnao1/iWRig 0eSNo0H91+yAY3DyFGYbKh1tS3pCOyEzdR0h3D3KCiUfiqYmcD1aqgbwqKi8rookcZP1 p4U5kwuM2He+Qh7YIxs03h+SkOS7I1gVUt5MqeJqJHrJ/S/LV8EtWsJmQlSAPksaNGTd bf8nF/hxEhg/ElUuwcFVxshvce5+YZx1G9UrRVrn5oxGWlLYMgNOA+rjKEyGzJj0Q/zg ZmnPhZoMS3LYDVHtNj3VYK+hhgzjln4LdnbA794xdBxPgp7UpacwhlhLHce0jD3JoSjL MOVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700706661; x=1701311461; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U7iDnp8t+KdyeiUT7D88qTOqMxvRmmiP2r4q7q2VrCw=; b=KWRg6I2WO6DHok87GOllBY/nBTzu/22hBOwA0NrerVrUlpjeyJx6nmGH+EhIqX1/GG PpyvcjrMcjKWydSTYn256Y+gSTe1jSvZQTQYeo7RhguxbrKTG33T/fxkhEEZ0AZ0fS3S pTkgsUGwolNB7qo2Rqj0y1Xvj808+5AqCSjQdId5eK0DaRb+Q4VYk+G1CGhYM79fZStb JeL6rC1LsHtaSO/lHhyrKNulXn53e0qMrjoWN0bRZmO0W9umFkkqh6rcPixIpLCPgqSy D1dgHIAx/n+eY2L9+R40nKA82eM1ofwJ6XHfbyFxQEIXIyGKv+np2qTwrF+fgkHlFefx uPdg== X-Gm-Message-State: AOJu0YyrfUK4KGMOQVqPY7BmhKSq8HSj9ctu3veNHKc0CeWdAs19X+um OPyTCDSz9hFrJtOBaB2nXknj4JgyCRPIg5aLA6o= X-Received: by 2002:a17:90b:4d05:b0:280:c0:9d3f with SMTP id mw5-20020a17090b4d0500b0028000c09d3fmr4312829pjb.34.1700706661646; Wed, 22 Nov 2023 18:31:01 -0800 (PST) MIME-Version: 1.0 References: <20231122231202.121277-1-andrey.konovalov@linux.dev> In-Reply-To: From: Andrey Konovalov Date: Thu, 23 Nov 2023 03:30:50 +0100 Message-ID: Subject: Re: [PATCH mm] slub, kasan: improve interaction of KASAN and slub_debug poisoning To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: andrey.konovalov@linux.dev, Andrew Morton , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Vlastimil Babka , kasan-dev@googlegroups.com, Evgenii Stepanov , Oscar Salvador , Feng Tang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 22 Nov 2023 18:31:28 -0800 (PST) On Thu, Nov 23, 2023 at 1:39=E2=80=AFAM Hyeonggon Yoo <42.hyeyoo@gmail.com>= wrote: > > On Thu, Nov 23, 2023 at 8:12=E2=80=AFAM wrot= e: > > > > From: Andrey Konovalov > > > > When both KASAN and slub_debug are enabled, when a free object is being > > prepared in setup_object, slub_debug poisons the object data before KAS= AN > > initializes its per-object metadata. > > > > Right now, in setup_object, KASAN only initializes the alloc metadata, > > which is always stored outside of the object. slub_debug is aware of > > this and it skips poisoning and checking that memory area. > > > > However, with the following patch in this series, KASAN also starts > > initializing its free medata in setup_object. As this metadata might be > > stored within the object, this initialization might overwrite the > > slub_debug poisoning. This leads to slub_debug reports. > > > > Thus, skip checking slub_debug poisoning of the object data area that > > overlaps with the in-object KASAN free metadata. > > > > Also make slub_debug poisoning of tail kmalloc redzones more precise wh= en > > KASAN is enabled: slub_debug can still poison and check the tail kmallo= c > > allocation area that comes after the KASAN free metadata. > > > > Signed-off-by: Andrey Konovalov > > Thank you for looking at this quickly! > Unfortunately the problem isn't fixed yet with the patch. > > I applied this on top of linux-next and built a kernel with the same conf= ig, > it is still stuck at boot. Ah, this is caused by a buggy version of "kasan: improve free meta storage in Generic KASAN", which made its way into linux-next. Reverting that patch should fix the issue. My patch that you bisected to exposes the buggy behavior. Thanks!