If the 9pfs mount tag is longer than MAX_TAG_LEN bytes, rather than
silently truncating the tag which will likely break the guest OS,
report an immediate error and exit QEMU
* hw/9pfs/virtio-9p-device.c: Report error & exit if mount tag is
too long
Signed-off-by: Daniel P. Berrange <[email protected]>
Signed-off-by: Aneesh Kumar K.V <[email protected]>
s->ctx.fs_root = g_strdup(fse->path);
len = strlen(conf->tag);
if (len > MAX_TAG_LEN) {
- len = MAX_TAG_LEN;
+ fprintf(stderr, "mount tag '%s' (%d bytes) is longer than "
+ "maximum (%d bytes)", conf->tag, len, MAX_TAG_LEN);
+ exit(1);
}
/* s->tag is non-NULL terminated string */
s->tag = g_malloc(len);