9ns: make kstrdup() actually atomic
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 2 May 2019 02:23:15 +0000 (22:23 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 2 May 2019 02:23:15 +0000 (22:23 -0400)
commit71cfd5f4c02100c5e2f39e19570016c62f08e9ea
tree46f4c04322803b63bea7301697370cdcf7c785c4
parentc0f0e9ec2e1808448183958ee1d0bd6894a76e07
9ns: make kstrdup() actually atomic

The specific case that triggered this was multiple mounts on
 #cons/sysname.  Mount does a dev->write, which led to racy calls to
kstrdup on the global sysname.

Reported-by: syzbot+75a997a9a55827b3871d@syzkaller.appspotmail.com
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/ns/chan.c