Message ID | 1413892226-27849-3-git-send-email-matt@console-pimps.org |
---|---|
State | Accepted |
Headers | show |
On 14-10-21 07:50 PM, Matt Fleming wrote: > From: Matt Fleming <matt.fleming@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@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: Alex Hung <alex.hung@canonical.com>
On 10/21/2014 07:50 PM, Matt Fleming wrote: > From: Matt Fleming <matt.fleming@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@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@canonical.com>
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);