Skip to content

Commit a58dde7

Browse files
committed
platform/x86: dell_rbu: Stop overwriting data buffer
JIRA: https://issues.redhat.com/browse/RHEL-87406 commit f4b0fa3 Author: Stuart Hayes <stuart.w.hayes@gmail.com> Date: Mon Jun 9 13:46:58 2025 -0500 platform/x86: dell_rbu: Stop overwriting data buffer The dell_rbu driver will use memset() to clear the data held by each packet when it is no longer needed (when the driver is unloaded, the packet size is changed, etc). The amount of memory that is cleared (before this patch) is the normal packet size. However, the last packet in the list may be smaller. Fix this to only clear the memory actually used by each packet, to prevent it from writing past the end of data buffer. Because the packet data buffers are allocated with __get_free_pages() (in page-sized increments), this bug could only result in a buffer being overwritten when a packet size larger than one page is used. The only user of the dell_rbu module should be the Dell BIOS update program, which uses a packet size of 4096, so no issues should be seen without the patch, it just blocks the possiblity. Fixes: 6c54c28 ("[PATCH] dell_rbu: new Dell BIOS update driver") Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com> Link: https://lore.kernel.org/r/20250609184659.7210-5-stuart.w.hayes@gmail.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: David Arcari <darcari@redhat.com>
1 parent 4c87b88 commit a58dde7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/platform/x86/dell/dell_rbu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ static void packet_empty_list(void)
322322
* zero out the RBU packet memory before freeing
323323
* to make sure there are no stale RBU packets left in memory
324324
*/
325-
memset(newpacket->data, 0, rbu_data.packetsize);
325+
memset(newpacket->data, 0, newpacket->length);
326326
set_memory_wb((unsigned long)newpacket->data,
327327
1 << newpacket->ordernum);
328328
free_pages((unsigned long) newpacket->data,

0 commit comments

Comments
 (0)