virtiofsd: Add helpers to work with /proc/self/task/tid/attr/fscreate
commitcb282e556acef3764adde88701ec923a0731bc56
authorVivek Goyal <vgoyal@redhat.com>
Tue, 8 Feb 2022 20:48:10 +0000 (8 15:48 -0500)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 17 Feb 2022 17:22:26 +0000 (17 17:22 +0000)
treee41f5d9b839a4f7d76f350f6e4a659e5856eff43
parent81489726ad8d9adc2710eb7acff8e3d9c056dbdb
virtiofsd: Add helpers to work with /proc/self/task/tid/attr/fscreate

Soon we will be able to create and also set security context on the file
atomically using /proc/self/task/tid/attr/fscreate knob. If this knob
is available on the system, first set the knob with the desired context
and then create the file. It will be created with the context set in
fscreate. This works basically for SELinux and its per thread.

This patch just introduces the helper functions. Subsequent patches will
make use of these helpers.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Message-Id: <20220208204813.682906-8-vgoyal@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
  dgilbert: Manually merged gettid syscall number fixup from Vivek
tools/virtiofsd/passthrough_ll.c