From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Burakov, Anatoly" Subject: Re: [PATCH v2 3/3] malloc: fix potential dereferencing of NULL pointer Date: Fri, 27 Apr 2018 17:02:14 +0100 Message-ID: <35f02a7f-b5be-9f04-2126-8fa4e3687ae0@intel.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "thomas@monjalon.net" To: "Van Haaren, Harry" , "dev@dpdk.org" 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) In-Reply-To: Content-Language: en-US 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 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