diff options
author | Tony Luck <[email protected]> | 2020-05-28 12:49:05 -0700 |
---|---|---|
committer | Ard Biesheuvel <[email protected]> | 2020-06-15 14:38:56 +0200 |
commit | 4353f03317fd3eb0bd803b61bdb287b68736a728 (patch) | |
tree | f42a3901f5c168a091da25d3ad82f8584be2d36f | |
parent | 2096721f1577b51b574fa06a7d91823dffe7267a (diff) |
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 <[email protected]>
Signed-off-by: Tony Luck <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ard Biesheuvel <[email protected]>
-rw-r--r-- | fs/efivarfs/file.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/efivarfs/file.c b/fs/efivarfs/file.c index 4b8bc4560d70..feaa5e182b7b 100644 --- a/fs/efivarfs/file.c +++ b/fs/efivarfs/file.c @@ -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); |