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=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=ham 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 31125C433E0 for ; Fri, 15 Jan 2021 14:11:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D710423772 for ; Fri, 15 Jan 2021 14:11:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D710423772 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1CAFB8D017E; Fri, 15 Jan 2021 09:11:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1544B8D0162; Fri, 15 Jan 2021 09:11:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 01C7F8D017E; Fri, 15 Jan 2021 09:11:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0185.hostedemail.com [216.40.44.185]) by kanga.kvack.org (Postfix) with ESMTP id DC5558D0162 for ; Fri, 15 Jan 2021 09:11:53 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9E58C181AF5C6 for ; Fri, 15 Jan 2021 14:11:53 +0000 (UTC) X-FDA: 77708198106.15.noise06_53160612752f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 695F41814B0F3 for ; Fri, 15 Jan 2021 14:11:53 +0000 (UTC) X-HE-Tag: noise06_53160612752f X-Filterd-Recvd-Size: 3990 Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Fri, 15 Jan 2021 14:11:52 +0000 (UTC) Received: by mail-qt1-f181.google.com with SMTP id c14so6060590qtn.0 for ; Fri, 15 Jan 2021 06:11:52 -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=2gEonePWvzu8OtY+gNiF+A5sU1b7iiv5oXrRT2xFrUA=; b=EZ8VlQWZsvspepqQrNYbFkiG3YeAjO4Uky3v0HA2bfDqp1HNIQbb0/eIQYAl+u7mx0 SwImgqTlH86h3NBIK3+/8iSnJDsJvtxcnbv0dGPyZ7pwCXvHqBbagaL/H2XEsVLoLur+ fNymgaYne9X+U8clgfNxyHK0kKhrmwSt80lec+D2m6bRRq0tOg7xq0ItCZOBahwGKpTN K5bNm6yTE6XDaerJSwpqLGL/sNE2ll3aBN4Z2mjIStZGtHET4nz7tsQ1dwLfdxFgGAby MYMZQZpTz8K4MmRSrX+WezyiEYJ4QHHxICs9L6Apk65Htw2HfleBSXmzAEKPDMOwRy93 AqIA== 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=2gEonePWvzu8OtY+gNiF+A5sU1b7iiv5oXrRT2xFrUA=; b=bEMOnCeLIDxUGmhpX8d0oLmvSZjixLomKYjgWPxv4gt2F84LJ01J5hM8LkoCwYIy/J pCYoguZ/+8Vvc2aYFpvEnbL4RpIG8YQ5mPOoHHqPCafeC08fvbsM1w7WWzUWXyU3nYpd C8Gs7SIAjsxaGhi4O5Y9C5U77LLbXSlbTHm5n7InjIPhRVTGbcVaEWvqOX9pZAS56Bmz wLsr686gyhi54COgd/6XTey4s2AaGLtWxr0+HNuZ6169mJ3ABINzN1eG33WOGQnzWXQa G1WFhQQCuRqZYQ5JggRvARH5EpmfgRv+D0oPhPtxVLYZzuDgQnL4xIEFT7WPyEW3Koz7 bUrQ== X-Gm-Message-State: AOAM532+s2Y+BHM3FxRyVum9E86E3N3Vu4aaS3cMSGplM96S00kYB2nH mJJ4Vb4ki0Zh88SiosPa9PnKJHQvJxRyz34gb9fjvw== X-Google-Smtp-Source: ABdhPJyxSI1F6HClbjvqLLR+s+hldMswtShzI/Y9lPCG/P3ZkcnV9ds5+hNrIdXazySsXeUPjd5DysBvJDnZH7aHH/8= X-Received: by 2002:ac8:6f32:: with SMTP id i18mr11814637qtv.175.1610719911742; Fri, 15 Jan 2021 06:11:51 -0800 (PST) MIME-Version: 1.0 References: <73283ddcceed173966041f9ce1734f50ea3e9a41.1610652890.git.andreyknvl@google.com> In-Reply-To: <73283ddcceed173966041f9ce1734f50ea3e9a41.1610652890.git.andreyknvl@google.com> From: Alexander Potapenko Date: Fri, 15 Jan 2021 15:11:40 +0100 Message-ID: Subject: Re: [PATCH v3 08/15] kasan: add compiler barriers to KUNIT_EXPECT_KASAN_FAIL To: Andrey Konovalov Cc: Andrew Morton , Catalin Marinas , Vincenzo Frascino , Dmitry Vyukov , Marco Elver , Will Deacon , Andrey Ryabinin , Peter Collingbourne , Evgenii Stepanov , Branislav Rankov , Kevin Brodsky , kasan-dev , Linux ARM , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" 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: On Thu, Jan 14, 2021 at 8:36 PM Andrey Konovalov wrote: > > It might not be obvious to the compiler that the expression must be > executed between writing and reading to fail_data. In this case, the > compiler might reorder or optimize away some of the accesses, and > the tests will fail. > > Add compiler barriers around the expression in KUNIT_EXPECT_KASAN_FAIL > and use READ/WRITE_ONCE() for accessing fail_data fields. > > Link: https://linux-review.googlesource.com/id/I046079f48641a1d36fe627fc8827a9249102fd50 > Reviewed-by: Marco Elver > Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko