lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <561E1825.8010500@pmhahn.de>
Date:	Wed, 14 Oct 2015 10:53:57 +0200
From:	Philipp Hahn <pmhahn@...ahn.de>
To:	linux-kernel@...r.kernel.org
Subject: Re: RFH: stale (f)lock in /proc/locks - process no longer exists

To answer my own question:

Am 14.10.2015 um 10:30 schrieb Philipp Hahn:
> I have several shell scripts using "/usr/bin/flock -x
> /run/lock/jenkins-ip.lock" to acquiring the exclusive lock. Today they
> hang, while the lock is owned by a process which no longer exists:
...
> 1. How can this happen?
>    My understanding is, that all files are closed on process exit and
> that all locks are released then. Did I miss something.

I used "{ flock -x 9 } 9<>/var/lock/jenkins-ip.lock": The shell opens
the file, but flock runs in a sub-process; after doing the locking the
process exits and is no longer available, but the locking for the still
opened file persist.

My shell script then received some signals, invoked its trap handler,
which then did some recursive locking.

> 2. How can I release that lock?

Killed the recursive "flock -x" call.

Philipp
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ