fs-backend: do not expose file descriptors to frontend
PATCH 1/1 fs-backend: do not expose file descriptors to frontend
fs-backend: do not expose file descriptors to frontend
Signed-off-by Samuel Thibault <[email protected]>
tools/fs-back/fs-backend.c +3 -0
@@ -200,6 +200,7 @@int evt_port;pthread_t handling_thread;struct fsif_sring *sring; +int i;printf ("Handling connection from dom=%d, for export=%d\n" , frontend_dom_id, export_id);
@@ -242,6 +243,8 @@ PROT_READ | PROT_WRITE);BACK_RING_INIT (&mount->ring, sring,PAGE_SIZE ); mount->nr_entries = mount->ring.nr_ents; +for (i =0 ; i <MAX_FDS ; i++) + mount->fds[i] =-1 ;xenbus_write_backend_ready (mount);pthread_create (&handling_thread,NULL , &handle_mount, mount);
tools/fs-back/fs-backend.h +2 -0
@@ -12,6 +12,7 @@#define EXPORTS_SUBNODE "exports"#define EXPORTS_NODE ROOT_NODE"/"EXPORTS_SUBNODE#define WATCH_NODE EXPORTS_NODE"/requests" +#define MAX_FDS 16struct fs_export {
@@ -45,6 +46,7 @@int nr_entries;struct fs_request *requests;unsigned short *freelist; +int fds[MAX_FDS ]; };
tools/fs-back/fs-ops.c +64 -14
151 lines not on this page · raw message