• Andrew Morton's avatar
    [PATCH] remove 16-bit pid assumption from ipc/sem.c · 76621ec6
    Andrew Morton authored
    From: Manfred Spraul <manfred@colorfullife.com>
    
    SysV sem operations that involve multiple semaphores can fail in the
    middle, and then sempid (pid of the last successful operation) must be
    restored.  This happens with "sempid >>= 16" - broken due to the 32-bit pid
    values.  The attached patch fixes that by reordering the updates of the
    semaphore fields.
    
    Additionally, the patch fixes the corruption of the sempid value that occurs
    if a wait-for-zero operation fails.
    
    The patch is more than two years old, and was in -dj and -ak kernels.
    76621ec6
sem.c 31.9 KB