From patchwork Tue Jun 20 17:17:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Elver X-Patchwork-Id: 13286232 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9111DEB64D7 for ; Tue, 20 Jun 2023 17:17:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0D76D8D0002; Tue, 20 Jun 2023 13:17:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 05EA78D0001; Tue, 20 Jun 2023 13:17:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E415E8D0002; Tue, 20 Jun 2023 13:17:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D04838D0001 for ; Tue, 20 Jun 2023 13:17:46 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 4B333A047A for ; Tue, 20 Jun 2023 17:17:46 +0000 (UTC) X-FDA: 80923783332.23.8A834CF Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by imf06.hostedemail.com (Postfix) with ESMTP id 1637818000D for ; Tue, 20 Jun 2023 17:17:43 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=BCP+qIWJ; spf=pass (imf06.hostedemail.com: domain of elver@google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=elver@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687281464; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kdF5fJc3RpQKsA1Z6nsArhtDlSIHXXx5950e0HmHoSI=; b=VxfMzXE3Q0sSO1oYGxWRGkGDI1hpxnGXeCxRwBh6POgtsDoo16utNxMPR8fal/KFSLmM39 GDiTSFMEHSYx3p2Wer5/EgnxzEX2K+BXXrw0IzCOKWnh/TkC7YBh4Mg+iVaJES1Tjq0LrD SDsjkXZeQINayDoVLhBwk9GWetogM2s= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687281464; a=rsa-sha256; cv=none; b=LOlZSdQ+Xz5dXQQabHThaelhRm5+Y9XnY+EC+a9uhtnpyLUdNz3UXSIefQ8VsM3TLH7CQC npUFFCJFB6EehSGuIbckwAw/IX69C9UFhjCJQnZRQhZjEH34xO/kV/aJka3ZbdsB0IWFf0 Emz4m8RZn9HydZquAmhFQBgd4c6F8EY= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=BCP+qIWJ; spf=pass (imf06.hostedemail.com: domain of elver@google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=elver@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-3112f2b9625so3314484f8f.1 for ; Tue, 20 Jun 2023 10:17:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687281462; x=1689873462; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=kdF5fJc3RpQKsA1Z6nsArhtDlSIHXXx5950e0HmHoSI=; b=BCP+qIWJFcis7g5pw0oTrdChdSQ2PHL2PHvNLYUt1z7g1FZ3kxPFc2jvshApPKMEfk B3Zr6bpf0EXBZxhGfRWmAHuFl0w3+KH0BFKs3/uV/YQCVihgDTYhZbY0Sd13Q6iZDZvI Bz6grrFI62lVk4Mbja4ssOH7wu8Tkv9b8C9Od5qTfSaaTPMdyAo8nTDdSx7ElIqDOO0y nVgKHnz7iBJAQw3biY1jhZwdJm8WJerNP6q5u6onygBh93tmKnazKnyYneayY5IgmOTU Cw4/3H2ScXKnRIB+Xb/TSEiIPjJ2uKsGGy6wO3vTbxXmzcZWwWdZQZsAY4ROCkNm7YD+ 6yRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687281462; x=1689873462; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kdF5fJc3RpQKsA1Z6nsArhtDlSIHXXx5950e0HmHoSI=; b=IjgDCHoQwCaToeFfAS7pfgz3vQehYIYsUHl3qsU2weLYSHpXbVECWMqK0QJ0bu357v XPGxe5lf5hzlkN7LFINvYMVteeYlyNi/UMnls16xdyKnvjJVlwW41C/+GxLK5xcPyTmh U0rF6tTO2HVk48VWtU0/HQFVvAjcNUrLaX4DdgWAAnIczY0qIJJxh4FOnEcd/KEAcySt HRLQco+/+3NBIdVI+aFQtP7zvgBSgbB9E1uCDh8yPLXo7BQ+sw/m9A5q98k5Rw4M6qtv V0T9pP75XtU0DHTI4ZMGguO3qAW6YbpZFuOmq2XlYSo5gvSYTx7l/+zeO2/63o0CUX32 j8Qg== X-Gm-Message-State: AC+VfDxOj16iWpkn3EuChAJQ90Cc1+2msmmHYRdgY9uzOqf7wDcPOcui jhDTfZa0T2JlF/4oTtbVfNa/sg== X-Google-Smtp-Source: ACHHUZ5Cbn9oh78M9g89VcoH3bD7gPz8OkjEvkSJEUejoWV5ErLmGgx4cFnTaCqES1AsIJeVmtr5Ag== X-Received: by 2002:adf:ea8d:0:b0:311:1b8d:e566 with SMTP id s13-20020adfea8d000000b003111b8de566mr10135149wrm.52.1687281462168; Tue, 20 Jun 2023 10:17:42 -0700 (PDT) Received: from elver.google.com ([2a00:79e0:9c:201:8530:a6a3:373f:683c]) by smtp.gmail.com with ESMTPSA id y10-20020adfe6ca000000b0030fd23381ffsm2469591wrm.11.2023.06.20.10.17.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 10:17:41 -0700 (PDT) Date: Tue, 20 Jun 2023 19:17:35 +0200 From: Marco Elver To: Andrey Konovalov Cc: Andrew Morton , Alexander Potapenko , Dmitry Vyukov , Taras Madan , Aleksandr Nogikh , Andrey Ryabinin , Vincenzo Frascino , Jonathan Corbet , kasan-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Catalin Marinas Subject: [PATCH] kasan, doc: note kasan.fault=panic_on_write behaviour for async modes Message-ID: References: <20230614095158.1133673-1-elver@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.9 (2022-11-12) X-Rspamd-Queue-Id: 1637818000D X-Rspam-User: X-Stat-Signature: 8yn9m8u6qckntqujt7yc4p8thsrcs4yj X-Rspamd-Server: rspam03 X-HE-Tag: 1687281463-512839 X-HE-Meta: U2FsdGVkX1/W3pg3wUnQJCim0XySIXyTF8tbJDNm0gpJwvWQ/iJnZtgH9myVlsFihHZWpupJX0LBh+7LfnJnEtnuGVIkOEeYFq6hkxHX3Erl3O64jvMG9GomuoWaCshvvXKzHVZhgjas8B/c1j197N93TTvnM5sCwkF71FMrask2Ao5IcEz0awCoixW0lcHQnSUhUGkfdnHMICTcWjc6LBngbBS5nmZKpxfaWIMKsXoW73AERMR+12K1TPxsOx7zEKnjR1lGs5dBxNRODlFAZ/Q6kzhJ0vlwwNb08yIWVzFqtqV3xxwEye4asU+7Z1frnuzAQSdmWA/zr6ucODjm1kgjCXlAyKsNyX8mVNM6QhiwU5bJV2paX1i7FGnp1d6CJB8v8D72XdI/bFOht94ZGOV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XhaMjBTLjs7XU1eBmcEHY+nh+sdQwg= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Note the behaviour of kasan.fault=panic_on_write for async modes, since all asynchronous faults will result in panic (even if they are reads). Fixes: 452c03fdbed0 ("kasan: add support for kasan.fault=panic_on_write") Signed-off-by: Marco Elver Reviewed-by: Andrey Konovalov --- Documentation/dev-tools/kasan.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst index 7f37a46af574..f4acf9c2e90f 100644 --- a/Documentation/dev-tools/kasan.rst +++ b/Documentation/dev-tools/kasan.rst @@ -110,7 +110,9 @@ parameter can be used to control panic and reporting behaviour: - ``kasan.fault=report``, ``=panic``, or ``=panic_on_write`` controls whether to only print a KASAN report, panic the kernel, or panic the kernel on invalid writes only (default: ``report``). The panic happens even if - ``kasan_multi_shot`` is enabled. + ``kasan_multi_shot`` is enabled. Note that when using asynchronous mode of + Hardware Tag-Based KASAN, ``kasan.fault=panic_on_write`` always panics on + asynchronously checked accesses (including reads). Software and Hardware Tag-Based KASAN modes (see the section about various modes below) support altering stack trace collection behavior: