[PATCH net-next 09/14] netfilter: conntrack: annotate data-races around conntrack sysctls

sashiko-bot at kernel.org sashiko-bot at kernel.org
Tue Nov 10 03:01:29 UTC 2026


> nf_conntrack_acct, nf_conntrack_events, nf_conntrack_timestamp,
> nf_conntrack_checksum, nf_conntrack_log_invalid, nf_conntrack_max and
> nf_conntrack_expect_max are read without any lock while their sysctl
> handlers update them with WRITE_ONCE(), and nf_ct_set_acct() stores
> sysctl_acct with a plain write. Add READ_ONCE() to the readers and
> WRITE_ONCE() to nf_ct_set_acct().
> 
> KCSAN reports it when nf_conntrack_checksum is changed while packets go
> through conntrack:
> 
>   BUG: KCSAN: data-race in nf_conntrack_icmpv4_error / proc_dou8vec_minmax
> 
>   write (marked) to 0xffffffff8ee29b6d of 1 bytes by task 568 on cpu 0:
>    proc_dou8vec_minmax+0x1ab/0x1f0
>    proc_sys_call_handler+0x282/0x3a0
> [ ... ]
>    ...
> 
>   value changed: 0x00 -> 0x01
> 
> Signed-off-by: Jiayuan Chen <jiayuan.chen at linux.dev>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261109025425.328445-1-jiayuan.chen@linux.dev?part=9




More information about the Linux-security-module-archive mailing list