mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ефанов Владислав Александрович" <vefanov@ispras.ru>
To: Jan Kara <jack@suse.cz>
Cc: Jan Kara <jack@suse.com>,
	linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org
Subject: Re: [PATCH] udf: Check return code from udf_update_extents
Date: Tue, 24 Jan 2023 19:42:07 +0300	[thread overview]
Message-ID: <1bd4feeb-ce77-ff6f-17ca-9ef3621e877a@ispras.ru> (raw)
In-Reply-To: <20230124084702.xew5wmbvmj6gz4j6@quack3>

Thank you for information.


Vlad.

On 24.01.2023 11:47, Jan Kara wrote:
> On Fri 20-01-23 12:10:28, Vladislav Efanov wrote:
>> udf_add_aext() does not create new extent and returns ENOSPC if new
>> block was not created by udf_bitmap_new_block(). The caller,
>> udf_insert_aext(), does not check this return code and returns OK to
>> its caller(udf_update_extents). Finally the error is being lost. So
>> an inconsistency in inode.i_size and extents length becomes.
>>
>> Later this inconsistency leads to WARNING:
>>
>> WARNING: CPU: 3 PID: 1104 at fs/udf/truncate.c:226
>>          udf_truncate_extents+0x7e0/0x8e0 fs/udf/truncate.c:226
>>
>> RIP: 0010:udf_truncate_extents+0x7e0/0x8e0 fs/udf/truncate.c:226
>> Call Trace:
>>   udf_write_failed.isra.0+0x173/0x1c0 fs/udf/inode.c:179
>>   udf_write_begin+0x8d/0xb0 fs/udf/inode.c:214
>>   generic_perform_write+0x20a/0x4e0 mm/filemap.c:3333
>>   __generic_file_write_iter+0x252/0x610 mm/filemap.c:3462
>>   udf_file_write_iter+0x2cc/0x4e0 fs/udf/file.c:168
>>   call_write_iter include/linux/fs.h:1904 [inline]
>>   new_sync_write+0x42c/0x660 fs/read_write.c:518
>>   vfs_write+0x75b/0xa40 fs/read_write.c:605
>>
>> Found by Linux Verification Center (linuxtesting.org) with syzkaller.
>>
>> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
>> Signed-off-by: Vladislav Efanov <VEfanov@ispras.ru>
> 
> Thanks for the fix but I have a very similar fix already queued in my tree
> in linux-next: 19fd80de0a8 ("udf: Handle error when adding extent to a
> file").
> 
> 								Honza

      reply	other threads:[~2023-01-24 16:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20  9:10 Vladislav Efanov
2023-01-24  8:47 ` Jan Kara
2023-01-24 16:42   ` Ефанов Владислав Александрович [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=1bd4feeb-ce77-ff6f-17ca-9ef3621e877a@ispras.ru \
    --to=vefanov@ispras.ru \
    --cc=jack@suse.com \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®