qemu-e2k/authz
Daniel P. Berrangé b4682a63f8 filemon: fix watch IDs to avoid potential wraparound issues
Watch IDs are allocated from incrementing a int counter against
the QFileMonitor object. In very long life QEMU processes with
a huge amount of USB MTP activity creating & deleting directories
it is just about conceivable that the int counter can wrap
around. This would result in incorrect behaviour of the file
monitor watch APIs due to clashing watch IDs.

Instead of trying to detect this situation, this patch changes
the way watch IDs are allocated. It is turned into an int64_t
variable where the high 32 bits are set from the underlying
inotify "int" ID. This gives an ID that is guaranteed unique
for the directory as a whole, and we can rely on the kernel
to enforce this. QFileMonitor then sets the low 32 bits from
a per-directory counter.

The USB MTP device only sets watches on the directory as a
whole, not files within, so there is no risk of guest
triggered wrap around on the low 32 bits.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-04-02 13:52:02 +01:00
..
base.c
list.c authz: add QAuthZList object type for an access control list 2019-02-26 15:32:18 +00:00
listfile.c filemon: fix watch IDs to avoid potential wraparound issues 2019-04-02 13:52:02 +01:00
Makefile.objs authz: add QAuthZPAM object type for authorizing using PAM 2019-02-26 15:32:19 +00:00
pamacct.c authz: add QAuthZPAM object type for authorizing using PAM 2019-02-26 15:32:19 +00:00
simple.c
trace-events trace-events: Fix attribution of trace points to source 2019-03-22 16:18:07 +00:00