From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19369 invoked by alias); 10 Nov 2013 18:33:17 -0000 Mailing-List: contact ecos-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-bugs-owner@sourceware.org Received: (qmail 19355 invoked by uid 89); 10 Nov 2013 18:33:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail.ecoscentric.com Received: from Unknown (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sun, 10 Nov 2013 18:31:27 +0000 Received: by mail.ecoscentric.com (Postfix, from userid 48) id A030E4680003; Sun, 10 Nov 2013 18:31:17 +0000 (GMT) From: bugzilla-daemon@bugs.ecos.sourceware.org To: unassigned@bugs.ecos.sourceware.org Subject: [Bug 1001913] New: Calling restart_rx outside cyg_drv_dsr_lock/unlock in serial_get_config: possibly a race condition? Date: Sun, 10 Nov 2013 18:33:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: eCos X-Bugzilla-Component: Serial X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vlad_a_pudovkin@hotmail.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: low X-Bugzilla-Assigned-To: unassigned@bugs.ecos.sourceware.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://bugs.ecos.sourceware.org/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013/txt/msg00638.txt.bz2 Please do not reply to this email, use the link below. http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001913 Bug ID: 1001913 Summary: Calling restart_rx outside cyg_drv_dsr_lock/unlock in serial_get_config: possibly a race condition? Product: eCos Version: 3.0 Target: All Architecture/Host All OS: Status: UNCONFIRMED Severity: normal Priority: low Component: Serial Assignee: unassigned@bugs.ecos.sourceware.org Reporter: vlad_a_pudovkin@hotmail.com CC: ecos-bugs@ecos.sourceware.org I'm not quite sure this is a bug, but this snippet below seems to be the only place in the serial IO code where restart_rx (and the data it accesses) is used outside of the cyg_drv_dsr_lock/unlock pair, which just stood out for me: // File: packages/io/serial//src/common/serial.c // Function: serial_get_config * * * cyg_drv_dsr_unlock(); cyg_drv_mutex_unlock(&in_cbuf->lock); #ifdef CYGPKG_IO_SERIAL_FLOW_CONTROL // Restart receiver if it was shutdown if ((chan->flow_desc.flags & CYG_SERIAL_FLOW_IN_THROTTLED) != 0) { restart_rx( chan, false ); } #endif Wouldn't it be more correct (or at least more consistent) to move this if-statement right prior to unlocking the DSRs and the mutex? If not, why? -- You are receiving this mail because: You are the assignee for the bug.