util-linux/misc-utils
Tobias Stoeckmann ea62c15276 fincore: Handle large files correctly on 32 bit
If a file is larger than 4 GB on a 32 bit system with large file
support (default), it can happen that not all pages are properly
processed. This happens due to an int truncation (off_t vs size_t).

You can reproduce this on 32 bit with these commands:

$ dd if=/dev/zero of=4gb-file seek=4294967295 count=1 bs=1
$ fincore 4gb-file
fincore: failed to do mmap: 4gb-file: Invalid argument

If a file is larger than 4 GB, the first few pages of a file won't
be properly processed. "len" will be smaller than window_size,
but the for-loop iterates "window_size" bytes, skipping some pages.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2018-02-26 11:54:12 +01:00
..
.gitignore chkdupexe: remove, deprecated for years 2013-03-14 13:34:11 +01:00
Makemodule.am cal: add ifdef TEST_CAL 2018-02-02 10:05:15 +01:00
blkid.8 blkid: improve man page wording 2017-10-16 23:26:45 +02:00
blkid.c misc: consolidate macro style USAGE_HELP_OPTIONS 2017-06-29 16:54:33 +02:00
cal.1 cal: clean up man page synopsis syntax 2018-02-07 11:19:44 +01:00
cal.c cal: add ifdef TEST_CAL 2018-02-02 10:05:15 +01:00
fincore.1 fincore: fix a typo in fincore.1 2017-12-13 13:06:54 +01:00
fincore.c fincore: Handle large files correctly on 32 bit 2018-02-26 11:54:12 +01:00
findfs.8 docs: replace FTP by HTTPS in kernel.org URLs 2016-12-19 11:22:26 +01:00
findfs.c findfs: don't include exitcodes.h 2018-02-01 14:51:55 +01:00
findmnt-verify.c misc: avoid some dead initialization warnings 2017-06-29 14:04:25 +02:00
findmnt.8 findmnt.8: remove spurious spaces before "--tree" and "--verbose" 2018-02-04 19:31:17 +01:00
findmnt.c misc: consolidate macro style USAGE_HELP_OPTIONS 2017-06-29 16:54:33 +02:00
findmnt.h findmnt: add --verify and --verbose 2016-09-23 13:21:02 +02:00
getopt-parse.bash getops: make --a-long option work again 2017-05-16 14:54:41 +02:00
getopt-parse.tcsh getops: improve getopt-parse.bash example 2016-07-27 16:08:43 +01:00
getopt.1 docs: replace FTP by HTTPS in kernel.org URLs 2016-12-19 11:22:26 +01:00
getopt.c misc: consolidate macro style USAGE_HELP_OPTIONS 2017-06-29 16:54:33 +02:00
kill.1 docs: replace FTP by HTTPS in kernel.org URLs 2016-12-19 11:22:26 +01:00
kill.c lib/signames: remove signame array from header file 2017-10-23 13:18:57 +02:00
logger.1 docs: replace FTP by HTTPS in kernel.org URLs 2016-12-19 11:22:26 +01:00
logger.c misc: fix typos using codespell 2018-02-16 11:12:52 +01:00
look.1 look: use WORDLIST environment variable to find word list 2017-08-21 10:48:20 +02:00
look.c look: use WORDLIST environment variable to find word list 2017-08-21 10:48:20 +02:00
lsblk.8 lsblk: document LSBLK_DEBUG= 2018-02-16 19:10:35 +01:00
lsblk.c include/debug: introduce __UL_INIT_DEBUG_FROM_STRING() 2018-01-17 13:58:29 +01:00
lslocks.8 lslocks: add note about OFDLCK 2017-11-03 11:20:41 +01:00
lslocks.c lslocks: add note about OFDLCK 2017-11-03 11:20:41 +01:00
mcookie.1 docs: replace FTP by HTTPS in kernel.org URLs 2016-12-19 11:22:26 +01:00
mcookie.c mcookie: properly initialize hash 2017-12-12 12:09:13 +01:00
namei.1 docs: replace FTP by HTTPS in kernel.org URLs 2016-12-19 11:22:26 +01:00
namei.c misc: consolidate macro style USAGE_HELP_OPTIONS 2017-06-29 16:54:33 +02:00
rename.1 rename.1: fix typo, where -> were 2017-12-23 13:44:34 -08:00
rename.c rename: use access(3) to check if a file exists 2017-12-04 13:04:12 +01:00
test_uuidd.c misc: replace magic number 37 with UUID_STR_LEN 2017-09-05 11:49:21 +02:00
uuidd.8.in build: use --runstatedir instead of --localstatedir 2017-07-31 15:24:46 +02:00
uuidd.c misc: replace magic number 37 with UUID_STR_LEN 2017-09-05 11:49:21 +02:00
uuidd.rc.in build: use --runstatedir instead of --localstatedir 2017-07-31 15:24:46 +02:00
uuidd.service.in uuidd: remove timeout from systemd service file 2014-04-29 10:37:26 +02:00
uuidd.socket.in build: use --runstatedir instead of --localstatedir 2017-07-31 15:24:46 +02:00
uuidgen.1 misc: fix typos using codespell 2018-02-16 11:12:52 +01:00
uuidgen.c uuidgen: add support for hash-based UUIDs 2017-09-05 11:56:24 +02:00
uuidparse.1 uuidparse: add new command 2017-06-26 14:46:35 +02:00
uuidparse.c lib/timeutils: add common ISO timestamp masks 2017-11-10 16:34:55 -05:00
whereis.1 whereis: add --help and --version 2017-06-22 21:34:58 +02:00
whereis.c include/debug: introduce __UL_INIT_DEBUG_FROM_STRING() 2018-01-17 13:58:29 +01:00
wipefs.8 misc: fix typos 2017-11-28 14:39:13 +01:00
wipefs.c wipefs: cleanup offsets list usage, fix -t filter 2017-08-31 14:47:14 +02:00