lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160817092016.30f8fc5c@gandalf.local.home>
Date:	Wed, 17 Aug 2016 09:20:16 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Kees Cook <keescook@...omium.org>
Cc:	"Paul E . McKenney" <paulmck@...ux.vnet.ibm.com>,
	Laura Abbott <labbott@...hat.com>,
	Stephen Boyd <sboyd@...eaurora.org>,
	Daniel Micay <danielmicay@...il.com>,
	Joe Perches <joe@...ches.com>, Arnd Bergmann <arnd@...db.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Josh Triplett <josh@...htriplett.org>,
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
	Lai Jiangshan <jiangshanlai@...il.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
	Michael Ellerman <mpe@...erman.id.au>,
	Dan Williams <dan.j.williams@...el.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Ingo Molnar <mingo@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Josef Bacik <jbacik@...com>,
	Andrey Ryabinin <aryabinin@...tuozzo.com>,
	Tejun Heo <tj@...nel.org>,
	Nikolay Aleksandrov <nikolay@...ulusnetworks.com>,
	Dmitry Vyukov <dvyukov@...gle.com>,
	linux-kernel@...r.kernel.org, kernel-hardening@...ts.openwall.com
Subject: Re: [PATCH v2 4/5] bug: Provide toggle for BUG on data corruption

On Tue, 16 Aug 2016 17:20:28 -0700
Kees Cook <keescook@...omium.org> wrote:


>  EXPORT_SYMBOL(__list_add_valid);
> @@ -46,26 +41,18 @@ bool __list_del_entry_valid(struct list_head *entry)
>  	prev = entry->prev;
>  	next = entry->next;
>  
> -	if (unlikely(next == LIST_POISON1)) {
> -		WARN(1, "list_del corruption, %p->next is LIST_POISON1 (%p)\n",
> -			entry, LIST_POISON1);
> -		return false;
> -	}
> -	if (unlikely(prev == LIST_POISON2)) {
> -		WARN(1, "list_del corruption, %p->prev is LIST_POISON2 (%p)\n",
> -			entry, LIST_POISON2);
> -		return false;
> -	}
> -	if (unlikely(prev->next != entry)) {
> -		WARN(1, "list_del corruption. prev->next should be %p, but was %p\n",
> -			entry, prev->next);
> -		return false;
> -	}
> -	if (unlikely(next->prev != entry)) {
> -		WARN(1, "list_del corruption. next->prev should be %p, but was %p\n",
> -			entry, next->prev);
> -		return false;
> -	}
> +	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,
> +		"list_del corruption, %p->prev is LIST_POISON2 (%p)\n",
> +		entry, LIST_POISON2);
> +	CHECK_DATA_CORRUPTION(prev->next != entry,
> +		"list_del corruption. prev->next should be %p, but was %p\n",
> +		entry, prev->next);
> +	CHECK_DATA_CORRUPTION(next->prev != entry,
> +		"list_del corruption. next->prev should be %p, but was %p\n",
> +		entry, next->prev);

OK, you totally rewrote the WARN() section anyway, thus ignore my
comment on the previous email.

-- Steve

>  	return true;
>  
>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ