]> sourceware.org Git - newlib-cygwin.git/commitdiff
flock: Fix hang in object collision case
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 12 Nov 2015 12:14:08 +0000 (13:14 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 12 Nov 2015 12:14:08 +0000 (13:14 +0100)
* flock.cc (lockf_t::create_lock_obj): Correctly recreate lock object
attributes anew in each loop.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/ChangeLog
winsup/cygwin/flock.cc
winsup/cygwin/release/2.3.1

index 8e40c2f31fe4b3bd47ad7da754b89f79deabac1f..bdaab408c92121823f4624daf65e96e17a0476d6 100644 (file)
@@ -1,3 +1,8 @@
+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
index 0ac55485bb2516a21031a4dcbcef5337ba76e50e..f7c04c8e1156060ad97f76df3c2c56c14cdb9589 100644 (file)
@@ -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))
index 5299d2304abb0c62351f25cb1be71ab9b9a605f9..a552ee812e1f49bd3c64acab79d3a746b7fb43f2 100644 (file)
@@ -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
This page took 0.036203 seconds and 5 git commands to generate.