From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23301 invoked by alias); 11 Jul 2011 15:40:02 -0000 Received: (qmail 23271 invoked by uid 22791); 11 Jul 2011 15:40:00 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_CB,TW_DL X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Jul 2011 15:39:47 +0000 From: "dlbulk-sourcesredhat at yahoo dot com" To: glibc-bugs@sources.redhat.com Subject: [Bug libc/12981] New: race in aio handle_fildes_io corrupts user memory X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: dlbulk-sourcesredhat at yahoo dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: drepper.fsp at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 11 Jul 2011 15:40:00 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2011-07/txt/msg00044.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=12981 Summary: race in aio handle_fildes_io corrupts user memory Product: glibc Version: 2.14 Status: NEW Severity: critical Priority: P2 Component: libc AssignedTo: drepper.fsp@gmail.com ReportedBy: dlbulk-sourcesredhat@yahoo.com sysdeps/pthread/aio_misc.c: 603 if (aiocbp->aiocb.__return_value == -1) 604 aiocbp->aiocb.__error_code = errno; 605 else 606 aiocbp->aiocb.__error_code = 0; 607 608 /* Send the signal to notify about finished processing of the 609 request. */ 610 __aio_notify (runp); Once aiocb.__error_code is set, a user thread could be polling aio_error and aio_return to process the completed io. aiocbp could be freed in this process. However, __aio_notify dereferences and modifies this memory: sysdeps/pthread/aio_notify.c: 128 #ifdef BROKEN_THREAD_SIGNALS 129 if (__aio_notify_only (&aiocbp->aio_sigevent, req->caller_pid) != 0) 130 #else 131 if (__aio_notify_only (&aiocbp->aio_sigevent) != 0) 132 #endif 133 { 134 /* XXX What shall we do if already an error is set by 135 read/write/fsync? */ 136 aiocbp->__error_code = errno; 137 aiocbp->__return_value = -1; 138 } To fix this race, __aio_notify should be skipped if aiocbp->aio_sigevent.sigev_notify is SIGEV_NONE. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.