ACK: [PATCH 2/2] efi_runtime: Don't use get_user() on non-pointer
IvanHu
ivan.hu at canonical.com
Fri Oct 24 08:43:03 UTC 2014
On 10/21/2014 07:50 PM, Matt Fleming wrote:
> From: Matt Fleming <matt.fleming at intel.com>
>
> We don't need to try to construct a pointer from a structure on the
> stack in order to use get_user(). We can just access it directly.
>
> This fixes an efi_runtime_set_waketime() failure, introduced with commit
> "efi_runtime: Copied the structure from userland locally in kernel
> space".
>
> Signed-off-by: Matt Fleming <matt.fleming at intel.com>
> ---
> efi_runtime/efi_runtime.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/efi_runtime/efi_runtime.c b/efi_runtime/efi_runtime.c
> index 59609bc956b2..40fb9607f504 100644
> --- a/efi_runtime/efi_runtime.c
> +++ b/efi_runtime/efi_runtime.c
> @@ -394,8 +394,8 @@ static long efi_runtime_set_waketime(unsigned long arg)
> if (copy_from_user(&psetwakeuptime_local, psetwakeuptime, sizeof(psetwakeuptime_local)))
> return -EFAULT;
>
> - if (get_user(enabled, &(psetwakeuptime_local.Enabled)) ||
> - copy_from_user(&efi_time, psetwakeuptime_local.Time, sizeof(EFI_TIME)))
> + enabled = psetwakeuptime_local.Enabled;
> + if (copy_from_user(&efi_time, psetwakeuptime_local.Time, sizeof(EFI_TIME)))
> return -EFAULT;
>
> convert_to_efi_time(&eft, &efi_time);
>
Acked-by: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list