freebsd-skq/sys/fs
asomers 927d2d494a fcntl: fix overflow when setting F_READAHEAD
VOP_READ and VOP_WRITE take the seqcount in blocks in a 16-bit field.
However, fcntl allows you to set the seqcount in bytes to any nonnegative
31-bit value. The result can be a 16-bit overflow, which will be
sign-extended in functions like ffs_read. Fix this by sanitizing the
argument in kern_fcntl. As a matter of policy, limit to IO_SEQMAX rather
than INT16_MAX.

Also, fifos have overloaded the f_seqcount field for a completely different
purpose ever since r238936.  Formalize that by using a union type.

Reviewed by:	cem
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D20710
2019-06-20 23:07:20 +00:00
..
autofs Ensure that directory entry padding bytes are zeroed. 2018-11-23 22:24:59 +00:00
cd9660 Ensure that directory entry padding bytes are zeroed. 2018-11-23 22:24:59 +00:00
cuse Implement flag for telling cuse(3) clients if the peer is running in 32-bit 2019-04-18 19:04:07 +00:00
deadfs Switch to use shared vnode locks for text files during image activation. 2019-05-05 11:20:43 +00:00
devfs Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
ext2fs Separate kernel crc32() implementation to its own header (gsb_crc32.h) and 2019-06-17 19:49:08 +00:00
fdescfs Ensure that directory entry padding bytes are zeroed. 2018-11-23 22:24:59 +00:00
fifofs fcntl: fix overflow when setting F_READAHEAD 2019-06-20 23:07:20 +00:00
fuse Remove "struct ucred*" argument from vtruncbuf 2019-05-24 20:27:50 +00:00
msdosfs Remove "struct ucred*" argument from vtruncbuf 2019-05-24 20:27:50 +00:00
nandfs Separate kernel crc32() implementation to its own header (gsb_crc32.h) and 2019-06-17 19:49:08 +00:00
nfs Add #ifdef INET as requested by bz@. 2019-04-21 22:53:51 +00:00
nfsclient Get rid of extraneous initialization. 2019-05-31 03:13:09 +00:00
nfsserver Add support for the ModeSetMasked attribute to the NFSv4.1 server. 2019-04-19 23:35:08 +00:00
nullfs Manually clear text references on reclaim for nullfs and tmpfs. 2019-06-05 20:16:25 +00:00
procfs Plug memory disclosures via ptrace(2). 2018-12-03 20:54:17 +00:00
pseudofs pseudofs: Ignore unsupported commands in vop_setattr. 2019-05-28 20:54:59 +00:00
smbfs [smbfs] Allow semicolon in mounts that support long names 2019-01-20 05:52:16 +00:00
tmpfs Manually clear text references on reclaim for nullfs and tmpfs. 2019-06-05 20:16:25 +00:00
udf Ensure that directory entry padding bytes are zeroed. 2018-11-23 22:24:59 +00:00
unionfs Include ktr.h in more compilation units 2019-05-21 20:38:48 +00:00