Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1566563

[PATCH] firmware_class: Avoid pending list corruption

From Imran Khan <kimran@codeaurora.org>
Newsgroups linux.kernel
Subject [PATCH] firmware_class: Avoid pending list corruption
Date 2017-01-25 13:50 +0100
Message-ID <t3vbr-1Op-9@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Remove firmware buffer from pending list when it is freed.
Once the buffer is free kmalloc can allocate the same slab
object for some other user but as the buffer is still there
in the pending list, we end up with multiple users of the
same slab object using it in different contexts.

Signed-off-by: Imran Khan <kimran@codeaurora.org>
---
 drivers/base/firmware_class.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 4497d26..d09c1aa 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -339,6 +339,9 @@ static void __fw_free_buf(struct kref *ref)
 		 (unsigned int)buf->size);
 
 	list_del(&buf->list);
+#ifdef CONFIG_FW_LOADER_USER_HELPER
+	list_del(&buf->pending_list);
+#endif
 	spin_unlock(&fwc->lock);
 
 #ifdef CONFIG_FW_LOADER_USER_HELPER
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] firmware_class: Avoid pending list corruption Imran Khan <kimran@codeaurora.org> - 2017-01-25 13:50 +0100
  Re: [PATCH] firmware_class: Avoid pending list corruption "Luis R. Rodriguez" <mcgrof@kernel.org> - 2017-01-25 16:20 +0100

csiph-web