<html>
    <head>
      <base href="https://bugs.dpdk.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8" class="bz_new_table">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - free called on rte_malloc block in vhost"
   href="https://bugs.dpdk.org/show_bug.cgi?id=1553">1553</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>free called on rte_malloc block in vhost
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>DPDK
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>major
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>vhost/virtio
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dev@dpdk.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>stephen@networkplumber.org
          </td>
        </tr>

        <tr>
          <th>Target Milestone</th>
          <td>---
          </td>
        </tr></table>
      <p>
        <div class="bz_comment_block">
          <pre class="bz_comment_text">If Gcc function attributes are added to rte_malloc, the compiler is able to
detect bugs where free is called on rte_malloc memory such as:

[2737/2957] Compiling C object
examples/dpdk-vhost_blk.p/vhost_blk_vhost_blk.c.o
In function ‘vhost_blk_bdev_construct’,
    inlined from ‘vhost_blk_ctrlr_construct.constprop’ at
../examples/vhost_blk/vhost_blk.c:826:16:
../examples/vhost_blk/vhost_blk.c:779:17: warning: ‘free’ called on pointer
returned from a mismatched allocation function [-Wmismatched-dealloc]
  779 |                 free(bdev);
      |                 ^~~~~~~~~~
../examples/vhost_blk/vhost_blk.c:761:16: note: returned from ‘rte_zmalloc’
  761 |         bdev = rte_zmalloc(NULL, sizeof(*bdev), RTE_CACHE_LINE_SIZE);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          </pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
      <div itemscope itemtype="http://schema.org/EmailMessage">
        <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
          
          <link itemprop="url" href="https://bugs.dpdk.org/show_bug.cgi?id=1553">
          <meta itemprop="name" content="View bug">
        </div>
        <meta itemprop="description" content="Bugzilla bug update notification">
      </div>
    </body>
</html>