aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2015-11-12 13:14:08 +0100
committerCorinna Vinschen <corinna@vinschen.de>2015-11-12 13:15:52 +0100
commite5a1a9304a2efbb892df15eed195c14e3db24bfb (patch)
treee0a029e0627886075340df66e7911b4123bd594c /winsup
parent569147ac286eca9ada778c1cf1a0963d67e8eb9c (diff)
downloadnewlib-cygwin-acl.zip
newlib-cygwin-acl.tar.gz
newlib-cygwin-acl.tar.bz2
flock: Fix hang in object collision casegithub/cygwin-aclcygwin-acl
* flock.cc (lockf_t::create_lock_obj): Correctly recreate lock object attributes anew in each loop. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/flock.cc4
-rw-r--r--winsup/cygwin/release/2.3.15
3 files changed, 12 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 7876e2c..19168d5 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2015-11-12 Corinna Vinschen <corinna@vinschen.de>
+ * flock.cc (lockf_t::create_lock_obj): Correctly recreate lock object
+ attributes anew in each loop.
+
+2015-11-12 Corinna Vinschen <corinna@vinschen.de>
+
* init.cc (munge_threadfunc): Don't call NtQueryInformationThread with
ThreadQuerySetWin32StartAddress info class on XP 64 and Server 2003 64.
It crashes.
diff --git a/winsup/cygwin/flock.cc b/winsup/cygwin/flock.cc
index 0ac5548..f7c04c8 100644
--- a/winsup/cygwin/flock.cc
+++ b/winsup/cygwin/flock.cc
@@ -766,12 +766,12 @@ lockf_t::create_lock_obj ()
{
lockfattr_t attr;
NTSTATUS status;
+ PSECURITY_DESCRIPTOR sd_buf = alloca (SD_MIN_SIZE);
POBJECT_ATTRIBUTES lock_obj_attr;
- lock_obj_attr = create_lock_obj_attr (&attr, OBJ_INHERIT,
- alloca (SD_MIN_SIZE));
do
{
+ lock_obj_attr = create_lock_obj_attr (&attr, OBJ_INHERIT, sd_buf);
status = NtCreateEvent (&lf_obj, CYG_EVENT_ACCESS, lock_obj_attr,
NotificationEvent, FALSE);
if (!NT_SUCCESS (status))
diff --git a/winsup/cygwin/release/2.3.1 b/winsup/cygwin/release/2.3.1
index 5299d23..a552ee8 100644
--- a/winsup/cygwin/release/2.3.1
+++ b/winsup/cygwin/release/2.3.1
@@ -12,3 +12,8 @@ Bug Fixes
- The fix for wine introduced in 2.3.0 crashes in 32 bit Cygwin on 64 bit XP
and 64 bit Server 2003 only. This should work now.
Addresses: https://cygwin.com/ml/cygwin/2015-11/msg00187.html
+
+- The fix to avoid a potential crash in advisory file locking introduced in
+ 2.3.0 waas not entirely correct and failed to work in certain border cases.
+ This should work now.
+ Addresses: https://cygwin.com/ml/cygwin/2015-11/msg00189.html