linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: linke li <lilinke99@qq.com>
Cc: xujianhao01@gmail.com, Thomas Gleixner <tglx@linutronix.de>,
	 Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	 Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,  "H. Peter Anvin" <hpa@zytor.com>,
	linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/efi: mark racy access on efi_rts_work.efi_rts_id
Date: Mon, 29 Apr 2024 17:40:30 +0200	[thread overview]
Message-ID: <CAMj1kXEfdJ9SzPO7NpYwXW3uPGYNOzVFndRswLZb=6TPAgN5TA@mail.gmail.com> (raw)
In-Reply-To: <tencent_E910110547D287B13FEDB6E161D8874E6E06@qq.com>

On Sat, 27 Apr 2024 at 07:28, linke li <lilinke99@qq.com> wrote:
>
> In efi_crash_gracefully_on_page_fault(), efi_rts_work.efi_rts_id can by
> changed by other thread from the comment. Mark possible data race on
> efi_rts_work.efi_rts_id as benign using READ_ONCE.
>
> This patch is aimed at reducing the number of benign races reported by
> KCSAN in order to focus future debugging effort on harmful races.
>
> Signed-off-by: linke li <lilinke99@qq.com>
> ---
>  arch/x86/platform/efi/quirks.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
> index f0cc00032751..4acb81700caf 100644
> --- a/arch/x86/platform/efi/quirks.c
> +++ b/arch/x86/platform/efi/quirks.c
> @@ -751,7 +751,7 @@ void efi_crash_gracefully_on_page_fault(unsigned long phys_addr)
>          * because this case occurs *very* rarely and hence could be improved
>          * on a need by basis.
>          */
> -       if (efi_rts_work.efi_rts_id == EFI_RESET_SYSTEM) {
> +       if (READ_ONCE(efi_rts_work.efi_rts_id) == EFI_RESET_SYSTEM) {
>                 pr_info("efi_reset_system() buggy! Reboot through BIOS\n");
>                 machine_real_restart(MRR_BIOS);
>                 return;

Why is this the only reference that needs an annotation?

  reply	other threads:[~2024-04-29 15:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-27  5:25 [PATCH] x86/efi: mark racy access on efi_rts_work.efi_rts_id linke li
2024-04-29 15:40 ` Ard Biesheuvel [this message]
2024-05-01  2:59   ` linke li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMj1kXEfdJ9SzPO7NpYwXW3uPGYNOzVFndRswLZb=6TPAgN5TA@mail.gmail.com' \
    --to=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=lilinke99@qq.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xujianhao01@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).