linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] WARN fibmap user in case of possible addr truncation
@ 2020-04-24  7:22 Ritesh Harjani
  2020-04-24  7:22 ` [PATCH 1/2] fibmap: Warn and return an error in case of block > INT_MAX Ritesh Harjani
  2020-04-24  7:22 ` [PATCH 2/2] iomap: bmap: Remove the WARN and return the proper block address Ritesh Harjani
  0 siblings, 2 replies; 16+ messages in thread
From: Ritesh Harjani @ 2020-04-24  7:22 UTC (permalink / raw)
  To: linux-fsdevel, linux-xfs
  Cc: Alexander Viro, Darrick J . Wong, Christoph Hellwig, Jan Kara,
	tytso, Aneesh Kumar K . V, linux-ext4, Ritesh Harjani

Currently an ioctl_fibmap() caller may get a truncated and wrong block map
address if the actual mapped physical block address is > INT_MAX.
If that is the case then lets:-
1. Add a warning,
2. Returns 0 in the block mapped address,
3. And also return -ERANGE error.
This is better than providing a wrong information to the user about the
block mapping which in the worst case could cause a FS corruption
(unknowingly by the caller since kernel didn't warn).
Currently these checks are in place only for the filesystems who uses iomap
based bmap interface. So let's do this right thing for all the fibmap()
callers by adding this logic in ioctl_fibmap() directly.

Patch-1 & Patch-2 commit msg may provide additional information.

Ritesh Harjani (2):
  fibmap: Warn and return an error in case of block > INT_MAX
  iomap: bmap: Remove the WARN and return the proper block address

 fs/ioctl.c        | 5 +++++
 fs/iomap/fiemap.c | 5 +----
 2 files changed, 6 insertions(+), 4 deletions(-)

-- 
2.21.0


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

end of thread, other threads:[~2020-04-28  7:30 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-24  7:22 [PATCH 0/2] WARN fibmap user in case of possible addr truncation Ritesh Harjani
2020-04-24  7:22 ` [PATCH 1/2] fibmap: Warn and return an error in case of block > INT_MAX Ritesh Harjani
2020-04-24  9:57   ` Jan Kara
2020-04-24 10:07   ` Christoph Hellwig
2020-04-24 19:17   ` Eric Biggers
2020-04-24 22:54     ` Ritesh Harjani
2020-04-24 23:40       ` Matthew Wilcox
2020-04-24 23:46         ` Darrick J. Wong
2020-04-25  7:03           ` Ritesh Harjani
2020-04-27  1:04             ` Dave Chinner
2020-04-28  7:29               ` Ritesh Harjani
2020-04-24  7:22 ` [PATCH 2/2] iomap: bmap: Remove the WARN and return the proper block address Ritesh Harjani
2020-04-24  9:59   ` Jan Kara
2020-04-24 10:07   ` Christoph Hellwig
2020-04-24 17:48   ` Darrick J. Wong
2020-04-24 22:39     ` Ritesh Harjani

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