------- Comment From <email address hidden> 2024-06-04 07:23 EDT------- @sergiodj
My patch went further and also allowed FIFOs. This patch also passed all my verification with the workload that was previously failing.
iff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h index 51c94b0116..d19bb26570 100644 --- a/hw/9pfs/9p-util.h +++ b/hw/9pfs/9p-util.h @@ -130,9 +130,9 @@ static inline int close_if_special_file(int fd) close_preserve_errno(fd); return -1; } - if (!S_ISREG(stbuf.st_mode) && !S_ISDIR(stbuf.st_mode)) { + if (!S_ISREG(stbuf.st_mode) && !S_ISDIR(stbuf.st_mode) && !S_ISSOCK(stbuf.st_mode) && !S_ISFIFO(stbuf.st_mode)) { error_report_once( - "9p: broken or compromised client detected; attempt to open " + "9p: broken or compromised client detected; attempt to open a device" "special file (i.e. neither regular file, nor directory)" ); close(fd);
------- Comment From <email address hidden> 2024-06-04 07:23 EDT-------
@sergiodj
My patch went further and also allowed FIFOs.
This patch also passed all my verification with the workload that was previously failing.
iff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h .d19bb26570 100644 special_ file(int fd) errno(fd) ; stbuf.st_ mode) && !S_ISDIR( stbuf.st_ mode)) { stbuf.st_ mode) && !S_ISDIR( stbuf.st_ mode) && !S_ISSOCK( stbuf.st_ mode) && !S_ISFIFO( stbuf.st_ mode)) {
index 51c94b0116.
--- a/hw/9pfs/9p-util.h
+++ b/hw/9pfs/9p-util.h
@@ -130,9 +130,9 @@ static inline int close_if_
close_preserve_
return -1;
}
- if (!S_ISREG(
+ if (!S_ISREG(
error_report_once(
- "9p: broken or compromised client detected; attempt to open "
+ "9p: broken or compromised client detected; attempt to open a device"
"special file (i.e. neither regular file, nor directory)"
);
close(fd);