From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11107 invoked by alias); 9 May 2014 11:48:53 -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 11091 invoked by uid 89); 9 May 2014 11:48:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail.ecoscentric.com Received: from hagrid.ecoscentric.com (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 09 May 2014 11:48:51 +0000 Received: by mail.ecoscentric.com (Postfix, from userid 48) id 175784680025; Fri, 9 May 2014 12:48:48 +0100 (BST) From: bugzilla-daemon@bugs.ecos.sourceware.org To: unassigned@bugs.ecos.sourceware.org Subject: [Bug 1001982] New: scheduler must be unlocked atomically on thread_entry (in SMP systems) Date: Fri, 09 May 2014 11:48:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: eCos X-Bugzilla-Component: Kernel X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: christoph.borchert@tu-dortmund.de 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: 2014/txt/msg00171.txt.bz2 Please do not reply to this email, use the link below. http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001982 Bug ID: 1001982 Summary: scheduler must be unlocked atomically on thread_entry (in SMP systems) Product: eCos Version: 3.0 Target: All Architecture/Host All OS: Status: UNCONFIRMED Severity: critical Priority: low Component: Kernel Assignee: unassigned@bugs.ecos.sourceware.org Reporter: christoph.borchert@tu-dortmund.de CC: ecos-bugs@ecos.sourceware.org Created attachment 2507 --> http://bugs.ecos.sourceware.org/attachment.cgi?id=2507&action=edit patch Dear eCos developers, on thread startup, the scheduler lock gets unlocked in a loop, testing the lock status in each loop iteration: while( get_sched_lock() != 0 ) unlock(); On an SMP system (or any other multi-core system), this piece of code is not valid. Once the lock reaches zero, it could be taken immediately by another CPU. In such a case, one CPU decrements the scheduler lock held by another CPU - eventually corrupting kernel data or crashing the system. Attached is a patch that solves this issue (and which is still valid for single-core systems). Best regards, Christoph -- You are receiving this mail because: You are the assignee for the bug.