freebsd-skq/sys
mjg 511cde02d7 amd64: fix a retarded bug in memset
memset fills the target buffer from a byte-sized value passed in as the
second argument.

The fully-sized (8 bytes) register containing it is named %rsi. Lower 4 bytes
can be referred to as %esi and finally the lowest byte is %sil.

Vast majority of all the callers just zero the target buffer and set it up by
doing xor %esi,%esi which has a side-effect of zeroing the upper parts of
the register as well. Some others do a word-sized move to %esi which has the
same result.

However, there are callers which only fill %sil. This does *not* clear up
the rest of the register.

The value of %rsi is multiplied by $0x0101010101010101 to create a 8-byte sized
pattern for 8-byte stores.

Prior to the patch, the func just blindly took %rsi assuming the unwanted bytes
are zeroed out. Since this is not the case for the callers which only play with
%sil (the rest of the register can have absolutely anything), the resulting
pattern can be garbage.

This has potential for funny bugs. One side effect (which was not amusing)
after enabling it instead of bzero was that the kernel was hanging on boot
as a xen domU.

Reported by:	Trond Endrestøl <Trond.Endrestol fagskolen.gjovik.no>
Pointy hat: me
2018-06-08 00:47:24 +00:00
..
amd64 amd64: fix a retarded bug in memset 2018-06-08 00:47:24 +00:00
arm Since we don't enable BUF_TRACKING and FULL_BUF_TRACKING buffer debugging 2018-06-05 05:24:42 +00:00
arm64 Since we don't enable BUF_TRACKING and FULL_BUF_TRACKING buffer debugging 2018-06-05 05:24:42 +00:00
bsm
cam Enable high-speed on the card before increasing frequency on the controller 2018-06-05 11:03:24 +00:00
cddl Break recursion involving getnewvnode and zfs_rmnode. 2018-06-07 18:59:32 +00:00
compat Define ARCH_KMALLOC_MINALIGN in the LinuxKPI. 2018-06-07 11:44:11 +00:00
conf md: use prestaged mfs_root 2018-06-07 13:57:34 +00:00
contrib MFV: r334448 2018-06-04 22:26:47 +00:00
crypto disable printing value of SKEIN_LOOP during standard out, 2018-05-19 18:27:14 +00:00
ddb Extend show proc with reaper, sigparent, and vmspace information 2018-05-25 13:59:48 +00:00
dev dev/ofw: Fix ofw_fdt_getprop() return values to match documentation 2018-06-07 15:59:08 +00:00
dts arm: overlays: Update to new path-based sugar format 2018-05-04 14:38:48 +00:00
fs Revert r334586 since I now think __unused is the better way to handle this. 2018-06-04 11:35:04 +00:00
gdb amd64: Protect the kernel text, data, and BSS by setting the RW/NX bits 2018-03-06 14:28:37 +00:00
geom Introduce the 'n' flag for the geli attach command. 2018-05-09 20:53:38 +00:00
gnu gnu/dts: Update our copy of arm dts from Linux 4.16 2018-04-20 19:37:08 +00:00
i386 cpufunc: add rdtscp for x86 2018-06-07 00:54:11 +00:00
isa Revert r330780, it was improperly tested and results in taking a spin 2018-03-11 20:13:15 +00:00
kern This commit brings in a new refactored TCP stack called Rack. 2018-06-07 18:18:13 +00:00
kgssapi kgssapi: Remove trivial deadcode 2018-02-14 00:12:03 +00:00
libkern str(r)chr: Replace union abuse with __DECONST 2018-06-04 18:47:14 +00:00
mips MALTA64EL: disable modules until objcopy is fixed 2018-05-24 23:58:57 +00:00
modules Take out the stack alias inadvertantly added by my commit. 2018-06-07 20:57:12 +00:00
net iflib: Record TCP checksum info in iflib when TCP checksum is requested 2018-06-07 13:03:07 +00:00
net80211 Use an accessor function to access ifr_data. 2018-03-30 18:50:13 +00:00
netgraph Catch up two more places to the V_ifnet change to a CK_STAILQ. 2018-05-24 00:06:55 +00:00
netinet This commit brings in a new refactored TCP stack called Rack. 2018-06-07 18:18:13 +00:00
netinet6 Load balance sockets with new SO_REUSEPORT_LB option. 2018-06-06 15:45:57 +00:00
netipsec Rework IP encapsulation handling code. 2018-06-05 20:51:01 +00:00
netpfil pf: Replace rwlock on PF_RULES_LOCK with rmlock 2018-05-30 07:11:33 +00:00
netsmb Eliminate the overhead of gratuitous repeated reinitialization of cap_rights 2018-05-09 18:47:24 +00:00
nfs UDP: further performance improvements on tx 2018-05-23 21:02:14 +00:00
nfsclient style: Remove remaining deprecated MALLOC/FREE macros 2018-01-25 22:25:13 +00:00
nfsserver
nlm Use syscall_helper_register() to register syscalls and initialize though 2018-02-10 01:09:22 +00:00
ofed UDP: further performance improvements on tx 2018-05-23 21:02:14 +00:00
opencrypto cryptosoft: Do not exceed crd_len around *crypt_multi 2018-04-19 15:24:21 +00:00
powerpc Fix excise_initrd_region() to support 32- and 64-bit initrd params. 2018-06-07 21:24:21 +00:00
riscv Export a breakpoint() function to userland for riscv. 2018-05-16 16:56:35 +00:00
rpc
security #include <bsm/audit.h> in security/audit/audit_ioctl.h 2018-05-30 21:50:23 +00:00
sparc64 Define memmove and make bcopy alt entry point 2018-05-24 21:11:28 +00:00
sys Fix build issue with const and volatile and the 2018-06-07 19:57:55 +00:00
teken teken: Fix sequences header which was crossing the 80-col boundary 2018-05-29 08:41:44 +00:00
tests epoch(9): Make epochs non-preemptible by default 2018-05-18 17:29:43 +00:00
tools Add dtb overlays support 2018-03-24 21:30:24 +00:00
ufs ufs: remove cgbno variable where unused 2018-05-19 19:30:42 +00:00
vm UMA memory debugging enabled with INVARIANTS consists of two things: 2018-06-08 00:15:08 +00:00
x86 x86: reorganize code that deals with unexpected NMI-s 2018-06-07 14:46:52 +00:00
xdr
xen xen: remove dead code from gnttab.h 2018-05-25 08:44:00 +00:00
Makefile