From patchwork Wed Jan 10 00:03:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ronnie Sahlberg X-Patchwork-Id: 10153715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C8B1B602CA for ; Wed, 10 Jan 2018 00:04:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE56225F3E for ; Wed, 10 Jan 2018 00:04:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B27AA268AE; Wed, 10 Jan 2018 00:04:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62FC825F3E for ; Wed, 10 Jan 2018 00:04:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751894AbeAJAEJ (ORCPT ); Tue, 9 Jan 2018 19:04:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32792 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751520AbeAJAEI (ORCPT ); Tue, 9 Jan 2018 19:04:08 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A053C37E79; Wed, 10 Jan 2018 00:04:03 +0000 (UTC) Received: from test1190.test.redhat.com (vpn2-54-60.bne.redhat.com [10.64.54.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id C10A963763; Wed, 10 Jan 2018 00:04:02 +0000 (UTC) From: Ronnie Sahlberg To: linux-cifs Cc: Steve French Subject: [PATCH] list_debug: check prev/next for NULL when checking list_head for validity Date: Wed, 10 Jan 2018 11:03:49 +1100 Message-Id: <20180110000349.14963-2-lsahlber@redhat.com> In-Reply-To: <20180110000349.14963-1-lsahlber@redhat.com> References: <20180110000349.14963-1-lsahlber@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 10 Jan 2018 00:04:08 +0000 (UTC) Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Ronnie Sahlberg --- lib/list_debug.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/list_debug.c b/lib/list_debug.c index a34db8d27667..01ef3f6d4706 100644 --- a/lib/list_debug.c +++ b/lib/list_debug.c @@ -42,7 +42,13 @@ bool __list_del_entry_valid(struct list_head *entry) prev = entry->prev; next = entry->next; - if (CHECK_DATA_CORRUPTION(next == LIST_POISON1, + if (CHECK_DATA_CORRUPTION(next == NULL, + "list_del corruption, %p->next is NULL (%p)\n", + entry, LIST_POISON1) || + CHECK_DATA_CORRUPTION(prev == NULL, + "list_del corruption, %p->prev is NULL (%p)\n", + entry, LIST_POISON2) || + CHECK_DATA_CORRUPTION(next == LIST_POISON1, "list_del corruption, %p->next is LIST_POISON1 (%p)\n", entry, LIST_POISON1) || CHECK_DATA_CORRUPTION(prev == LIST_POISON2,