9pfs: fix not_same_qid()
commit8bf27550effb124221100c3c6f5d513dd29ec37d
authorChristian Schoenebeck <qemu_oss@crudebyte.com>
Fri, 4 Jun 2021 14:46:45 +0000 (4 16:46 +0200)
committerChristian Schoenebeck <qemu_oss@crudebyte.com>
Mon, 5 Jul 2021 11:03:16 +0000 (5 13:03 +0200)
tree683531d5ca7a3e703e9b8d8d001dce916a207b6e
parent232a4d2c25c3a83e148116a15f992f728c3579e6
9pfs: fix not_same_qid()

There is only one user of not_same_qid() which is v9fs_walk() and the
latter is using it for comparing a client supplied path with the 9p
export root path, for the sole purpose to prevent a Twalk request
from escaping from the exported 9p tree via "..".

However for that specific purpose the implementation of not_same_qid()
is wrong; if mtime of the 9p export root path changed between Tattach
and Twalk then not_same_qid() returns true when actually comparing
against the export root path.

To fix for the actual semantic being used, only compare QID path
members, but do not compare version or type members.

Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <ca0abae4a899d81c6e87f683732d6c1f56915232.1622821729.git.qemu_oss@crudebyte.com>
hw/9pfs/9p.c