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@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