diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index f84698bfcc..936e4e9349 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -3642,6 +3642,10 @@ static void coroutine_fn v9fs_wstat(void *opaque) err = -ENOENT; goto out; } + if (!strcmp(".", v9stat.name.data) || !strcmp("..", v9stat.name.data)) { + err = -EISDIR; + goto out; + } v9fs_path_write_lock(s); err = v9fs_complete_rename(pdu, fidp, -1, &v9stat.name);