All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Steve Magnani <magnani@ieee.org>
Cc: Jan Kara <jack@suse.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] udf: fix silent AED tagLocation corruption
Date: Thu, 14 Jan 2021 15:57:40 +0100	[thread overview]
Message-ID: <20210114145740.GA27380@quack2.suse.cz> (raw)
In-Reply-To: <20210107234116.6190-2-magnani@ieee.org>

On Thu 07-01-21 17:41:16, Steve Magnani wrote:
> From: Steven J. Magnani <magnani@ieee.org>
> 
> When extending a file, make sure that the pointer to the last written
> extent does not get adjusted into the header (tag) portion of an
> Allocation Extent Descriptor. Otherwise, a subsequent call to
> udf_update_exents() can clobber the AED's tagLocation field, replacing
> it with the logical block number of a file extent.
> 
> Signed-off-by: Steven J. Magnani <magnani@ieee.org>

Thanks! It took me some time to understand what's the actual problem but
eventually I've understood - I've updated the changelog and a comment to
explain a bit more and merged the patch into my tree.

								Honza

> ---
> --- a/fs/udf/inode.c	2020-12-28 20:51:29.000000000 -0600
> +++ b/fs/udf/inode.c	2021-01-01 19:20:37.163767576 -0600
> @@ -547,11 +547,14 @@ static int udf_do_extend_file(struct ino
>  
>  		udf_write_aext(inode, last_pos, &last_ext->extLocation,
>  				last_ext->extLength, 1);
> -		/*
> -		 * We've rewritten the last extent but there may be empty
> -		 * indirect extent after it - enter it.
> -		 */
> -		udf_next_aext(inode, last_pos, &tmploc, &tmplen, 0);
> +
> +		if (new_block_bytes || prealloc_len) {
> +			/*
> +			 * We've rewritten the last extent but there may be empty
> +			 * indirect extent after it - enter it.
> +			 */
> +			udf_next_aext(inode, last_pos, &tmploc, &tmplen, 0);
> +		}
>  	}
>  
>  	/* Managed to do everything necessary? */
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2021-01-14 14:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07 23:41 [PATCH 0/1] udf: fix silent AED tagLocation corruption Steve Magnani
2021-01-07 23:41 ` [PATCH 1/1] " Steve Magnani
2021-01-14 14:57   ` Jan Kara [this message]
2021-01-13 17:47 ` [PATCH 0/1] " Jan Kara

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=20210114145740.GA27380@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=jack@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magnani@ieee.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.