Skip to contentSkip to conversation

Binder: Initialize lsm_context structure

PATCH Applied Casey Schaufler 2 participants 2 messages Dec 6, 2024 – Dec 16, 2024 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 Binder: Initialize lsm_context structure

It is possible to reach the end of binder_transaction() without having set lsmctx. As the variable value is checked there it needs to be initialized.

---
 drivers/android/binder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/android/binder.c +1 -1
index 919da8e674f5..a4b98e95ab85 100644
@@ -3017,7 +3017,7 @@ static void binder_transaction(struct binder_proc *proc,
 	struct binder_context *context = proc->context;
 	int t_debug_id = atomic_inc_return(&binder_last_id);
 	ktime_t t_start_time = ktime_get();
-	struct lsm_context lsmctx;
+	struct lsm_context lsmctx = { };
 	struct list_head sgc_head;
 	struct list_head pf_head;
 	const void __user *user_buffer = (const void __user *)
maintainer Applied
#2 lore raw
Quoted 10 lines · On Dec 6, 2024 Casey Schaufler <[email protected]> wrote:

It is possible to reach the end of binder_transaction() without having set lsmctx. As the variable value is checked there it needs to be initialized.

---
 drivers/android/binder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Merged into lsm/dev, thanks.

--
paul-moore.com