[PATCH 2/5] efi_runtime: do not access userspace addresses directly

Colin Ian King colin.king at canonical.com
Wed Feb 11 20:10:24 UTC 2015


On 11/02/15 02:44, Ricardo Neri wrote:
> On Tue, 2015-02-10 at 18:30 +0000, Colin Ian King wrote:
>>> -     data = kmalloc(datasize, GFP_KERNEL);
>>> -     if (copy_from_user(data, psetvariable->Data, datasize)) {
>>> +     data = kmalloc(psetvariable_local.DataSize, GFP_KERNEL);
>>> +     if (copy_from_user(data, psetvariable_local.Data,
>>> +                        psetvariable_local.DataSize)) {
>>>               kfree(name);
>>
>> I think there needs to be a kfree on data here, and the original code
>> didn't do a NULL check on data for the kmalloc, so that's another
>> issues..
> 
> As you mention these issues are unrelated to the topic of this patch. I
> will submit a new patch that takes care of this. Does that make sense?

Perfect sense. Thanks! Much appreciated.

Colin




More information about the fwts-devel mailing list