From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3839 invoked by alias); 19 Dec 2019 17:24:00 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 3284 invoked by uid 48); 19 Dec 2019 17:23:55 -0000 From: "sapatel at redhat dot com" To: systemtap@sourceware.org Subject: [Bug bpf/25298] New: stapbpf unused blocks may cause segmentation fault Date: Thu, 19 Dec 2019 17:24:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: bpf X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sapatel at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2019-q4/txt/msg00081.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D25298 Bug ID: 25298 Summary: stapbpf unused blocks may cause segmentation fault Product: systemtap Version: unspecified Status: NEW Severity: normal Priority: P2 Component: bpf Assignee: systemtap at sourceware dot org Reporter: sapatel at redhat dot com Target Milestone: --- The bpf-optimizer removes any unreachable blocks. As per the current implementation, these blocks are removed in the following manner. ---------------------------------------------------------------------------= ----- // Remove any unreachable blocks. for (unsigned i =3D 0; i < nblocks; ++i) if (!visited[i]) delete p.blocks[i];=20 ---------------------------------------------------------------------------= ----- However, there could be the case where some unused blocks may lead to other unused blocks. For example, Block 1 and Block 3 may be unused blocks, and B= lock 3 leads to Block 1. After Block 1 is deleted, the optimizer will attempt to delete Block 3 as well. At this time, it may run into a segmentation fault = as Block 3 still contains some references to Block 1. This problem has been discovered in the work of PR22315. --=20 You are receiving this mail because: You are the assignee for the bug.