Re: [PATCH v2] fscrypt: avoid data race on fscrypt_mode::logged_impl_name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: linux-fscrypt@xxxxxxxxxxxxxxx
- Subject: Re: [PATCH v2] fscrypt: avoid data race on fscrypt_mode::logged_impl_name
- From: Eric Biggers <ebiggers@xxxxxxxxxx>
- Date: Wed, 6 Nov 2019 13:02:05 -0800
- In-reply-to: <20191021204903.56528-1-ebiggers@kernel.org>
- Mail-followup-to: linux-fscrypt@xxxxxxxxxxxxxxx, "Theodore Y . Ts'o" <tytso@xxxxxxx>, Jaegeuk Kim <jaegeuk@xxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx
- References: <20191021204903.56528-1-ebiggers@kernel.org>
- User-agent: Mutt/1.10.1 (2018-07-13)
On Mon, Oct 21, 2019 at 01:49:03PM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@xxxxxxxxxx>
>
> The access to logged_impl_name is technically a data race, which tools
> like KCSAN could complain about in the future. See:
> https://github.com/google/ktsan/wiki/READ_ONCE-and-WRITE_ONCE
>
> Fix by using xchg(), which also ensures that only one thread does the
> logging.
>
> This also required switching from bool to int, to avoid a build error on
> the RISC-V architecture which doesn't implement xchg on bytes.
>
> Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
Applied to fscrypt.git#master for 5.5.
- Eric
[Index of Archives]
[linux Cryptography]
[Asterisk App Development]
[PJ SIP]
[Gnu Gatekeeper]
[IETF Sipping]
[Info Cyrus]
[ALSA User]
[Fedora Linux Users]
[Linux SCTP]
[DCCP]
[Gimp]
[Yosemite News]
[Deep Creek Hot Springs]
[Yosemite Campsites]
[ISDN Cause Codes]