summaryrefslogtreecommitdiff
path: root/lib/vsprintf.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-09-30 12:48:40 +0100
committerMark Brown <broonie@kernel.org>2026-09-30 12:48:40 +0100
commit3b3fc5d9f44cafc0b9d6536f73691e3abfc9dd59 (patch)
tree8c65ea685fce2b959f21b28b53a460cb9e3ebce4 /lib/vsprintf.c
parentc0c20ac78811bbb321b9f1b1b7ee3c00c847e95d (diff)
parent3fa6f22c1dc835fe1757b06e7d51d8c424ac978a (diff)
downloadlinux-next-3b3fc5d9f44cafc0b9d6536f73691e3abfc9dd59.tar.gz
linux-next-3b3fc5d9f44cafc0b9d6536f73691e3abfc9dd59.zip
Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r--lib/vsprintf.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 1d95ab9314bf..90d0a724eadd 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -762,9 +762,8 @@ static int fill_ptr_key(struct notifier_block *nb, unsigned long action, void *d
{
get_random_bytes(&ptr_key, sizeof(ptr_key));
- /* Pairs with smp_rmb() before reading ptr_key. */
- smp_wmb();
- WRITE_ONCE(filled_random_ptr_key, true);
+ /* Pairs with smp_load_acquire() before reading ptr_key. */
+ smp_store_release(&filled_random_ptr_key, true);
return NOTIFY_DONE;
}
@@ -781,12 +780,10 @@ static inline int __ptr_to_hashval(const void *ptr, unsigned long *hashval_out)
{
unsigned long hashval;
- if (!READ_ONCE(filled_random_ptr_key))
+ /* Pairs with smp_store_release() after writing ptr_key. */
+ if (!smp_load_acquire(&filled_random_ptr_key))
return -EBUSY;
- /* Pairs with smp_wmb() after writing ptr_key. */
- smp_rmb();
-
#ifdef CONFIG_64BIT
hashval = (unsigned long)siphash_1u64((u64)ptr, &ptr_key);
/*