public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "sapatel at redhat dot com" <sourceware-bugzilla@sourceware.org>
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	[thread overview]
Message-ID: <bug-25298-6586@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=25298

            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 = 0; i < nblocks; ++i)
     if (!visited[i])
       delete p.blocks[i]; 

--------------------------------------------------------------------------------

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 Block
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.

             reply	other threads:[~2019-12-19 17:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19 17:24 sapatel at redhat dot com [this message]
2019-12-19 17:24 ` [Bug bpf/25298] " sapatel at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-25298-6586@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).