Commit Graph

254116 Commits

Author SHA1 Message Date
jdolecek 2ee262ca2c reintroduce ATACH_IRQ_WAIT flag for attachments using wdcintr(), only
process the interrupt when the flag is set - this fixes spurious interrupt
during post-reset drive setup in wdc_ata_bio_start(), and wdc_atapi_start()

while those functions set WDCTL_IDS, this seems to be ignored by certain
(maybe all) PCI-IDE controllers; usually the implicit KERNEL_LOCK() would
prevent the interrupt anyway, but not when the start routine is started
from the atabus thread, which doesn't take it

fixes 'panic: wdc_ata_bio_intr: bad state' reported on current-users
by Chavdar Ivanov
2017-10-17 18:52:50 +00:00
jdolecek fc3dcf85cb no need to clear DMA WAIT flag in mvsata_edma_handle(), it's not needed
by atabus layer
2017-10-17 16:24:14 +00:00
skrll 4d29dcf4b2 Fix eva argument to pmap_remove and passed prot bits in flags for
pmap_enter, i.e. fix previous.
2017-10-17 16:23:50 +00:00
rjs ff49eadede Set SPL level to match usage for TCP. 2017-10-17 16:07:18 +00:00
rjs f7f68e9d8d Remove duplicate assignment, comment doesn't match it anyway. 2017-10-17 15:53:01 +00:00
rjs 3fb7470622 Remove some foreign conditional code. NFC intended. 2017-10-17 15:49:00 +00:00
rjs b08ca904df Wrap pcb list check with #ifdef DEBUG. 2017-10-17 15:02:31 +00:00
rjs e331dc9cec Remove function prototype that is no longer required. NFC 2017-10-17 14:53:23 +00:00
msaitoh 798eec36f8 Update from the latest Intel SDM:
0x5c: Atom (Goldmont)
 0x5f: Atom (Goldmont, Denverton)
 0x7a: Atom (Goldmont Plus)
2017-10-17 14:48:42 +00:00
maxv 031660d47b Move %ds and %es into the GDT on 64bit LWPs. 2017-10-17 07:48:10 +00:00
maxv aa64020b8e Have the cpu clear PSL_D automatically when entering the kernel via a
syscall. Then, don't clear PSL_D and PSL_AC in the syscall entry point,
they are now both cleared by the cpu (faster). However they still need to
be manually cleared in the interrupt/trap entry points.
2017-10-17 07:33:44 +00:00
ozaki-r a05a27d7e6 Fix buffer length for ipsec_logsastr 2017-10-17 07:23:08 +00:00
ozaki-r 37c5cac096 Don't setup SPs if no policy sepecifier is specified
We expect that SPs are set up iff some policy sepecifier(s) are specified.

Found on investigating an issue reported by Robert Swindells
2017-10-17 07:13:19 +00:00
maxv b91671f97b fix comment, rdx, not edx 2017-10-17 07:02:50 +00:00
maxv 41713064f0 Add support for SMAP on amd64.
PSL_AC is cleared from %rflags in each kernel entry point. In the copy
sections, a copy window is opened and the kernel can touch userland
pages. This window is closed when the kernel is done, either at the end
of the copy sections or in the fault-recover functions.

This implementation is not optimized yet, due to the fact that INTRENTRY
is a macro, and we can't hotpatch macros.

Sent on tech-kern@ a month or two ago, tested on a Kabylake.
2017-10-17 06:58:15 +00:00
maya 5dceac39a7 Update protocol reverse engineering URL to a working one
only mention it once.

From openbsd by Seth Jackson
2017-10-17 06:50:00 +00:00
maya 6f49444b54 Check that the host supports GET_SPEED as well as GET_VERSION
before deciding vmt_probe has succeeded.

qemu supports GET_VERSION but not the RPC protocol so the probe succeeds
but the attach fails, resulting in "vmt0: failed to open backdoor RPC
channel (TCLO protocol)".  All known versions of vmware support GET_SPEED
and no known qemu versions do, so this prevents it from attempting to
attach (and failing) on qemu while still working on vmware.

stop checking vmt_type to avoid having to adapt this code.

- Taken from openbsd
2017-10-17 05:47:09 +00:00
maya 10f56c9348 Explain our implementation choice for implementation-defined values 2017-10-17 00:26:35 +00:00
christos c9c3919a67 simplify previous. 2017-10-16 17:52:10 +00:00
spz f48fb7bb9f apply patches from upstream, namely from https://w1.fi/security/2017-1/ :
rebased-v2.6-0001-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch	02-Oct-2017 16:19 	6.1K
rebased-v2.6-0002-Prevent-reinstallation-of-an-already-in-use-group-ke.patch	02-Oct-2017 16:19 	7.7K
rebased-v2.6-0003-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch	02-Oct-2017 16:19 	6.7K
rebased-v2.6-0004-Prevent-installation-of-an-all-zero-TK.patch
02-Oct-2017 16:19 	2.5K
rebased-v2.6-0005-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch
02-Oct-2017 16:19 	1.9K
rebased-v2.6-0006-TDLS-Reject-TPK-TK-reconfiguration.patch
02-Oct-2017 16:19 	4.2K
rebased-v2.6-0007-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch	02-Oct-2017 16:19 	1.6K
rebased-v2.6-0008-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch	02-Oct-2017 16:19 	2.7K

for CVE-2017-13077 CVE-2017-13078 CVE-2017-13079 CVE-2017-13080
 CVE-2017-13081 CVE-2017-13082 CVE-2017-13086 CVE-2017-13087 CVE-2017-13088

(see
https://w1.fi/security/2017-1/wpa-packet-number-reuse-with-replayed-messages.txt
for details)
2017-10-16 17:36:16 +00:00
jnemeth 869f53c4eb typo: unvalid -> invalid 2017-10-16 17:08:35 +00:00
christos e97f745b4f revert; this is section 9 and userland headers are not available in kernel
context.
2017-10-16 15:48:14 +00:00
bouyer 3fd50a1c81 We KASSERT((fregs->vfp_fpexc & VFP_FPEXC_EN) == 0) just before, so
enabled is always false. remove.
2017-10-16 15:13:00 +00:00
bouyer 36e1796fa5 In the REENABLE case, make sur the fpexc copy in the pcb also has
VFP_FPEXC_EN set. Otherwise we could trap on every context switch even if
the CPU already has the VFP state.
2017-10-16 15:08:24 +00:00
bouyer d4ce271380 PR port-arm/52603:
There is a race here, as seen on arm with FPU:
LWP L is running but not on CPU, has its FPU state on CPU2 which
has not been released yet, so fpexc still has VFP_FPEXC_EN set in the PCB copy.

LWP L is scheduled on CPU1, CPU1 calls cpu_switchto() for L in mi_switch().
cpu_switchto() will set VFP_FPEXC_EN in the FPU's fpexc register per the
PCB fpexc copy.

Before CPU1 calls pcu_switchpoint() for L, CPU2 calls
pcu_do_op(PCU_CMD_SAVE | PCU_CMD_RELEASE) for L because it still holds its
FPU state and wants to load another lwp. This cause VFP_FPEXC_EN to
be cleared in the PCB copy, but not in CPU1's register. L's l_pcu_cpu is
set to NULL.

When CPU1 calls pcu_switchpoint() for L it see l_pcu_cpu is NULL, and doesn't
call the release callback.

Now CPU1 has its FPU enabled but with the wrong FPU state.

Fix by releasing the PCU even if l_pcu_cpu is NULL.
2017-10-16 15:03:57 +00:00
wiz 15a89934c2 Remove Tn. 2017-10-16 12:50:43 +00:00
wiz 31f110b122 remove Tn, bump date for previous 2017-10-16 12:48:24 +00:00
maya a8c5f9573e Suggest to include the POSIX <endian.h> rather than BSD <sys/endian.h> 2017-10-16 11:53:00 +00:00
maya a1df7aec01 Add endian.h header. Simply includes sys/endian.h
<endian.h> has been accepted by the austin group.
2017-10-16 11:38:25 +00:00
christos d72cb7ab3f dedup 2017-10-16 11:37:20 +00:00
christos 5bf5a8b9c7 Treat EOF as a condition to re-open the pcap socket. Since we've been woken
up by poll(2), there must be data to read. If there is not, our socket might
not be ok anymore.
2017-10-16 11:18:43 +00:00
christos 531fc46210 Add a message when we are re-opening the pcap socket. 2017-10-16 11:17:45 +00:00
msaitoh 379e4ad141 - Print ci_feat_val[5] (Structured Extended Feature leaf Fn0000_0007 %ebx) on
AMD, too.
- Print ci_feat_val[6] (Fn0000_0007 %ecx) on Intel.
2017-10-16 10:10:48 +00:00
msaitoh f0f5e556f8 A part number field of DDR3 and DDR4 is not NUL terminated. All unused chars
are filled by 0x20. Print it correctly.

Before:
spdmem0 at iic0 addr 0x50: 8KTF51264AZ-1G6E1 E1M^@,DPAFEQZ021
spdmem1 at iic0 addr 0x51: ACR256X64D3U1333C9BA^AM^X
spdmem2 at iic0 addr 0x52: KP223C-ELD        BA^BM-~

After:
spdmem0 at iic0 addr 0x50: 8KTF51264AZ-1G6E1
spdmem1 at iic0 addr 0x51: ACR256X64D3U1333C9
spdmem2 at iic0 addr 0x52: KP223C-ELD
2017-10-16 08:33:48 +00:00
jdolecek fc8e5b3175 fix comment - it's WDCTL_IDS which is supposed to disable interrupts 2017-10-16 05:52:43 +00:00
christos bb321f6151 Setting AT_BASE on static binaries breaks TLS because they assume that
it is 0, will fix it differently.
2017-10-16 01:50:55 +00:00
abhinav 92a9b5c3ba Add copyright and rcs header to the test program.
Also, remove a test case which was not supposed to be there.
(While that test case works with the changes I committed, testing that
 test case with the test program is not possible in its current form. I'm
 working on that.)
2017-10-15 19:17:30 +00:00
abhinav fa61555626 Add support for escaping special characters when doing filename completion.
For instance if the file name is "foo bar":
$ ls foo<TAB>
should get autocompleted to:
$ ls foo\ bar

Works for similar other characters too, which need escaping.

Also, add an accompanying test program to ensure the escaping is correct
in various scenarios (within quotes, without quotes, with other special characeters)

Thanks to Christos for reviews, help and feedback.
2017-10-15 18:59:00 +00:00
jdolecek 351abcce56 explicitely ignore polled xfers in wdcintr(), so it won't be processed
twice - seems setting WDSD_IBM actually has no effect at least
on some PCI-IDE, and the interrupt ends up being triggered when we release
the channel lock to call c_poll hook

fixes PR kern/52605, and should also fix the 'New panic in wdc_ata_bio_intr'
reported on current-users@
2017-10-15 18:02:33 +00:00
christos c06842d6f7 try to re-open the pcap connection on error. 2017-10-15 15:26:10 +00:00
jdolecek 63bd69a800 move the extra thaw for scheduled ata_reset_channel() to the function itself,
so it's done regardless if the actual reset is run from thread context
or e.g. call with AT_POLL; fixes a hang after xfer failure and dma downgrade

add some debugging printfs, so freeze/thaw issues are easier to track
2017-10-15 14:41:06 +00:00
maxv a4ef825bc2 Mmh, don't forget to clear the TLS gdt slots on Xen. Otherwise, when doing
a lwp32->lwp64 context switch, the new lwp can use the slots to reconstruct
the address of the previous lwp's TLS space (and defeat ASLR?).
2017-10-15 13:34:24 +00:00
maxv f10c10f470 Use two separate functions: cpu_segregs32_zero and cpu_segregs64_zero. The
way segment registers work on amd64 will diverge between 32bit and 64bit
LWPs.
2017-10-15 12:49:53 +00:00
pgoyette ae677eba76 Fix typo: s/one or mode/one or more/ 2017-10-15 12:01:43 +00:00
maxv d8ee5df404 Remove this #undef on native amd64, but keep it on Xen. 2017-10-15 11:39:42 +00:00
maxv c3992c95be Make sure the 32bit LWPs don't have MDL_IRET set. That's not a problem
right now, but will be in the future.
2017-10-15 11:36:15 +00:00
maxv 675bd60661 Add setds and setes, will be useful in the future. 2017-10-15 11:31:00 +00:00
jdolecek d374073a97 revert the logic for wdc_wait_for_unbusy() in wdc_ata_bio_intr() to pre-NCQ,
wdcintr() and wdctimeout() need that; follows same change
in atapi_wdc.c rev. 1.128
2017-10-15 11:27:14 +00:00
maxv 395f538331 Add setusergs on Xen, and simplify. 2017-10-15 10:58:32 +00:00
skrll 9f3bfb0c1b Simplify array initialisation 2017-10-15 09:33:25 +00:00