[PATCH] kernel: fix acct.c first test openai codex

From: Ozgur Kara
Date: Fri May 16 2025 - 19:16:01 EST


From: Ozgur Karatas <ozgur@xxxxxxxxxx>

Hello,

i want to try out the openai codex and it seemed like a logical
process so with rcu_read_lock() a protection is started but we dont
call rcu_read_unlock(); it has to be called to end rcu read lock.

I guess, this means rcu stays open forever and data structures are not
cleaned which causes performance degradation.

Regards

Ozgur

Reported-by: Ozgur Karatas <ozgur@xxxxxxxxxx>
---
kernel/acct.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/kernel/acct.c b/kernel/acct.c
index 6520baa13669..8a2b75063d16 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -330,6 +330,7 @@ SYSCALL_DEFINE1(acct, const char __user *, name)
} else {
rcu_read_lock();
pin_kill(task_active_pid_ns(current)->bacct);
+ rcu_read_unlock();
}

return error;
--
2.39.5