The following commit has been merged into the efi/urgent branch of tip:
Commit-ID: d6c066fda90d578aacdf19771a027ed484a79825 Gitweb: https://git.kernel.org/tip/d6c066fda90d578aacdf19771a027ed484a79825 Author: Vladis Dronov vdronov@redhat.com AuthorDate: Sun, 08 Mar 2020 09:08:55 +01:00 Committer: Ingo Molnar mingo@kernel.org CommitterDate: Sun, 08 Mar 2020 09:56:48 +01:00
efi: Add a sanity check to efivar_store_raw()
Add a sanity check to efivar_store_raw() the same way efivar_{attr,size,data}_read() and efivar_show_raw() have it.
Signed-off-by: Vladis Dronov vdronov@redhat.com Signed-off-by: Ard Biesheuvel ardb@kernel.org Signed-off-by: Ingo Molnar mingo@kernel.org Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200305084041.24053-3-vdronov@redhat.com Link: https://lore.kernel.org/r/20200308080859.21568-25-ardb@kernel.org --- drivers/firmware/efi/efivars.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/firmware/efi/efivars.c b/drivers/firmware/efi/efivars.c index 69f13bc..aff3dfb 100644 --- a/drivers/firmware/efi/efivars.c +++ b/drivers/firmware/efi/efivars.c @@ -208,6 +208,9 @@ efivar_store_raw(struct efivar_entry *entry, const char *buf, size_t count) u8 *data; int err;
+ if (!entry || !buf) + return -EINVAL; + if (in_compat_syscall()) { struct compat_efi_variable *compat;
Hi
[This is an automated email]
This commit has been processed because it contains a -stable tag. The stable tag indicates that it's relevant for the following trees: all
The bot has tested the following trees: v5.5.8, v5.4.24, v4.19.108, v4.14.172, v4.9.215, v4.4.215.
v5.5.8: Build OK! v5.4.24: Build OK! v4.19.108: Failed to apply! Possible dependencies: 98f76206b335 ("compat: Cleanup in_compat_syscall() callers")
v4.14.172: Failed to apply! Possible dependencies: 98f76206b335 ("compat: Cleanup in_compat_syscall() callers") ea2ce8f3514e ("time: Fix get_timespec64() for y2038 safe compat interfaces")
v4.9.215: Failed to apply! Possible dependencies: 31ea70e0308b ("posix-timers: Move the do_schedule_next_timer declaration") 96fe3b072f13 ("posix-timers: Rename do_schedule_next_timer") 98f76206b335 ("compat: Cleanup in_compat_syscall() callers") d5b7ffbfbdac ("time: introduce {get,put}_itimerspec64") ea2ce8f3514e ("time: Fix get_timespec64() for y2038 safe compat interfaces") f59dd9c886ac ("time: add get_timespec64 and put_timespec64")
v4.4.215: Failed to apply! Possible dependencies: 2bf8c4762659 ("net/xfrm_user: use in_compat_syscall to deny compat syscalls") 31ea70e0308b ("posix-timers: Move the do_schedule_next_timer declaration") 4f01ed221e2e ("drivers/firmware/efi/efivars.c: use in_compat_syscall() to check for compat callers") 96fe3b072f13 ("posix-timers: Rename do_schedule_next_timer") 98f76206b335 ("compat: Cleanup in_compat_syscall() callers") bc2c53e5f1a2 ("time: add missing implementation for timespec64_add_safe()") d5b7ffbfbdac ("time: introduce {get,put}_itimerspec64") ea2ce8f3514e ("time: Fix get_timespec64() for y2038 safe compat interfaces") f59dd9c886ac ("time: add get_timespec64 and put_timespec64")
NOTE: The patch will not be queued to stable trees until it is upstream.
How should we proceed with this patch?
Hello,
----- Original Message -----
From: "Sasha Levin" sashal@kernel.org Subject: Re: [tip: efi/urgent] efi: Add a sanity check to efivar_store_raw()
Hi
[This is an automated email]
This commit has been processed because it contains a -stable tag. The stable tag indicates that it's relevant for the following trees: all
The bot has tested the following trees: v5.5.8, v5.4.24, v4.19.108, v4.14.172, v4.9.215, v4.4.215.
v5.5.8: Build OK! v5.4.24: Build OK! v4.19.108: Failed to apply! Possible dependencies: 98f76206b335 ("compat: Cleanup in_compat_syscall() callers")
v4.14.172: Failed to apply! Possible dependencies: 98f76206b335 ("compat: Cleanup in_compat_syscall() callers") ea2ce8f3514e ("time: Fix get_timespec64() for y2038 safe compat interfaces")
v4.9.215: Failed to apply! Possible dependencies: 31ea70e0308b ("posix-timers: Move the do_schedule_next_timer declaration") 96fe3b072f13 ("posix-timers: Rename do_schedule_next_timer") 98f76206b335 ("compat: Cleanup in_compat_syscall() callers") d5b7ffbfbdac ("time: introduce {get,put}_itimerspec64") ea2ce8f3514e ("time: Fix get_timespec64() for y2038 safe compat interfaces") f59dd9c886ac ("time: add get_timespec64 and put_timespec64")
v4.4.215: Failed to apply! Possible dependencies: 2bf8c4762659 ("net/xfrm_user: use in_compat_syscall to deny compat syscalls") 31ea70e0308b ("posix-timers: Move the do_schedule_next_timer declaration") 4f01ed221e2e ("drivers/firmware/efi/efivars.c: use in_compat_syscall() to check for compat callers") 96fe3b072f13 ("posix-timers: Rename do_schedule_next_timer") 98f76206b335 ("compat: Cleanup in_compat_syscall() callers") bc2c53e5f1a2 ("time: add missing implementation for timespec64_add_safe()") d5b7ffbfbdac ("time: introduce {get,put}_itimerspec64") ea2ce8f3514e ("time: Fix get_timespec64() for y2038 safe compat interfaces") f59dd9c886ac ("time: add get_timespec64 and put_timespec64")
NOTE: The patch will not be queued to stable trees until it is upstream.
How should we proceed with this patch?
I believe I can try to backport this patch for the failed-to-apply branches.
I will do the same for "[tip: efi/urgent] efi: Fix a race and a buffer overflow while reading efivars via sysfs" (from the same patchset) which may fail to be applied too.
Best regards, Vladis Dronov | Red Hat, Inc. | The Core Kernel | Senior Software Engineer
-- Thanks Sasha
Backported: https://lore.kernel.org/stable/20200316131938.31453-1-vdronov@redhat.com/T/#...
Best regards, Vladis Dronov | Red Hat, Inc. | The Core Kernel | Senior Software Engineer
linux-stable-mirror@lists.linaro.org