Message ID | 1470649228-15522-2-git-send-email-ivan.hu@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 2016-08-08 05:40 PM, Ivan Hu wrote: > Data size is required to return when getting the EFI_BUFFER_TOO_SMALL > for user to obtain and set the required data buffer size. > > Signed-off-by: Ivan Hu <ivan.hu@canonical.com> > --- > efi_runtime/efi_runtime.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/efi_runtime/efi_runtime.c b/efi_runtime/efi_runtime.c > index c73d968..8c77c77 100644 > --- a/efi_runtime/efi_runtime.c > +++ b/efi_runtime/efi_runtime.c > @@ -235,6 +235,10 @@ static long efi_runtime_get_variable(unsigned long arg) > if (dz && put_user(datasize, getvariable_local.data_size)) > return -EFAULT; > return 0; > + } else if (status == EFI_BUFFER_TOO_SMALL) { > + if (dz && put_user(datasize, getvariable_local.data_size)) > + return -EFAULT; > + return -EINVAL; > } else { > return -EINVAL; > } > Acked-by: Alex Hung <alex.hung@canonical.com>
On 08/08/16 10:40, Ivan Hu wrote: > Data size is required to return when getting the EFI_BUFFER_TOO_SMALL > for user to obtain and set the required data buffer size. > > Signed-off-by: Ivan Hu <ivan.hu@canonical.com> > --- > efi_runtime/efi_runtime.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/efi_runtime/efi_runtime.c b/efi_runtime/efi_runtime.c > index c73d968..8c77c77 100644 > --- a/efi_runtime/efi_runtime.c > +++ b/efi_runtime/efi_runtime.c > @@ -235,6 +235,10 @@ static long efi_runtime_get_variable(unsigned long arg) > if (dz && put_user(datasize, getvariable_local.data_size)) > return -EFAULT; > return 0; > + } else if (status == EFI_BUFFER_TOO_SMALL) { > + if (dz && put_user(datasize, getvariable_local.data_size)) > + return -EFAULT; > + return -EINVAL; > } else { > return -EINVAL; > } > Acked-by: Colin Ian King <colin.king@canonical.com>
diff --git a/efi_runtime/efi_runtime.c b/efi_runtime/efi_runtime.c index c73d968..8c77c77 100644 --- a/efi_runtime/efi_runtime.c +++ b/efi_runtime/efi_runtime.c @@ -235,6 +235,10 @@ static long efi_runtime_get_variable(unsigned long arg) if (dz && put_user(datasize, getvariable_local.data_size)) return -EFAULT; return 0; + } else if (status == EFI_BUFFER_TOO_SMALL) { + if (dz && put_user(datasize, getvariable_local.data_size)) + return -EFAULT; + return -EINVAL; } else { return -EINVAL; }
Data size is required to return when getting the EFI_BUFFER_TOO_SMALL for user to obtain and set the required data buffer size. Signed-off-by: Ivan Hu <ivan.hu@canonical.com> --- efi_runtime/efi_runtime.c | 4 ++++ 1 file changed, 4 insertions(+)