Files
linux/drivers/acpi
Mark Langsdorf 0bb665f8de ACPI: custom_method: fix a possible memory leak
commit 1cfd895643 upstream.

In cm_write(), if the 'buf' is allocated memory but not fully consumed,
it is possible to reallocate the buffer without freeing it by passing
'*ppos' as 0 on a subsequent call.

Add an explicit kfree() before kzalloc() to prevent the possible memory
leak.

Fixes: 526b4af47f ("ACPI: Split out custom_method functionality into an own driver")
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
Cc: 5.4+ <stable@vger.kernel.org> # 5.4+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-16 10:53:37 +09:00
..
2023-05-15 17:11:06 +09:00
2015-07-08 02:27:32 +02:00
2016-04-27 23:42:57 +02:00
2016-11-11 23:23:02 +01:00
2015-07-08 02:27:32 +02:00
2015-07-08 02:27:32 +02:00
2015-07-08 02:27:32 +02:00
2023-05-16 09:48:38 +09:00
2016-10-10 02:20:43 +02:00
2015-07-08 02:27:32 +02:00
2023-05-15 16:16:33 +09:00
2023-05-16 08:21:52 +09:00
2016-07-19 12:32:39 -07:00