[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#752872: libapr1: file locking is broken, leading to file corruption in e.g. libapache2-mod-auth-cas session files



Hi,

Stefan: Thanks for your time investigating this bug.

Op Sat, Aug 16, 2014 at 09:55:11PM +0200 schreef Stefan Fritsch:
> On Friday 27 June 2014 11:37:18, Joost van Baal-Ilić wrote:
> > While libapr1 defaults to fcntl() locking it also supports flock(),
> > which does not have the problems outlined above. A patch is
> > attached which makes libapr1 use flock() even if fcntl() locking is
> > available.
> 
> flock does not support locking on NFS (at least according to its man 
> page), while fcntl does. I am undecided which is worse.
> 
> Since there does not seem to be a good solution, I am downgrading the 
> severity of this bug.

The default behavior for Linux NFS clients is to convert flock() calls into
fcntl(). See nfs(5), in particular the local_lock option (the default for
that option is ‘none’). To summarize:

 - fcntl() locking is broken for everyone (even if you're using a non-threaded
   mpm you will still run into problems if you open the locked file twice);

 - flock() is broken only for people using NFS (rare) AND a non-Linux kernel
   (very rare, in Debian at least).

Therefore the proposed solution is good, imho.  Leaving severity to your
judgement, nevertheless.

Bye,

Joost

Attachment: signature.asc
Description: Digital signature


Reply to: