Skip to content

Commit

Permalink
ACPI: pfr_telemetry: Fix info leak in pfrt_log_ioctl()
Browse files Browse the repository at this point in the history
The "data_info" struct is copied to the user.  It has a 4 byte struct
hole after the last struct member so we need to memset that to avoid
copying uninitialized stack data to the user.

Fixes: b0013e0 ("ACPI: Introduce Platform Firmware Runtime Telemetry driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Dan Carpenter authored and Rafael J. Wysocki committed Jan 10, 2022
1 parent 31834aa commit 7bf2e4d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/acpi/pfr_telemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ static int get_pfrt_log_data_info(struct pfrt_log_data_info *data_info,
union acpi_object *out_obj, in_obj, in_buf;
int ret = -EBUSY;

memset(data_info, 0, sizeof(*data_info));
memset(&in_obj, 0, sizeof(in_obj));
memset(&in_buf, 0, sizeof(in_buf));
in_obj.type = ACPI_TYPE_PACKAGE;
Expand Down

0 comments on commit 7bf2e4d

Please sign in to comment.