Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 10 Jan 2018 09:25:20 -0600 (CST)
From: Christopher Lameter <cl@...ux.com>
To: Kees Cook <keescook@...omium.org>
cc: linux-kernel@...r.kernel.org, 
    Linus Torvalds <torvalds@...ux-foundation.org>, 
    David Windsor <dave@...lcore.net>, 
    Alexander Viro <viro@...iv.linux.org.uk>, 
    Andrew Morton <akpm@...ux-foundation.org>, 
    Andy Lutomirski <luto@...nel.org>, Christoph Hellwig <hch@...radead.org>, 
    "David S. Miller" <davem@...emloft.net>, Laura Abbott <labbott@...hat.com>, 
    Mark Rutland <mark.rutland@....com>, 
    "Martin K. Petersen" <martin.petersen@...cle.com>, 
    Paolo Bonzini <pbonzini@...hat.com>, 
    Christian Borntraeger <borntraeger@...ibm.com>, 
    Christoffer Dall <christoffer.dall@...aro.org>, 
    Dave Kleikamp <dave.kleikamp@...cle.com>, Jan Kara <jack@...e.cz>, 
    Luis de Bethencourt <luisbg@...nel.org>, 
    Marc Zyngier <marc.zyngier@....com>, Rik van Riel <riel@...hat.com>, 
    Matthew Garrett <mjg59@...gle.com>, linux-fsdevel@...r.kernel.org, 
    linux-arch@...r.kernel.org, netdev@...r.kernel.org, linux-mm@...ck.org, 
    kernel-hardening@...ts.openwall.com
Subject: Re: [PATCH 02/36] usercopy: Include offset in overflow report

On Tue, 9 Jan 2018, Kees Cook wrote:

> -static void report_usercopy(unsigned long len, bool to_user, const char *type)
> +int report_usercopy(const char *name, const char *detail, bool to_user,
> +		    unsigned long offset, unsigned long len)
>  {
> -	pr_emerg("kernel memory %s attempt detected %s '%s' (%lu bytes)\n",
> +	pr_emerg("kernel memory %s attempt detected %s %s%s%s%s (offset %lu, size %lu)\n",
>  		to_user ? "exposure" : "overwrite",
> -		to_user ? "from" : "to", type ? : "unknown", len);
> +		to_user ? "from" : "to",
> +		name ? : "unknown?!",
> +		detail ? " '" : "", detail ? : "", detail ? "'" : "",
> +		offset, len);
>  	/*
>  	 * For greater effect, it would be nice to do do_group_exit(),
>  	 * but BUG() actually hooks all the lock-breaking and per-arch
>  	 * Oops code, so that is used here instead.
>  	 */
>  	BUG();

Should this be a WARN() or so? Or some configuration that changes
BUG() behavior? Otherwise

> +
> +	return -1;

This return code will never be returned.

Why a return code at all? Maybe I will see that in the following patches?


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.