From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 69648A0C53; Wed, 3 Nov 2021 16:00:49 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 355A941153; Wed, 3 Nov 2021 16:00:49 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 5E00341134 for ; Wed, 3 Nov 2021 16:00:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635951646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IfwrhJxe72slH4vFK5Lx2d5ZPcdC9wQ4RwToMbZ5DPY=; b=T358v05QnNCOvhIrzLkBWBGq3sDpAGRa1fKc5vGzcsWBPrQxy3FFVSPV86cAvKxDcPhhPu K1LrenC+1Quy0f1NObWY4/w9e1MaINtAiUJpxeNKwLBKqvbsAgIJKh0PppxFV8slUyhRW3 onhRoe7OYoDoLrnsv7KmDjmx+5qHUAo= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-350-fZD_cbSdPCmkVnJteSUJVA-1; Wed, 03 Nov 2021 11:00:40 -0400 X-MC-Unique: fZD_cbSdPCmkVnJteSUJVA-1 Received: by mail-lf1-f70.google.com with SMTP id f11-20020ac24e4b000000b004001e7ea61cso740805lfr.6 for ; Wed, 03 Nov 2021 08:00:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IfwrhJxe72slH4vFK5Lx2d5ZPcdC9wQ4RwToMbZ5DPY=; b=fMOXwiJnb7iWLg4OFQf3OI5ZQ5O/vv9T8y8450FsgxVyoSvg5/16eViOGtnUjNLUzw VeMiqI3swd/TZ7aFY9Q/MDRr+6oOjc1je6OjNRPId0fb37GYkZo0s3Hz8db0HONU+40z pnXIKYK4VVSHKkUH4ownaBM+VHFjlVefHmY+DkWndE6UMWwsdcJ/p0XsbMJ2RzMwMWox MvkJbCt+7g9kJDtYNNljF0OIL12ZxYHj/QjBXqYcV6TPQyhxuvUdHZXltB6bR7BALvPE lU2MhLH42d0+jGmRhd1BCFCTCIC3nrSgLa6oV+kNioRJGkSen+FQKS8LEqvQuY+fhR9P 6sVg== X-Gm-Message-State: AOAM530GpoJOGn2b5HU2ZvJSviKIw4hwKRbMJPYSGf6k1sUnYWD5P4tv N2pT+JR8FA2hWO0hlLZbKfXwEBndisw4aE3787FnOb4ziciCwHkbDYOjFMpELkn3aPFP9ibZa0w 2aXCBoOGF+3DWe0ZYth4= X-Received: by 2002:a05:6512:3e11:: with SMTP id i17mr40059199lfv.560.1635951638514; Wed, 03 Nov 2021 08:00:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAqXi1jzurgeqcnviQl2hpTsrY8lYGOFf1MgI9vcrpaRTZEBjZJ+zyUHms5PRACNkci6Hbeq+tX1X7xZd7Bb4= X-Received: by 2002:a05:6512:3e11:: with SMTP id i17mr40059161lfv.560.1635951638183; Wed, 03 Nov 2021 08:00:38 -0700 (PDT) MIME-Version: 1.0 References: <20211029121544.13298-1-olivier.matz@6wind.com> In-Reply-To: <20211029121544.13298-1-olivier.matz@6wind.com> From: David Marchand Date: Wed, 3 Nov 2021 16:00:26 +0100 Message-ID: To: Olivier Matz Cc: dev , Lavanya Govindarajan , Reshma Pattan , dpdk stable Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] test/mbuf: fix access to freed memory X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Oct 29, 2021 at 2:16 PM Olivier Matz wrote: > > Seen by ASan. > > In the external buffer mbuf test, we check that the buffer is freed > by checking that its refcount is 0. This is not a valid condition, > because it accesses to an already freed area. > > Fix this by setting a boolean flag in the callback when rte_free() > is actually called, and check this flag instead. > > Bugzilla ID: 867 > Fixes: 7b295dceea07 ("test/mbuf: add unit test cases") > Cc: stable@dpdk.org > > Reported-by: David Marchand > Signed-off-by: Olivier Matz Reviewed-by: David Marchand -- David Marchand