freebsd-dev/sys
Allan Jude ad579d984f Fix assertion in ZFS TRIM code
Due to an attempt to check two conditions at once in a macro not designed
as such, the assertion would always evaluate to true.

#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE) do { \
        const TYPE __left = (TYPE)(LEFT); \
        const TYPE __right = (TYPE)(RIGHT); \
        if (!(__left OP __right)) \
                assfail3(#LEFT " " #OP " " #RIGHT, \
                        (uintmax_t)__left, #OP, (uintmax_t)__right, \
                        __FILE__, __LINE__); \
_NOTE(CONSTCOND) } while (0)
#define ASSERT3U(x, y, z)       VERIFY3_IMPL(x, y, z, uint64_t)

Mean that we compared:
left = (type == ZIO_TYPE_FREE || psize)
OP = "<="
right = (SPA_MAXBLOCKSIZE)

If the type was not FREE, 0 is less than SPA_MAXBLOCKSIZE (16MB)
If the type is ZIO_TYPE_FREE, 1 is less than SPA_MAXBLOCKSIZE
The constraint on psize (physical size of the FREE operation) is never
checked against SPA_MAXBLOCKSIZE

Reported by:	Ka Ho Ng <khng300@gmail.com>
Reviewed by:	kevans
MFC after:	2 weeks
Sponsored by:	Klara Systems
2019-05-29 20:34:35 +00:00
..
amd64 Correct some inconsistencies in the earliest created kernel page 2019-05-27 15:21:26 +00:00
arm Implement the ffs and fls functions, and their longer counterparts, in 2019-05-28 15:47:00 +00:00
arm64 arm64 nexus: remove incorrect warning 2019-05-26 23:04:21 +00:00
bsm Create new EINTEGRITY error with message "Integrity check failed". 2019-01-17 06:35:45 +00:00
cam Simplify math added in r310524. 2019-05-22 15:39:35 +00:00
cddl Fix assertion in ZFS TRIM code 2019-05-29 20:34:35 +00:00
compat Do not leak sa in linux_recvmsg() call if kern_recvit() fails. 2019-05-21 18:08:19 +00:00
conf Implement the ffs and fls functions, and their longer counterparts, in 2019-05-28 15:47:00 +00:00
contrib Contuation of r343701, removal of irrelevant #ifdefs. 2019-05-28 01:41:08 +00:00
crypto aesni(4): Fix trivial type typo 2019-05-27 00:47:51 +00:00
ddb Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
dev Add the likely missing braces in ips(4). This is found by gcc warning that 2019-05-29 18:11:17 +00:00
dts arm64: Add support for NanoPI NEO2 2019-05-02 12:56:13 +00:00
fs pseudofs: Ignore unsupported commands in vop_setattr. 2019-05-28 20:54:59 +00:00
gdb
geom When using the destroy option to shut down a nop GEOM module, I/O 2019-05-25 00:07:49 +00:00
gnu dts: Import files from Linux 5.1 2019-05-08 19:27:30 +00:00
i386 typo: suppported. 2019-05-29 02:08:23 +00:00
isa
kern Do not go into sleep in sleepq_catch_signals() when SIGSTOP from 2019-05-29 14:05:27 +00:00
kgssapi * Handle SIGPIPE in gssd 2019-02-21 01:30:37 +00:00
libkern random(4): depessimize arc4random 2019-05-12 06:32:46 +00:00
mips Display CPU model in dmesg on mips targets 2019-05-24 01:43:35 +00:00
modules Add an AESNI-optimized version of the CCM/CBC cryptographic and authentication 2019-05-25 07:26:30 +00:00
net if_bridge(4): Complete bpf auditing of local traffic over the bridge 2019-05-29 01:08:30 +00:00
net80211 Restructure mbuf send tags to provide stronger guarantees. 2019-05-24 22:30:40 +00:00
netgraph Remove 'dir' argument in ng_ipfw_input, since ip_fw_args now has this info. 2019-03-14 22:30:05 +00:00
netinet When an ACK segment as the third message of the three way handshake is 2019-05-26 17:18:14 +00:00
netinet6 Restructure mbuf send tags to provide stronger guarantees. 2019-05-24 22:30:40 +00:00
netipsec Add deprecation warnings for IPsec algorithms deprecated in RFC 8221. 2019-05-23 22:06:57 +00:00
netpfil Remove an uneeded indentation introduced in r223637 to silence gcc warnging 2019-05-25 23:58:09 +00:00
netsmb Remove unused argument to priv_check_cred. 2018-12-11 19:32:16 +00:00
nfs
nfsclient
nfsserver
nlm
ofed Include eventhandler.h in more compilation units 2019-05-21 01:18:43 +00:00
opencrypto cryptodeflate: Drop z_stream zbuf.state->dummy from SDT probe. 2019-05-24 02:44:15 +00:00
powerpc powerpc64/pmap: Reapply r334235 to OEA64 pmap, clearing HID0_RADIX 2019-05-25 04:56:06 +00:00
riscv Include ktr.h in more compilation units 2019-05-21 20:38:48 +00:00
rpc Fix malloc stats for the RPCSEC_GSS server code when DEBUG is enabled. 2019-04-04 01:23:06 +00:00
security Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
sparc64 FCP-101: Remove wb(4) 2019-05-17 15:24:34 +00:00
sys Update __FreeBSD_version and Makefile check for r348347 2019-05-29 02:26:15 +00:00
teken Attempt to complete fixing programmable function keys for syscons. 2019-02-20 02:14:41 +00:00
tests Regularize the Netflix copyright 2019-02-04 21:28:25 +00:00
tools Avoid literal @generated tag in file-generating scripts 2019-05-08 13:35:51 +00:00
ufs Add a missing bresle() in seldom-used error return. 2019-05-28 17:31:35 +00:00
vm Reduce the code size and number of ffsl calls in vm_reserv_break. Use 2019-05-28 00:51:23 +00:00
x86 Add a constant for the LS config MSR on AMD CPUs. 2019-05-23 23:37:11 +00:00
xdr
xen xen: introduce a new way to setup event channel upcall 2019-01-30 11:34:52 +00:00
Makefile