Skip to content

Commit 4353f03

Browse files
aeglardbiesheuvel
authored andcommitted
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]>
1 parent 2096721 commit 4353f03

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

fs/efivarfs/file.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,8 @@ static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf,
7373
ssize_t size = 0;
7474
int err;
7575

76-
while (!__ratelimit(&file->f_cred->user->ratelimit)) {
77-
if (!msleep_interruptible(50))
78-
return -EINTR;
79-
}
76+
while (!__ratelimit(&file->f_cred->user->ratelimit))
77+
msleep(50);
8078

8179
err = efivar_entry_size(var, &datasize);
8280

0 commit comments

Comments
 (0)