[PATCH] efi_runtime: ensure we don't allocate a zero byte buffer (LP: #1429890)

Ricardo Neri ricardo.neri-calderon at linux.intel.com
Wed Mar 11 22:11:31 UTC 2015


On Wed, 2015-03-11 at 19:44 +0000, Colin Ian King wrote:
> To clarify, which approach are you referring to?
> 
> 1) ZERO_SIZE_PTR being replaced to a NULL or

I would suggest that efi_runtime could make dst = NULL if len = 0, no
need to call kmalloc. Hopefully, true NULL cases are handled correctly
in efi.get_next_variable and we should be able to see how the firmware
handles it.

> 2) allocating a 1 byte buffer and passing that over to stop the kernel
> breaking.

This would be my last resort, provided that the kernel fails only in the
ZERO_SIZE_PTR case and not with the NULL case.






More information about the fwts-devel mailing list