linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 2/2] iomap: Add another assertion to inline data handling
Date: Thu, 5 Aug 2021 10:31:25 -0700	[thread overview]
Message-ID: <20210805173125.GG3601405@magnolia> (raw)
In-Reply-To: <20210803193134.1198733-2-willy@infradead.org>

On Tue, Aug 03, 2021 at 08:31:34PM +0100, Matthew Wilcox (Oracle) wrote:
> Check that the file tail does not cross a page boundary.  Requested by
> Andreas.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Looks good,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/iomap/buffered-io.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index 8ee0211bea86..586d9d078ce1 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -215,6 +215,8 @@ static int iomap_read_inline_data(struct inode *inode, struct page *page,
>  	if (PageUptodate(page))
>  		return PAGE_SIZE - poff;
>  
> +	if (WARN_ON_ONCE(size > PAGE_SIZE - poff))
> +		return -EIO;
>  	if (WARN_ON_ONCE(size > PAGE_SIZE -
>  			 offset_in_page(iomap->inline_data)))
>  		return -EIO;
> -- 
> 2.30.2
> 

  reply	other threads:[~2021-08-05 17:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03 19:31 [PATCH 1/2] iomap: Use kmap_local_page instead of kmap_atomic Matthew Wilcox (Oracle)
2021-08-03 19:31 ` [PATCH 2/2] iomap: Add another assertion to inline data handling Matthew Wilcox (Oracle)
2021-08-05 17:31   ` Darrick J. Wong [this message]
2021-08-05 17:31 ` [PATCH 1/2] iomap: Use kmap_local_page instead of kmap_atomic Darrick J. Wong
2021-08-05 17:39   ` Darrick J. Wong
2021-08-05 18:24     ` Matthew Wilcox
2021-08-10 21:18       ` Thomas Gleixner

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=20210805173125.GG3601405@magnolia \
    --to=djwong@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).