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
..
2019-06-18 21:05:10 +00:00
2019-05-07 18:10:21 +00:00
2019-01-27 00:46:06 +00:00
2019-05-20 19:14:07 +00:00
2019-06-04 13:45:30 +00:00
2019-05-30 16:11:20 +00:00
2019-06-11 22:06:05 +00:00
2018-12-05 16:43:03 +00:00
2019-06-03 15:23:37 +00:00
2018-10-22 02:35:12 +00:00
2017-12-13 16:30:39 +00:00
2019-03-12 05:10:41 +00:00
2018-10-12 00:32:45 +00:00
2018-08-18 19:45:56 +00:00
2018-06-01 13:26:45 +00:00
2019-02-20 09:38:19 +00:00
2019-06-19 13:30:50 +00:00
2018-11-20 14:58:41 +00:00
2019-05-07 18:10:21 +00:00
2019-05-07 18:10:21 +00:00
2018-06-01 13:26:45 +00:00
2018-11-19 00:54:31 +00:00
2019-06-20 13:59:46 +00:00
2018-10-23 21:43:41 +00:00