linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Rustam Subkhankulov <subkhankulov@ispras.ru>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alexey Khoroshilov <khoroshilov@ispras.ru>,
	ldv-project@linuxtesting.org
Subject: Re: [PATCH v2] fs/inode.c: change the order of initialization in inode_init_always()
Date: Thu, 1 Sep 2022 00:59:46 +0100	[thread overview]
Message-ID: <Yw/18jnzW8fA3BYd@ZenIV> (raw)
In-Reply-To: <20220829192521.694631-1-subkhankulov@ispras.ru>

On Mon, Aug 29, 2022 at 10:25:21PM +0300, Rustam Subkhankulov wrote:
> If function security_inode_alloc() returns a nonzero value due to an
> error (e.g. fail to allocate memory), then some of the fields, including
> 'i_private', will not be initialized.
> 
> After that, if the fs-specfic free_inode function is called in
> i_callback(), the nonzero value of 'i_private' field can be interpreted
> as initialized. As a result, this can cause dereferencing of random
> value pointer (e.g. nilfs2).
> 
> In earlier versions, a similar situation could occur with the 'u' union
> in 'inode' structure.

See vfs.git#work.inode (included into #for-next); I agree that your
commit message looks better, but...

      reply	other threads:[~2022-09-01  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-27 14:09 [PATCH] fs/inode.c: change the order of initialization in inode_init_always() Alexey Khoroshilov
2022-08-29 14:15 ` Christian Brauner
2022-08-29 19:25   ` [PATCH v2] " Rustam Subkhankulov
2022-08-31 23:59     ` Al Viro [this message]

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=Yw/18jnzW8fA3BYd@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=khoroshilov@ispras.ru \
    --cc=ldv-project@linuxtesting.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=subkhankulov@ispras.ru \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).