Skip to content

Commit 83aeff8

Browse files
dhowellsaxboe
authored andcommitted
splice: Make filemap_splice_read() check s_maxbytes
Make filemap_splice_read() check s_maxbytes analogously to filemap_read(). Signed-off-by: David Howells <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Christian Brauner <[email protected]> cc: Steve French <[email protected]> cc: Jens Axboe <[email protected]> cc: Al Viro <[email protected]> cc: David Hildenbrand <[email protected]> cc: John Hubbard <[email protected]> cc: [email protected] cc: [email protected] cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent c372220 commit 83aeff8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mm/filemap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2887,6 +2887,9 @@ ssize_t filemap_splice_read(struct file *in, loff_t *ppos,
28872887
bool writably_mapped;
28882888
int i, error = 0;
28892889

2890+
if (unlikely(*ppos >= in->f_mapping->host->i_sb->s_maxbytes))
2891+
return 0;
2892+
28902893
init_sync_kiocb(&iocb, in);
28912894
iocb.ki_pos = *ppos;
28922895

0 commit comments

Comments
 (0)