From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 69A938D9C for ; Fri, 27 Apr 2018 18:02:17 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 09:02:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,335,1520924400"; d="scan'208";a="36670787" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.252.25.158]) ([10.252.25.158]) by orsmga007.jf.intel.com with ESMTP; 27 Apr 2018 09:02:14 -0700 To: "Van Haaren, Harry" , "dev@dpdk.org" Cc: "thomas@monjalon.net" References: From: "Burakov, Anatoly" Message-ID: <35f02a7f-b5be-9f04-2126-8fa4e3687ae0@intel.com> Date: Fri, 27 Apr 2018 17:02:14 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 3/3] malloc: fix potential dereferencing of NULL pointer X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 16:02:17 -0000 On 27-Apr-18 4:57 PM, Van Haaren, Harry wrote: >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Anatoly Burakov >> Sent: Wednesday, April 25, 2018 11:16 AM >> To: dev@dpdk.org >> Cc: thomas@monjalon.net; Burakov, Anatoly >> Subject: [dpdk-dev] [PATCH v2 3/3] malloc: fix potential dereferencing of NULL >> pointer >> >> Previous code checked for both first/last elements being NULL, >> but if they weren't, the expectation was that they're both >> non-NULL, which will be the case under normal conditions, but >> may not be the case due to heap structure corruption. >> >> Coverity issue: 272566 >> >> Fixes: bb372060dad4 ("malloc: make heap a doubly-linked list") >> Cc: anatoly.burakov@intel.com >> >> Signed-off-by: Anatoly Burakov > > Had to do a double-take there - that's a novel way of checking > pointers - but it actually makes sense here :) > > Acked-by: Harry van Haaren > It's basically a logical XOR :) Thanks for reviewing! -- Thanks, Anatoly