freebsd-dev/sys
Kristof Provost 52bb6100e9 riscv: Fix copyin/copyout
r343275 introduced a performance optimisation to the copyin/copyout
routines by attempting to copy word-per-word rather than byte-per-byte
where possible.

This optimisation failed to account for cases where the buffer is longer
than XLEN_BYTES, but due to misalignment does not not allow for any
word-sized copies. E.g. a 9 byte buffer (with XLEN_BYTES == 8) which is
misaligned by 2 bytes. The code nevertheless did a single full-word
copy, which meant we copied too much data. This potentially clobbered
other data.

This is most easily demonstrated by a simple `sysctl -a`.

Fix it by not assuming that we'll always have at least one full-word
copy to do, but instead checking the remaining length first.

Reviewed by:	markj@, mhorne@, br@ (previous version)
MFC after:	1 week
Sponsored by:	Axiado
Differential Revision:	https://reviews.freebsd.org/D21100
2019-07-29 14:59:14 +00:00
..
amd64 Simplify the handling of superpages in pmap_clear_modify(). Specifically, 2019-07-25 22:02:55 +00:00
arm arm: ti: cpsw: Check the new slave node address 2019-07-29 10:42:15 +00:00
arm64 Implement pmap_advise(). (Without a working pmap_advise() implementation 2019-07-26 05:07:09 +00:00
bsm
cam Reenable UNMAP support on ramdisks by default. 2019-07-27 18:07:46 +00:00
cddl Fix FASTTRAPIOC_GETINSTR. 2019-07-17 16:38:29 +00:00
compat linuxcommon: add module version 2019-07-10 13:47:10 +00:00
conf Remove support for kernel.tramp and kernel.tramp.gz 2019-07-27 17:24:19 +00:00
contrib As of upstream fil.c CVS r1.53 (March 1, 2009), prior to the import of 2019-07-16 19:00:42 +00:00
crypto aesni(4): Fix trivial type typo 2019-05-27 00:47:51 +00:00
ddb ddb show proc typo 2019-06-22 05:35:23 +00:00
dev Find the correct node of PHY chip using "phy-handle" property of 2019-07-29 14:58:29 +00:00
dts dtso: allwinner: Add an overlay for H3 i2c0 2019-07-20 17:42:46 +00:00
fs Add additional check for 'blocks per group' and 'fragments per group' superblock fields. 2019-07-07 08:58:02 +00:00
gdb
geom g_mirror_taste: avoid deadlock, always clear tasting flag 2019-07-01 22:06:36 +00:00
gnu dts: Import files from Linux 5.1 2019-05-08 19:27:30 +00:00
i386 Simplify the handling of superpages in pmap_clear_modify(). Specifically, 2019-07-25 22:02:55 +00:00
isa
kern Better comments for vlrureclaim 2019-07-28 16:07:27 +00:00
kgssapi Make the warning intervals for deprecated crypto algorithms tunable. 2019-06-11 23:00:55 +00:00
libkern Remove pre-FreeBSD 7.0 compatibility. 2019-07-19 18:38:47 +00:00
mips o Add support for BERI IOMMU device 2019-07-22 16:01:20 +00:00
modules enable ig4_acpi on aarch64 2019-07-24 21:26:17 +00:00
net if_tuntap(4): Add TUNGIFNAME 2019-07-25 22:23:34 +00:00
net80211 Enhance the comment ieee80211_add_channel() to avoid a 2019-06-10 14:31:18 +00:00
netgraph
netinet When performing after_idle() or post_recovery(), don't disable the 2019-07-29 09:19:48 +00:00
netinet6 When calling sctp_initialize_auth_params(), the inp must have at 2019-07-14 12:04:39 +00:00
netipsec netipsec key_register: check for M_NOWAIT alloc failure 2019-06-25 15:43:52 +00:00
netpfil pf: Remove partial RFC2675 support 2019-07-29 13:21:31 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Fix prio vs. nonprio tagged traffic in RDMACM 2019-06-04 06:21:31 +00:00
opencrypto Move declaration of warninterval out from under COMPAT_FREEBSD32. 2019-06-11 23:28:07 +00:00
powerpc powerpc: Improve pvo allocation code 2019-07-25 15:27:05 +00:00
riscv riscv: Fix copyin/copyout 2019-07-29 14:59:14 +00:00
rpc
security Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
sparc64 Don't pass error from syscallenter() to syscallret(). 2019-07-15 21:25:16 +00:00
sys Decode some more IDENTIFY DEVICE bits. 2019-07-28 20:17:40 +00:00
teken
tests
tools Add SDIO support. 2019-06-08 16:26:56 +00:00
ufs Lock the vnode before calling ufs_bmap_seekdata(). 2019-07-27 01:52:34 +00:00
vm In swap_pager_putpages, move the initialization of a free-blocks 2019-07-28 19:32:23 +00:00
x86 PR: 239143 2019-07-14 21:08:54 +00:00
xdr
xen
Makefile