summaryrefslogtreecommitdiff
path: root/lib/cmap
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-04-13 23:18:56 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2015-04-13 23:18:56 +0200
commit656dd953a85b043c1eb085d5d8e1f7f7f1e4452f (patch)
tree8fb0e18aab533c4762a56123151a53c5acf730bf /lib/cmap
parent85e144dcb0c621161ca4275f7613d606da088ca0 (diff)
downloadplan9front-656dd953a85b043c1eb085d5d8e1f7f7f1e4452f.tar.xz
segment: fix read/write g->dlen race, avoid copying kernel memory, qlock
code like "return g->dlen;" is wrong as we do not hold the qlock of the global segment. another process could come in and override g->dlen making us return the wrong byte count. avoid copying when we already got a kernel address (kernel memory is the same on processes) which is the case with bread()/bwrite(). this is the same optimization that devsd does. also avoid allocating/freeing and copying while holding the qlock. when we copy to/from user memory, we might fault preventing others from accessing the segment while fault handling is in progress.
Diffstat (limited to 'lib/cmap')
0 files changed, 0 insertions, 0 deletions