mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mickaël Salaün" <mic@digikod.net>
To: Al Viro <viro@ZenIV.linux.org.uk>, Dmitry Vyukov <dvyukov@google.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	syzkaller <syzkaller@googlegroups.com>,
	Kostya Serebryany <kcc@google.com>,
	Alexander Potapenko <glider@google.com>,
	Sasha Levin <sasha.levin@oracle.com>
Subject: Re: fs: NULL deref in atime_needs_update
Date: Sat, 20 Feb 2016 14:25:40 +0100	[thread overview]
Message-ID: <56C86954.6030101@digikod.net> (raw)
In-Reply-To: <20160220035442.GE17997@ZenIV.linux.org.uk>

[-- Attachment #1: Type: text/plain, Size: 1286 bytes --]


On 20/02/2016 04:54, Al Viro wrote:
> On Sat, Feb 20, 2016 at 03:21:27AM +0000, Al Viro wrote:
>> On Fri, Feb 19, 2016 at 08:32:10PM +0100, Dmitry Vyukov wrote:
>>>> BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
>>
>> NULL inode->i_sb, by the look of the offset, but I really don't understand
>> where the hell is that code doing (or how is that instruction going to
>> generate dereferencing of 0x50, for that matter).
> 
> BTW, Mickaël's trace *does* make sense and it's definitely NULL inode->i_sb
> (inode itself - in %rsi, inode->i_sb - in %rdx, offset of s_flags is 0x50,
> the line in question is
>         if ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode))
> 
> What I don't understand is what could possibly have NULL ->i_sb in *any*
> instance of struct inode.
> 

I can also trigger bugs with a bad inode pointer dereference in atime_needs_update: if (inode->i_flags & S_NOATIME)

I think the bug may be somewhere in the nd->depth handling (when its value is 0) in fs/namei.c:get_link(): struct saved *last = nd->stack + nd->depth - 1

Moreover, is it intentional that touch_atime() is called by get_link() even if the access (previously checked with security_file_open(), e.g. by do_last) is denied?


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  reply	other threads:[~2016-02-20 15:54 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05 21:11 Dmitry Vyukov
2016-02-16 23:40 ` Mickaël Salaün
2016-02-19 19:32   ` Dmitry Vyukov
2016-02-20  3:21     ` Al Viro
2016-02-20  3:54       ` Al Viro
2016-02-20 13:25         ` Mickaël Salaün [this message]
2016-02-20 17:10           ` Al Viro
2016-02-20 20:26             ` Mickaël Salaün
2016-02-20 20:50               ` Al Viro
2016-02-22 11:20             ` Dmitry Vyukov
2016-02-22 17:23               ` Al Viro
2016-02-23 15:34                 ` Dmitry Vyukov
2016-02-23 18:17                   ` Al Viro
2016-02-20 10:36       ` Dmitry Vyukov
2016-02-24  3:12   ` Ian Kent
2016-02-24  4:46     ` Al Viro
2016-02-24 10:03       ` Dmitry Vyukov
2016-02-24 10:15         ` Dmitry Vyukov
2016-02-24 13:35           ` Dmitry Vyukov
2016-02-24 15:15             ` Al Viro
2016-02-25  8:29               ` Dmitry Vyukov
2016-02-25 16:39                 ` Al Viro
2016-02-26 21:21                   ` Al Viro
2016-02-26 21:25                     ` Dmitry Vyukov
2016-02-26 22:07                       ` Al Viro
2016-02-27 22:27                         ` Al Viro
2016-02-28 15:43                           ` Dmitry Vyukov
2016-02-28 16:04                             ` Dmitry Vyukov
2016-02-28 17:01                               ` Al Viro
2016-02-28 20:01                                 ` Al Viro
2016-02-29  9:38                                   ` Dmitry Vyukov
2016-02-29 12:34                                     ` Dmitry Vyukov
2016-02-29 16:11                                       ` Al Viro
2016-02-29 13:09                                   ` Al Viro
2016-02-29 15:54                                     ` Dmitry Vyukov
2016-02-29 16:19                                       ` Al Viro
2016-02-29 18:19                                         ` Dmitry Vyukov
2016-03-01  8:59                                           ` Dmitry Vyukov
2016-02-29 16:45                                     ` Linus Torvalds
2016-02-29 16:50                                       ` Al Viro
2016-02-29 17:20                                         ` Al Viro
2016-02-29 17:24                                         ` Linus Torvalds
2016-02-29 13:43                                   ` David Howells

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=56C86954.6030101@digikod.net \
    --to=mic@digikod.net \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=kcc@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sasha.levin@oracle.com \
    --cc=syzkaller@googlegroups.com \
    --cc=viro@ZenIV.linux.org.uk \
    /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

Powered by JetHome