]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - ipc/mqueue.c
mqueue: fix a use-after-free in sys_mq_notify()
[karo-tx-linux.git] / ipc / mqueue.c
index c9ff943f19abc68158278a0221c6e8a6e432fec5..eb1391b52c6f84fe75dec4e8366d858341ac665a 100644 (file)
@@ -1270,8 +1270,10 @@ retry:
 
                        timeo = MAX_SCHEDULE_TIMEOUT;
                        ret = netlink_attachskb(sock, nc, &timeo, NULL);
-                       if (ret == 1)
+                       if (ret == 1) {
+                               sock = NULL;
                                goto retry;
+                       }
                        if (ret) {
                                sock = NULL;
                                nc = NULL;