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

Ricardo Neri ricardo.neri-calderon at linux.intel.com
Wed Feb 11 02:44:25 UTC 2015


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?

Thanks and BR,
Ricardo







More information about the fwts-devel mailing list