Re: BUG: KCSAN: data-race in add_device_randomness+0x20d/0x290

From: Paul Menzel
Date: Tue Feb 15 2022 - 04:16:51 EST


Dear Jason,


Thank you for your quick response, and sorry for the late reply.

Am 07.02.22 um 19:42 schrieb Jason A. Donenfeld:

Thanks for the report. I assume that this is actually an old bug. Do
you have a vmlinux or a random.o from this kernel you could send me to
double check?

I had unfortunately already overwritten these files. I was unable to fully reproduce the same trace with a build from the same commit, and only got:

```
[…]
[ 12.819273] BUG: KCSAN: data-race in _mix_pool_bytes+0x5d/0x1c0

[ 12.822917] race at unknown origin, with read to 0xffffa21c07003009 of 1 bytes by task 1035 on cpu 0:
[ 12.823580] _mix_pool_bytes+0x5d/0x1c0
[ 12.823678] add_device_randomness+0x97/0x290
[ 12.823691] release_task+0x231/0xb20
[ 12.823735] wait_consider_task+0x883/0x17d0
[ 12.823755] do_wait+0x35f/0x4d0
[ 12.823768] kernel_wait4+0xdb/0x180
[ 12.823778] __do_sys_wait4+0x85/0x90
[ 12.823787] __x64_sys_wait4+0x49/0x50
[ 12.823797] do_syscall_64+0x39/0x80
[ 12.823819] entry_SYSCALL_64_after_hwframe+0x44/0xae

[ 12.824028] value changed: 0x56 -> 0xc1

[ 12.824415] Reported by Kernel Concurrency Sanitizer on:
[ 12.824688] CPU: 0 PID: 1035 Comm: postfix-script Not tainted 5.17.0-rc2-00352-g90c9e950c0de #40
[ 12.824705] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
[…]
```

So instead of the former (used as subject line)

add_device_randomness+0x20d/0x290

there is

add_device_randomness+0x97/0x290

I uploaded `random.o` [1].


Kind regards,

Paul


[1]: https://owww.molgen.mpg.de/~pmenzel/random.o