All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Schmitz <schmitzmic@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	syzbot <syzbot+7bb7cd3595533513a9e7@syzkaller.appspotmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	christian.brauner@ubuntu.com,
	Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	jlayton@kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com,
	Matthew Wilcox <willy@infradead.org>,
	ZhangPeng <zhangpeng362@huawei.com>,
	Viacheslav Dubeyko <slava@dubeyko.com>,
	linux-m68k@lists.linux-m68k.org, flar@allandria.com
Subject: Re: [syzbot] [hfs?] WARNING in hfs_write_inode
Date: Fri, 6 Jan 2023 20:09:11 +1300	[thread overview]
Message-ID: <baced5a3-31a3-d104-bf31-87d75fecb8e9@gmail.com> (raw)
In-Reply-To: <1a3d07bf-16f5-71a8-6500-7d37802dbadd@gmail.com>

Hi Linus,

Am 06.01.2023 um 12:46 schrieb Michael Schmitz:
> Hi Linus,
>
> Am 06.01.2023 um 10:53 schrieb Linus Torvalds:
>> On Thu, Jan 5, 2023 at 1:35 PM Michael Schmitz <schmitzmic@gmail.com>
>> wrote:
>>>
>>> Looking at Linus' patch, I wonder whether the missing fd.entrylength
>>> size test in the HFS_IS_RSRC(inode) case was due to the fact that a
>>> file's resource fork may be empty?
>>
>> But if that is the case, then the subsequent hfs_bnode_read would
>> return garbage, no? And then writing it back after the update would be
>> even worse.
>>
>> So adding that
>>
>> +               if (fd.entrylength < sizeof(struct hfs_cat_file))
>> +                       goto out;
>>
>> would seem to be the right thing anyway. No?
>
> Yes, it would seem to be the right thing (in order to avoid further
> corrupting HFS data structures). Returning -EIO might cause a regression
> though.

A brief test on a HFS filesystem image (copy of my yaboot bootstrap 
partition) did not show any regression, so your patch appears to be just 
fine as-is.

Cheers,

	Michael


      reply	other threads:[~2023-01-06  7:09 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04 14:24 [syzbot] [hfs?] WARNING in hfs_write_inode syzbot
2023-01-04 14:43 ` Arnd Bergmann
2023-01-04 19:06   ` Linus Torvalds
2023-01-04 22:33     ` Arnd Bergmann
2023-01-04 22:42       ` John Paul Adrian Glaubitz
2023-01-05  0:36       ` Viacheslav Dubeyko
2023-01-05  4:37         ` Viacheslav Dubeyko
2023-01-05 15:46           ` Matthew Wilcox
2023-01-05 16:45             ` Viacheslav Dubeyko
2023-07-20 15:27               ` Dmitry Vyukov
2023-07-20 17:30                 ` Matthew Wilcox
2023-07-20 17:50                   ` John Paul Adrian Glaubitz
2023-07-20 17:59                     ` Matthew Wilcox
2023-07-20 18:27                       ` Jeff Layton
2023-07-20 22:20                         ` Dave Chinner
2023-07-21  1:03                           ` Finn Thain
2023-07-21  1:11                             ` Matthew Wilcox
2023-07-21  1:25                               ` Michael Schmitz
2023-07-21  1:45                               ` Finn Thain
2023-07-21  6:42                               ` Kirsten Bromilow
2023-07-21  8:14                               ` Finn Thain
2023-07-21 13:10                                 ` Theodore Ts'o
2023-07-20 21:38                       ` Jeffrey Walton
2023-07-20 22:37                         ` Matthew Wilcox
2023-07-20 22:53                           ` Linus Torvalds
2023-07-21  1:28                             ` Mike Hosken
2023-07-20 17:56                   ` John Paul Adrian Glaubitz
2023-07-20 19:05                     ` Michael Schmitz
2023-07-21  5:07                       ` John Paul Adrian Glaubitz
2023-07-21  5:40                 ` Eric W. Biederman
2023-01-05 21:34       ` Michael Schmitz
2023-01-05 21:53         ` Linus Torvalds
2023-01-05 23:46           ` Michael Schmitz
2023-01-06  7:09             ` Michael Schmitz [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=baced5a3-31a3-d104-bf31-87d75fecb8e9@gmail.com \
    --to=schmitzmic@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=christian.brauner@ubuntu.com \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=flar@allandria.com \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=slava@dubeyko.com \
    --cc=syzbot+7bb7cd3595533513a9e7@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=torvalds@linux-foundation.org \
    --cc=willy@infradead.org \
    --cc=zhangpeng362@huawei.com \
    /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.