[krbdev.mit.edu #8474] gnu libc OFD lock bug affects krb5

Greg Hudson via RT rt-comment at krbdev.mit.edu
Sun Aug 14 11:20:27 EDT 2016


It does not appear that there is a fcntl64() function in glibc, so I 
think the workaround would have to use syscall().

There is a struct flock64 in the header files (for use with F_SETLK64 and 
friends, I think).  Passing this to unmodified fcntl() currently works on 
32-bit Linux, but that seems like a bad workaround because it depends on 
the buggy behavior.  If the glibc bug is fixed in the future, glibc would 
be committing an aliasing violation reading values from a struct flock64 
as a struct flock.  In practice it would probably just read the same zero 
offsets as we want to set in the first place, though.

As an alternative, we could disable OFD locking on 32-bit Linux, and 
later re-enable it with a __GLIBC_PREREQ() check when there a fixed 
version.  But there's a chance that the upstream bug will never be fixed 
because of compatibility concerns, and it would be a shame to never get 
OFD locking on 32-bit Linux.


More information about the krb5-bugs mailing list