When guest tries to chmod a block or char device file over 9pfs,
the qemu process segfaults. With 9p2000.u protocol we use wstat to
change mode bits and client don't send extension information for
chmod. We need to check for size field to check whether extension
info is present or not.
Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Acked-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
(cherry picked from commit
c7e587b73ebac05943df78f5f37d80d32ff47d3d)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
ret |= S_IFIFO;
}
if (mode & P9_STAT_MODE_DEVICE) {
- if (extension && extension->data[0] == 'c') {
+ if (extension->size && extension->data[0] == 'c') {
ret |= S_IFCHR;
} else {
ret |= S_IFBLK;