From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDE63C4332E for ; Tue, 2 Mar 2021 10:01:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BBF7264F12 for ; Tue, 2 Mar 2021 10:01:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1577720AbhCBJwQ (ORCPT ); Tue, 2 Mar 2021 04:52:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1838186AbhCBJbF (ORCPT ); Tue, 2 Mar 2021 04:31:05 -0500 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 679D3C061788 for ; Tue, 2 Mar 2021 01:21:15 -0800 (PST) Received: by mail-qv1-xf2d.google.com with SMTP id r5so9510576qvv.9 for ; Tue, 02 Mar 2021 01:21:15 -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=vwRL+zg0sY1QI/aDS9tQBo/9/k6q6jsJr21NnguWVBI=; b=Gdg7LlV9KTMCHNPEerej0NoU4fufDpYllG9eP8gSI0Y59DAync1sFK8G8dRPBqhLcu n/Neic57sVkPsdrKtFEWL/DhdlMG8bIvqFPb/Oto0y7wA6Np/nFdBehh/7/2WYXiaW9/ PUWgCXdI893sti3BPKa0u3WEivJzBWOBz65gJ0cHl8Tqq/anY/kXvtaJXHeB/ONDKDDF tpfnKWPZV55J8diU/JQpIkQXORqbpEFuAd5qWqJJw0StaGBcrmHdOv/lI7AYDkYorFuM 3rP9xZ98HT3e3b1BVG+gRYRqxVBvHJAQfO9xHKnpx+YGSUudDn9U2OZaIyGaCusWpVZI vIbg== 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=vwRL+zg0sY1QI/aDS9tQBo/9/k6q6jsJr21NnguWVBI=; b=bqKVoP5sqBhdI6NDQO2wbIy2qXzdroJZA7xuHPjFPo4ILgH1e8iihNAp4fjUa3TvtN sYg2cI0nL8Z+2w5eoGl5KCVO4Tb+K9DnacUHuSH72YEHmDl/kW/HCuAXkO0aqPuKF26D i8sPuzvmzyFww6OyEP+NLCbkQDVVrwBcenzRd1yxwNQVUfReum6QomwWFB0Sh2djuFBz xbrO9WuAgpIhkkBllZK3DzwffXcbOuaW2eblPNcDN3WZWm2B0OUmicZtODYbVlZK9kKw u+sYaEMFxcVvjxpDl1KQyM9JH6zqRb2m5/vXF+HFkt4BG6PFyWZLEOQfmmyhA0v3czkL KiEw== X-Gm-Message-State: AOAM5323jxY3xBAC6rnowDb+L52fuw8zmoTdcoun2V7ci2Tk5zXlm3Xt WQYPxEOA56Am1d9r/cPO8zYrXaJQfNFhujVdxUUL5w== X-Google-Smtp-Source: ABdhPJyHK6+xXF6lJrMdstX68u8D/GfsYLqjaCK/7e5wYKfaW5WYj/VJmdv8pUTr7VMur6NN61/WYCIvcECXjtHKruw= X-Received: by 2002:a0c:9a04:: with SMTP id p4mr2656029qvd.38.1614676874297; Tue, 02 Mar 2021 01:21:14 -0800 (PST) MIME-Version: 1.0 References: <51c397a23631d8bb2e2a6515c63440d88bf74afd.1614674144.git.christophe.leroy@csgroup.eu> In-Reply-To: From: Alexander Potapenko Date: Tue, 2 Mar 2021 10:21:02 +0100 Message-ID: Subject: Re: [RFC PATCH v1] powerpc: Enable KFENCE for PPC32 To: Christophe Leroy Cc: Marco Elver , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Dmitry Vyukov , LKML , linuxppc-dev@lists.ozlabs.org, kasan-dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > [ 14.998426] BUG: KFENCE: invalid read in finish_task_switch.isra.0+0x54/0x23c > [ 14.998426] > [ 15.007061] Invalid read at 0x(ptrval): > [ 15.010906] finish_task_switch.isra.0+0x54/0x23c > [ 15.015633] kunit_try_run_case+0x5c/0xd0 > [ 15.019682] kunit_generic_run_threadfn_adapter+0x24/0x30 > [ 15.025099] kthread+0x15c/0x174 > [ 15.028359] ret_from_kernel_thread+0x14/0x1c > [ 15.032747] > [ 15.034251] CPU: 0 PID: 111 Comm: kunit_try_catch Tainted: G B > 5.12.0-rc1-s3k-dev-01534-g4f14ae75edf0-dirty #4674 > [ 15.045811] ================================================================== > [ 15.053324] # test_invalid_access: EXPECTATION FAILED at mm/kfence/kfence_test.c:636 > [ 15.053324] Expected report_matches(&expect) to be true, but is false > [ 15.068359] not ok 21 - test_invalid_access The test expects the function name to be test_invalid_access, i. e. the first line should be "BUG: KFENCE: invalid read in test_invalid_access". The error reporting function unwinds the stack, skips a couple of "uninteresting" frames (https://elixir.bootlin.com/linux/v5.12-rc1/source/mm/kfence/report.c#L43) and uses the first "interesting" one frame to print the report header (https://elixir.bootlin.com/linux/v5.12-rc1/source/mm/kfence/report.c#L226). It's strange that test_invalid_access is missing altogether from the stack trace - is that expected? Can you try printing the whole stacktrace without skipping any frames to see if that function is there? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73613C433E6 for ; Tue, 2 Mar 2021 09:35:34 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 98606614A7 for ; Tue, 2 Mar 2021 09:35:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98606614A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4DqX6q5bmWz3cM5 for ; Tue, 2 Mar 2021 20:35:31 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=Gdg7LlV9; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=google.com (client-ip=2607:f8b0:4864:20::f2c; helo=mail-qv1-xf2c.google.com; envelope-from=glider@google.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=Gdg7LlV9; dkim-atps=neutral Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4DqWpS4hKjz30Mb for ; Tue, 2 Mar 2021 20:21:18 +1100 (AEDT) Received: by mail-qv1-xf2c.google.com with SMTP id gi9so9567053qvb.10 for ; Tue, 02 Mar 2021 01:21:17 -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=vwRL+zg0sY1QI/aDS9tQBo/9/k6q6jsJr21NnguWVBI=; b=Gdg7LlV9KTMCHNPEerej0NoU4fufDpYllG9eP8gSI0Y59DAync1sFK8G8dRPBqhLcu n/Neic57sVkPsdrKtFEWL/DhdlMG8bIvqFPb/Oto0y7wA6Np/nFdBehh/7/2WYXiaW9/ PUWgCXdI893sti3BPKa0u3WEivJzBWOBz65gJ0cHl8Tqq/anY/kXvtaJXHeB/ONDKDDF tpfnKWPZV55J8diU/JQpIkQXORqbpEFuAd5qWqJJw0StaGBcrmHdOv/lI7AYDkYorFuM 3rP9xZ98HT3e3b1BVG+gRYRqxVBvHJAQfO9xHKnpx+YGSUudDn9U2OZaIyGaCusWpVZI vIbg== 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=vwRL+zg0sY1QI/aDS9tQBo/9/k6q6jsJr21NnguWVBI=; b=f4AC0grBfnOQ3t/wTQLNSDASCpa52sxpDFFFRuzcFQ8SuIU99eA20mHWLQyGyKXqiM SX3yQJONCGKeezdzWX6RYJ9u+MqeDd1+exU+PA5I9h9yNwSzE0Uovx+nMBL+qK/c5YyN U/aJI4tymaW+//MjEpdXEerVxuMSvQLfxivSaWw6i9vKMZSLXsxpVaSbXvG6HYJh+RUo 1Pd2CY1q0ZyZdnJzMCvyamI5HTqubM6Rb2zObbtDQMifzUjVdqIAlYm2vSJeWX6wGkeq dElfWIYodLOjdI8M7iQV318KJXUPmN7KGqpLpcIMW1ebTeMsxEIxq+H/phWQuZN4+Znn lB0w== X-Gm-Message-State: AOAM5321RtJjwdEa3aZDqnXcRLHA/D0zGJWkvZhVR+XXUIIxZPR2T5iS wVN/teql2QpiOlqPcYqPaIN7etEXJtdw36M4p9g/qg== X-Google-Smtp-Source: ABdhPJyHK6+xXF6lJrMdstX68u8D/GfsYLqjaCK/7e5wYKfaW5WYj/VJmdv8pUTr7VMur6NN61/WYCIvcECXjtHKruw= X-Received: by 2002:a0c:9a04:: with SMTP id p4mr2656029qvd.38.1614676874297; Tue, 02 Mar 2021 01:21:14 -0800 (PST) MIME-Version: 1.0 References: <51c397a23631d8bb2e2a6515c63440d88bf74afd.1614674144.git.christophe.leroy@csgroup.eu> In-Reply-To: From: Alexander Potapenko Date: Tue, 2 Mar 2021 10:21:02 +0100 Message-ID: Subject: Re: [RFC PATCH v1] powerpc: Enable KFENCE for PPC32 To: Christophe Leroy Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Tue, 02 Mar 2021 20:35:08 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marco Elver , LKML , kasan-dev , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, Dmitry Vyukov Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" > [ 14.998426] BUG: KFENCE: invalid read in finish_task_switch.isra.0+0x54/0x23c > [ 14.998426] > [ 15.007061] Invalid read at 0x(ptrval): > [ 15.010906] finish_task_switch.isra.0+0x54/0x23c > [ 15.015633] kunit_try_run_case+0x5c/0xd0 > [ 15.019682] kunit_generic_run_threadfn_adapter+0x24/0x30 > [ 15.025099] kthread+0x15c/0x174 > [ 15.028359] ret_from_kernel_thread+0x14/0x1c > [ 15.032747] > [ 15.034251] CPU: 0 PID: 111 Comm: kunit_try_catch Tainted: G B > 5.12.0-rc1-s3k-dev-01534-g4f14ae75edf0-dirty #4674 > [ 15.045811] ================================================================== > [ 15.053324] # test_invalid_access: EXPECTATION FAILED at mm/kfence/kfence_test.c:636 > [ 15.053324] Expected report_matches(&expect) to be true, but is false > [ 15.068359] not ok 21 - test_invalid_access The test expects the function name to be test_invalid_access, i. e. the first line should be "BUG: KFENCE: invalid read in test_invalid_access". The error reporting function unwinds the stack, skips a couple of "uninteresting" frames (https://elixir.bootlin.com/linux/v5.12-rc1/source/mm/kfence/report.c#L43) and uses the first "interesting" one frame to print the report header (https://elixir.bootlin.com/linux/v5.12-rc1/source/mm/kfence/report.c#L226). It's strange that test_invalid_access is missing altogether from the stack trace - is that expected? Can you try printing the whole stacktrace without skipping any frames to see if that function is there?