All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Matthew Wilcox <willy@infradead.org>
Cc: Dmitry Vyukov <dvyukov@google.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: Use struct page for filename
Date: Sun, 8 Apr 2018 05:42:09 +0100	[thread overview]
Message-ID: <20180408044152.GG30522@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20180408031646.GB32632@bombadil.infradead.org>

On Sat, Apr 07, 2018 at 08:16:46PM -0700, Matthew Wilcox wrote:
> On Fri, Apr 06, 2018 at 03:33:36PM +0200, Dmitry Vyukov wrote:
> > On Fri, Apr 6, 2018 at 3:24 PM, syzbot
> > <syzbot+75397ee3df5c70164154@syzkaller.appspotmail.com> wrote:
> > > cache_from_obj: Wrong slab cache. names_cache but object is from kmalloc-96
> > 
> > Al, do you see how this can happen?
> 
> I don't see how it happened, but when looking at this bug, I thought
> "This is very complicated, I think there's a simpler way to handle this".
> 
> Here's a proposal.  It won't apply to any existing tree (depends on a
> couple of local commits), but I think you'll get the general flavour
> of it.  It's mostly compile-tested (build still running, but fs/ and
> kernel/ compiled without issue).

> +struct audit_names;
> +
> +struct filename {
> +	const char		*name;	/* pointer to actual string */
> +	const __user char	*uptr;	/* original userland pointer */
> +	struct audit_names	*aname;
> +};
>  
>  /*
>   * Each physical page in the system has a struct page associated with
> @@ -188,6 +195,7 @@ struct page {
>  			spinlock_t ptl;
>  #endif
>  		};
> +		struct filename filename;
>  	};

Oh, lovely - extra 24 bytes into each struct page.  Plus the delta to
performance due to switching from kmem_cache_alloc to alloc_page.
Negative one, that is...

  reply	other threads:[~2018-04-08  4:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-06 13:24 WARNING in kmem_cache_free syzbot
2018-04-06 13:33 ` Dmitry Vyukov
2018-04-08  3:16   ` Use struct page for filename Matthew Wilcox
2018-04-08  4:42     ` Al Viro [this message]
2018-04-08  5:59   ` WARNING in kmem_cache_free Al Viro
2018-04-08  6:01   ` Matthew Wilcox
2018-04-08 10:26     ` Dmitry Vyukov
2018-04-08 11:18       ` Dmitry Vyukov
2018-04-08 15:31         ` Stephan Müller
2018-04-08 15:41           ` Dmitry Vyukov
2018-04-08 19:07             ` [PATCH] crypto: DRBG - guard uninstantion by lock Stephan Müller
2018-04-08 22:46               ` Theodore Y. Ts'o
2018-04-08 22:46                 ` Theodore Y. Ts'o
2018-04-09  5:40                 ` Stephan Mueller
2018-04-09  7:57                   ` Dmitry Vyukov
2018-04-10 15:23                     ` Dmitry Vyukov
2018-04-10 15:35                       ` Stephan Mueller
2018-04-11 12:29                         ` Dmitry Vyukov
2018-04-11 12:59                           ` Stephan Mueller
2018-04-11 14:26                           ` Stephan Müller
2018-04-11 14:31                             ` [PATCH] crypto: drbg - set freed buffers to NULL Stephan Müller
2018-04-11 17:29                               ` Eric Biggers
2018-04-11 17:29                                 ` Eric Biggers
2018-04-12  6:40                               ` Stephan Müller
2018-04-20 16:54                                 ` Herbert Xu
2018-04-20 16:54                                   ` Herbert Xu
2018-04-11 17:09                             ` [PATCH] crypto: DRBG - guard uninstantion by lock Dmitry Vyukov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180408044152.GG30522@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=dvyukov@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.