linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.9 01/13] xfs: fix partially uninitialized structure in xfs_reflink_remap_extent
@ 2020-04-24 12:24 Sasha Levin
  2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 02/13] ALSA: hda: Don't release card at firmware loading error Sasha Levin
                   ` (11 more replies)
  0 siblings, 12 replies; 15+ messages in thread
From: Sasha Levin @ 2020-04-24 12:24 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Darrick J. Wong, Brian Foster, Sasha Levin, linux-xfs

From: "Darrick J. Wong" <darrick.wong@oracle.com>

[ Upstream commit c142932c29e533ee892f87b44d8abc5719edceec ]

In the reflink extent remap function, it turns out that uirec (the block
mapping corresponding only to the part of the passed-in mapping that got
unmapped) was not fully initialized.  Specifically, br_state was not
being copied from the passed-in struct to the uirec.  This could lead to
unpredictable results such as the reflinked mapping being marked
unwritten in the destination file.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/xfs/xfs_reflink.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
index 17d3c964a2a23..6b753b969f7b8 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -1162,6 +1162,7 @@ xfs_reflink_remap_extent(
 		uirec.br_startblock = irec->br_startblock + rlen;
 		uirec.br_startoff = irec->br_startoff + rlen;
 		uirec.br_blockcount = unmap_len - rlen;
+		uirec.br_state = irec->br_state;
 		unmap_len = rlen;
 
 		/* If this isn't a real mapping, we're done. */
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-05-01  0:56 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-24 12:24 [PATCH AUTOSEL 4.9 01/13] xfs: fix partially uninitialized structure in xfs_reflink_remap_extent Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 02/13] ALSA: hda: Don't release card at firmware loading error Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 03/13] ALSA: hda: Keep the controller initialization even if no codecs found Sasha Levin
2020-04-24 12:45   ` Takashi Iwai
2020-05-01  0:56     ` Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 04/13] scsi: target: fix PR IN / READ FULL STATUS for FC Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 05/13] scsi: sg: add sg_remove_request in sg_common_write Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 06/13] objtool: Fix CONFIG_UBSAN_TRAP unreachable warnings Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 07/13] objtool: Support Clang non-section symbols in ORC dump Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 08/13] objtool: Fix switch table detection in .text.unlikely Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 09/13] xen/xenbus: ensure xenbus_map_ring_valloc() returns proper grant status Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 10/13] net/cxgb4: Check the return from t4_query_params properly Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 11/13] ext4: convert BUG_ON's to WARN_ON's in mballoc.c Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 12/13] of: unittest: kmemleak on changeset destroy Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 13/13] hwmon: (jc42) Fix name to have no illegal characters Sasha Levin

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).