diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-12-23 20:55:54 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-12-23 20:55:54 +0100 |
commit | edb23125fd4a79003012bc619d2c604da922865e (patch) | |
tree | 1f3d86a6f19f89f5abfdc248cebb43a191875248 /fs/pstore/pmsg.c | |
parent | Merge tag 'dma-mapping-2022-12-23' of git://git.infradead.org/users/hch/dma-m... (diff) | |
parent | pstore: Properly assign mem_type property (diff) | |
download | linux-edb23125fd4a79003012bc619d2c604da922865e.tar.xz linux-edb23125fd4a79003012bc619d2c604da922865e.zip |
Merge tag 'pstore-v6.2-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull pstore fixes from Kees Cook:
- Switch pmsg_lock to an rt_mutex to avoid priority inversion (John
Stultz)
- Correctly assign mem_type property (Luca Stefani)
* tag 'pstore-v6.2-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
pstore: Properly assign mem_type property
pstore: Make sure CONFIG_PSTORE_PMSG selects CONFIG_RT_MUTEXES
pstore: Switch pmsg_lock to an rt_mutex to avoid priority inversion
Diffstat (limited to 'fs/pstore/pmsg.c')
-rw-r--r-- | fs/pstore/pmsg.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/pstore/pmsg.c b/fs/pstore/pmsg.c index b31c9c72d90b..ab82e5f05346 100644 --- a/fs/pstore/pmsg.c +++ b/fs/pstore/pmsg.c @@ -7,9 +7,10 @@ #include <linux/device.h> #include <linux/fs.h> #include <linux/uaccess.h> +#include <linux/rtmutex.h> #include "internal.h" -static DEFINE_MUTEX(pmsg_lock); +static DEFINE_RT_MUTEX(pmsg_lock); static ssize_t write_pmsg(struct file *file, const char __user *buf, size_t count, loff_t *ppos) @@ -28,9 +29,9 @@ static ssize_t write_pmsg(struct file *file, const char __user *buf, if (!access_ok(buf, count)) return -EFAULT; - mutex_lock(&pmsg_lock); + rt_mutex_lock(&pmsg_lock); ret = psinfo->write_user(&record, buf); - mutex_unlock(&pmsg_lock); + rt_mutex_unlock(&pmsg_lock); return ret ? ret : count; } |