DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: "Lin, Xueqin" <xueqin.lin@intel.com>
Cc: "Peng, ZhihongX" <zhihongx.peng@intel.com>,
	"Burakov, Anatoly" <anatoly.burakov@intel.com>,
	 "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
	 Stephen Hemminger <stephen@networkplumber.org>,
	dpdk-dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [RFC v2] porting AddressSanitizer feature to DPDK
Date: Wed, 16 Jun 2021 17:04:52 +0530	[thread overview]
Message-ID: <CALBAE1PdQXOXkbYXF8w73U5z_J7LC6T0aGEhC=WiqE_6gNHXEw@mail.gmail.com> (raw)
In-Reply-To: <BN7PR11MB2658E9AC54CE77137688DE97940F9@BN7PR11MB2658.namprd11.prod.outlook.com>

On Wed, Jun 16, 2021 at 2:43 PM Lin, Xueqin <xueqin.lin@intel.com> wrote:
>
> > -----Original Message-----
> > From: Jerin Jacob <jerinjacobk@gmail.com>
> > Sent: Tuesday, June 15, 2021 4:40 PM
> > To: Peng, ZhihongX <zhihongx.peng@intel.com>
> > Cc: Burakov, Anatoly <anatoly.burakov@intel.com>; Ananyev, Konstantin
> > <konstantin.ananyev@intel.com>; Stephen Hemminger
> > <stephen@networkplumber.org>; dpdk-dev <dev@dpdk.org>; Lin, Xueqin
> > <xueqin.lin@intel.com>
> > Subject: Re: [dpdk-dev] [RFC v2] porting AddressSanitizer feature to DPDK
> >
> > On Tue, Jun 15, 2021 at 1:46 PM <zhihongx.peng@intel.com> wrote:
> > >
> > > From: Zhihong Peng <zhihongx.peng@intel.com>
> > >
> > > AddressSanitizer (ASan) is a google memory error detect standard tool.
> > > It could help to detect use-after-free and {heap,stack,global}-buffer
> > > overflow bugs in C/C++ programs, print detailed error information when
> > > error happens, large improve debug efficiency.
> > >
> > > By referring to its implementation algorithm
> > > (https://github.com/google/sanitizers/wiki/AddressSanitizerAlgorithm),
> > > ported heap-buffer-overflow and use-after-freefunctions to dpdk.
> > >
> > > Here is an example of heap-buffer-overflow bug:
> > >         ......
> > >         char *p = rte_zmalloc(NULL, 7, 0);
> > >         p[7] = 'a';
> > >         ......
> > >
> > > Here is an example of use-after-free bug:
> > >         ......
> > >         char *p = rte_zmalloc(NULL, 7, 0);
> > >         rte_free(p);
> > >         *p = 'a';
> > >         ......
> > >
> > > If you want to use this feature,
> > > you need to use the following compilation options:
> > > -Db_lundef=false -Db_sanitize=address
> >
> > # Thanks for this patch. It is a useful item.
> >
> > # Subject could be changed
> > from:
> > porting AddressSanitizer feature to DPDK to
> > eal: support for  AddressSanitizer
> > or so
>
> Thanks for your positive feedback and review.
> Good point, we will update the title in next version.
>
> >
> > # Could you add a section in the documentation for Sanitizers to document the
> > build time option and other points that users need to know.
>
> Make sense to add build option and key points to document, will add this part in doc
folder.
>
> > We can add other sanitizers such as UBSan etc in the future here
> WIP to research other sanitizer tool.

UBsan is a good candate.
Some old DPDK patch for the same:
http://patches.dpdk.org/project/dpdk/patch/1573832013-18946-1-git-send-email-hkalra@marvell.com/

> >
> > # Add a UT test case to make sure it is working in app/test or so.
>
> This tool could help to detect memory issue, need to change bad code to check if working.

It is better to have a  UT to test things are working. You could add it in
app/test/test_address_sanity.c. Tests can be such that
- Skip if not complied with Sanity enabled
- Pass if the code detects the known bad code. You can have test cases
with pubic rte_ API
that internally exercise the verify your implementation related to
new asan_* APIs.


> Suggest listing demo code and tool capture information for user to try if tool works, also add this part into doc.
>
> >
> > # Also, Please update the release note for this feature.
> Sure, we can update the release note if code merge.

Probably you can send v1 version next i.e change the RFC status to get merged.


>

  reply	other threads:[~2021-06-16 11:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10  5:13 [dpdk-dev] [RFC] " zhihongx.peng
2021-06-10  8:32 ` Bruce Richardson
2021-06-11  4:42   ` Lin, Xueqin
2021-06-10  9:12 ` Ananyev, Konstantin
2021-06-11  4:49   ` Lin, Xueqin
2021-06-10 20:03 ` Stephen Hemminger
2021-06-11  6:15   ` Lin, Xueqin
2021-06-15  8:12 ` [dpdk-dev] [RFC v2] " zhihongx.peng
2021-06-15  8:40   ` Jerin Jacob
2021-06-16  9:13     ` Lin, Xueqin
2021-06-16 11:34       ` Jerin Jacob [this message]
2021-06-18  7:48         ` Lin, Xueqin
2021-06-18  9:04           ` David Marchand
2021-06-22  3:26             ` Lin, Xueqin
2021-06-28 14:22             ` Burakov, Anatoly
2021-06-28 14:23               ` Jerin Jacob
2021-06-30  8:15               ` Lin, Xueqin
2021-06-30  8:34               ` David Marchand
2021-07-01  6:48                 ` Lin, Xueqin
2021-07-01  7:40                   ` David Marchand
2021-07-02 11:05                     ` Lin, Xueqin
2021-07-06 20:40   ` David Christensen
2021-07-06 23:12     ` Stephen Hemminger

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='CALBAE1PdQXOXkbYXF8w73U5z_J7LC6T0aGEhC=WiqE_6gNHXEw@mail.gmail.com' \
    --to=jerinjacobk@gmail.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=stephen@networkplumber.org \
    --cc=xueqin.lin@intel.com \
    --cc=zhihongx.peng@intel.com \
    /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 NNTP newsgroup(s).