summaryrefslogtreecommitdiff
path: root/sys/src/cmd/awk/lib.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2019-10-07 11:52:14 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2019-10-07 11:52:14 +0200
commitf763dc164092f5a4652c65feab358130857f0622 (patch)
treed99b75cc7d8f14abc9b4a2e64dfff674559a8783 /sys/src/cmd/awk/lib.c
parentaf23bb343a067d5346696b788f4cce5b744cd51d (diff)
sshfs: fix race condition between sendproc() and recvproc()
there was a race between the sendproc putting the request on the sreqrd[] id and the recvproc handling the response, and potentially freeing the request before the sendproc() was finished with the request (or the fid). so we defer allocating a request id and putting it on the sreqrd[] stage after we have completely generated the request in vpack(). this prevents the handling of the request before it is even sent. this also means that the SReq should not be touched after calling sendpkt(), submitreq(), submitsreq(). secondly, putsfid() needs to acquire the RWLock to make sure sendproc() is finished with the request. the scenario is that recvproc() can call respond() on the request before sendproc() has unlocked the SFid.
Diffstat (limited to 'sys/src/cmd/awk/lib.c')
0 files changed, 0 insertions, 0 deletions