efi_loader: initialize device path on alloc
PATCH 1/1 efi_loader: initialize device path on alloc
Since the backing memory for a new device path can contain stale data we have to make sure that we zero the buffer. Otherwise some code paths that don't set all fields in a structure backed by this device path might contain unwanted stale data.
--- lib/efi_loader/efi_device_path.c | 1 + 1 file changed, 1 insertion(+)
lib/efi_loader/efi_device_path.c +1 -0
@@ -66,6 +66,7 @@ static void *dp_alloc(size_t sz)return NULL ; } +memset (buf,0 , sz);return buf; }
Signature · 1 line
2.14.3 (Apple Git-98)
PATCH 1/1 efi_loader: initialize device path on alloc
Quoted 6 lines · Patrick Wildt
Since the backing memory for a new device path can contain stale data we have to make sure that we zero the buffer. Otherwise some code paths that don't set all fields in a structure backed by this device path might contain unwanted stale data.
Signed-off-by Patrick Wildt <[email protected]>
Thank you for the patch.
Quoted 17 lines
--- lib/efi_loader/efi_device_path.c | 1 + 1 file changed, 1 insertion(+)lib/efi_loader/efi_device_path.c +1
-0@@ -66,6 +66,7 @@ static void *dp_alloc(size_t sz)return NULL ; } +memset (buf,0 , sz);return buf; }
Alexander Graf
AppliedQuoted 7 lines
Since the backing memory for a new device path can contain stale data we have to make sure that we zero the buffer. Otherwise some code paths that don't set all fields in a structure backed by this device path might contain unwanted stale data.
Signed-off-by Patrick Wildt <[email protected]>Reviewed-by Heinrich Schuchardt <[email protected]>
Thanks, applied to efi-next
Alex