virtiofsd: passthrough_ll: add lo_map for ino/fh indirection
commit25c135727b08dca90f00094e522a69170b13dfac
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 31 Jan 2019 04:49:39 +0000 (31 12:49 +0800)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 23 Jan 2020 16:41:36 +0000 (23 16:41 +0000)
treec82f62476ab302a1d4fca9318c58c657487a62b4
parent929cfb7a9a1b101cdfc9ac19807ecab4c81a13e4
virtiofsd: passthrough_ll: add lo_map for ino/fh indirection

A layer of indirection is needed because passthrough_ll cannot expose
pointers or file descriptor numbers to untrusted clients.  Malicious
clients could send invalid pointers or file descriptors in order to
crash or exploit the file system daemon.

lo_map provides an integer key->value mapping.  This will be used for
ino and fh fields in the patches that follow.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
tools/virtiofsd/passthrough_ll.c