Message ID | 20230804094155.283766-1-xiujianfeng@huaweicloud.com (mailing list archive) |
---|---|
State | Rejected |
Delegated to: | Paul Moore |
Headers | show |
Series | [-next] audit: remove out-of-date comment in auditd_reset() | expand |
On Fri, Aug 4, 2023 at 5:43 AM Xiu Jianfeng <xiujianfeng@huaweicloud.com> wrote: > > From: Xiu Jianfeng <xiujianfeng@huawei.com> > > Since commit 48d0e023af97 ("audit: fix the RCU locking for the > auditd_connection structure"), auditd_conn is changed to a global > pointor protected by RCU, and doesn't call auditd_set() here, which > makes the comment don't match the code, so remove it. > > Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com> > --- > kernel/audit.c | 1 - > 1 file changed, 1 deletion(-) The comment is still relevant, look at the `rcu_assign_pointer(auditd_conn, NULL)` call in the auditd_reset() function immediately before the spinlock is unlocked. > diff --git a/kernel/audit.c b/kernel/audit.c > index 45b2fb1e45af..0905750779a4 100644 > --- a/kernel/audit.c > +++ b/kernel/audit.c > @@ -640,7 +640,6 @@ static void auditd_reset(const struct auditd_connection *ac) > struct sk_buff *skb; > struct auditd_connection *ac_old; > > - /* if it isn't already broken, break the connection */ > spin_lock_irqsave(&auditd_conn_lock, flags); > ac_old = rcu_dereference_protected(auditd_conn, > lockdep_is_held(&auditd_conn_lock)); > -- > 2.34.1
Hi, On 2023/8/8 2:20, Paul Moore wrote: > On Fri, Aug 4, 2023 at 5:43 AM Xiu Jianfeng <xiujianfeng@huaweicloud.com> wrote: >> >> From: Xiu Jianfeng <xiujianfeng@huawei.com> >> >> Since commit 48d0e023af97 ("audit: fix the RCU locking for the >> auditd_connection structure"), auditd_conn is changed to a global >> pointor protected by RCU, and doesn't call auditd_set() here, which >> makes the comment don't match the code, so remove it. >> >> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com> >> --- >> kernel/audit.c | 1 - >> 1 file changed, 1 deletion(-) > > The comment is still relevant, look at the > `rcu_assign_pointer(auditd_conn, NULL)` call in the auditd_reset() > function immediately before the spinlock is unlocked. Thanks for your feedback, please ignore this patch. > >> diff --git a/kernel/audit.c b/kernel/audit.c >> index 45b2fb1e45af..0905750779a4 100644 >> --- a/kernel/audit.c >> +++ b/kernel/audit.c >> @@ -640,7 +640,6 @@ static void auditd_reset(const struct auditd_connection *ac) >> struct sk_buff *skb; >> struct auditd_connection *ac_old; >> >> - /* if it isn't already broken, break the connection */ >> spin_lock_irqsave(&auditd_conn_lock, flags); >> ac_old = rcu_dereference_protected(auditd_conn, >> lockdep_is_held(&auditd_conn_lock)); >> -- >> 2.34.1 >
diff --git a/kernel/audit.c b/kernel/audit.c index 45b2fb1e45af..0905750779a4 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -640,7 +640,6 @@ static void auditd_reset(const struct auditd_connection *ac) struct sk_buff *skb; struct auditd_connection *ac_old; - /* if it isn't already broken, break the connection */ spin_lock_irqsave(&auditd_conn_lock, flags); ac_old = rcu_dereference_protected(auditd_conn, lockdep_is_held(&auditd_conn_lock));