diff options
author | Peter Maydell | 2018-11-09 11:54:10 +0100 |
---|---|---|
committer | Peter Maydell | 2018-11-09 11:54:10 +0100 |
commit | 160e5c22e55b3f775c2003dfc626fa872ee4a7a1 (patch) | |
tree | bd6d3255d4b23ed41a9b3aa9fe2200df55b463c1 /hw/9pfs/cofile.c | |
parent | Merge remote-tracking branch 'remotes/riscv/tags/riscv-for-master-3.1-rc1' in... (diff) | |
parent | 9p: write lock path in v9fs_co_open2() (diff) | |
download | qemu-160e5c22e55b3f775c2003dfc626fa872ee4a7a1.tar.gz qemu-160e5c22e55b3f775c2003dfc626fa872ee4a7a1.tar.xz qemu-160e5c22e55b3f775c2003dfc626fa872ee4a7a1.zip |
Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging
Fixes a potential use-after-free issue that could be triggered by a
misbehaving guest.
# gpg: Signature made Thu 08 Nov 2018 20:36:48 GMT
# gpg: using RSA key 71D4D5E5822F73D6
# gpg: Good signature from "Greg Kurz <groug@kaod.org>"
# gpg: aka "Gregory Kurz <gregory.kurz@free.fr>"
# gpg: aka "[jpeg image of size 3330]"
# Primary key fingerprint: B482 8BAF 9431 40CE F2A3 4910 71D4 D5E5 822F 73D6
* remotes/gkurz/tags/for-upstream:
9p: write lock path in v9fs_co_open2()
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/9pfs/cofile.c')
-rw-r--r-- | hw/9pfs/cofile.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/9pfs/cofile.c b/hw/9pfs/cofile.c index 88791bc327..9c22837cda 100644 --- a/hw/9pfs/cofile.c +++ b/hw/9pfs/cofile.c @@ -140,10 +140,10 @@ int coroutine_fn v9fs_co_open2(V9fsPDU *pdu, V9fsFidState *fidp, cred.fc_gid = gid; /* * Hold the directory fid lock so that directory path name - * don't change. Read lock is fine because this fid cannot - * be used by any other operation. + * don't change. Take the write lock to be sure this fid + * cannot be used by another operation. */ - v9fs_path_read_lock(s); + v9fs_path_write_lock(s); v9fs_co_run_in_worker( { err = s->ops->open2(&s->ctx, &fidp->path, |