mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 00:20:51 +07:00
efivarfs: Don't return -EINTR when rate-limiting reads
Applications that read EFI variables may see a return value of -EINTR if they exceed the rate limit and a signal delivery is attempted while the process is sleeping. This is quite surprising to the application, which probably doesn't have code to handle it. Change the interruptible sleep to a non-interruptible one. Reported-by: Lennart Poettering <mzxreary@0pointer.de> Signed-off-by: Tony Luck <tony.luck@intel.com> Link: https://lore.kernel.org/r/20200528194905.690-3-tony.luck@intel.com Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
parent
2096721f15
commit
4353f03317
@ -73,10 +73,8 @@ static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf,
|
||||
ssize_t size = 0;
|
||||
int err;
|
||||
|
||||
while (!__ratelimit(&file->f_cred->user->ratelimit)) {
|
||||
if (!msleep_interruptible(50))
|
||||
return -EINTR;
|
||||
}
|
||||
while (!__ratelimit(&file->f_cred->user->ratelimit))
|
||||
msleep(50);
|
||||
|
||||
err = efivar_entry_size(var, &datasize);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user