9pfs: don't BUG_ON() if fid is already opened
commit49dd946bb5419681c8668b09a6d10f42bc707b78
authorGreg Kurz <groug@kaod.org>
Tue, 1 Nov 2016 11:00:40 +0000 (1 12:00 +0100)
committerGreg Kurz <groug@kaod.org>
Tue, 1 Nov 2016 11:03:02 +0000 (1 12:03 +0100)
tree43a0720c4a525bbc2545c9c9dc64d0915e9b5006
parentdd654e0365c7b70df01920f1fca88dd7089eeb5d
9pfs: don't BUG_ON() if fid is already opened

A buggy or malicious guest could pass the id of an already opened fid and
cause QEMU to abort. Let's return EINVAL to the guest instead.

Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
hw/9pfs/9p.c