Skip to contentSkip to conversation

locking in fs/signalfd.c

DISCUSSION Rasmus Villemoes 1 participant 1 message Nov 21, 2016 VFS

lore
Share & tools
lore
#0 lore raw

What exactly is the purpose of the locking in

    298                 spin_lock_irq(&current->sighand->siglock);
    299                 ctx->sigmask = sigmask;
    300                 spin_unlock_irq(&current->sighand->siglock);

It doesn't seem to prevent process A from modifying the mask while process B is also doing that (or reading from it in signalfd_{poll,dequeue}). Of course it requires sharing the struct file, but that's certainly possible.

Rasmus