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 02C2EA0C49; Tue, 15 Jun 2021 10:40:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F0684067A; Tue, 15 Jun 2021 10:40:37 +0200 (CEST) Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) by mails.dpdk.org (Postfix) with ESMTP id 3DB8D40140 for ; Tue, 15 Jun 2021 10:40:36 +0200 (CEST) Received: by mail-il1-f178.google.com with SMTP id h3so14609553ilc.9 for ; Tue, 15 Jun 2021 01:40:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WjyZvPwP3A3GMTGwPwoN/ncoc8KPN4ZyrTP1JDvn9hI=; b=VA2nq54oieoa5gUk8Arii+bCPuau3WRQcSbQwdjiu/tC4HZom6734ZaVE0p6r0x3jR vyzOP6MopGH/l2gLgwLygf5F/gVDy1rGnOGGrD9+D7XjIjrPtWiiuBlE7+Tk6njI401j 5K6ox4z5K8UGXs7qnmWAyDiMza7kpjVOaI7agJIlVnVjEnyHhpOO4D+D6hBUrIxlkOJh Jx97ZiwNOFj34gmdOwq6YeOe7FmGf+j+05mVKYKK7nEy7R71gaIC9MdW1gQ9RpxO+SSP WlMOs8IbROOQ2/wqNPpKcTfjs1SaNPq6HvFGsWChkO70ed7koXn2QKnSUIEHPAZpjZa6 Vt0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WjyZvPwP3A3GMTGwPwoN/ncoc8KPN4ZyrTP1JDvn9hI=; b=k7Qidl+sur48kw1sazvwvsX6mcyuUcEs6ZFnX/JQi/AlZiYT1rWgMjTzdudoQjRVE5 ZpRmQ1/rCyX2nXhCW+ykiB/XNY7Ty33wZuT7ZKRv8etutO4XV4BhsC7ZD0Cryp6+1pVE kP5fOqqgdgIyllqz3qMrAKMaTCOPnxItGuV5OQXv7bY0IZZtZI/ASgx/O9sLp1rv+rFo tn4oZCJvSn2YLR6N814DwG+ZP1sgTdm+JuYwqG9s9bZeJFtKi2928qjYxFwZs0NZMzWE xZ5wPzpFMRwVdjT11M5DPEWsDytjBK4QpmmYnWHjs/GUXg5L4PILoYy/4rJOPJ7Y8wBZ irgA== X-Gm-Message-State: AOAM530p5RJhA+/01eTqWIOTPHLexqyxnqLuejbt7wP/zVzLQB07HklH V4ZNPsmxMWQOZ3rxJVmjNdn1LnHYGJmkiDLaf5g= X-Google-Smtp-Source: ABdhPJx+pd5fLNMeVYZBYxSTLYBfnuypq8Nhhj3HNh9SnC1nBPuZbmRK9DNn+ar9EKPskFfxZX8hyTH9j0+g/O3F4K8= X-Received: by 2002:a05:6e02:1a6a:: with SMTP id w10mr17407720ilv.130.1623746435456; Tue, 15 Jun 2021 01:40:35 -0700 (PDT) MIME-Version: 1.0 References: <20210610051352.48493-1-zhihongx.peng@intel.com> <20210615081205.101071-1-zhihongx.peng@intel.com> In-Reply-To: <20210615081205.101071-1-zhihongx.peng@intel.com> From: Jerin Jacob Date: Tue, 15 Jun 2021 14:10:19 +0530 Message-ID: To: zhihongx.peng@intel.com Cc: Anatoly Burakov , "Ananyev, Konstantin" , Stephen Hemminger , dpdk-dev , xueqin.lin@intel.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [RFC v2] porting AddressSanitizer feature to DPDK 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 Tue, Jun 15, 2021 at 1:46 PM wrote: > > From: Zhihong Peng > > 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 # Could you add a section in the documentation for Sanitizers to document the build time option and other points that users need to know. We can add other sanitizers such as UBSan etc in the future here # Add a UT test case to make sure it is working in app/test or so. # Also, Please update the release note for this feature.