]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoAdd pkgbase METALOG parse/check tool
emaste [Sun, 10 May 2020 16:11:19 +0000 (16:11 +0000)]
Add pkgbase METALOG parse/check tool

`metalog.lua` is a script that reads METALOG file created by pkgbase
(make packages) and generates reports about the installed system
and issues.

This was developed as part of Yang's W2020 University of Waterloo co-
operative education term with the FreeBSD Foundation.  kevans provided
some initial review; we will iterate on it in the tree.

Submitted by: Yang Wang <2333@outlook.jp>
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24563

4 years agoqnlx: Do not redifines types.
manu [Sun, 10 May 2020 14:09:30 +0000 (14:09 +0000)]
qnlx: Do not redifines types.

r360870 added linux/slab.h into liunx/bitmap.h and this include linux/types.h
The qlnx driver is redefining some of those types so remove them and add an
explicit linux/types.h include.

Pointy hat: manu
Reported by: Austin Shafer <ashafer@badland.io>

4 years agolinuxkpi: Really add bitmap_alloc and bitmap_zalloc
manu [Sun, 10 May 2020 13:12:05 +0000 (13:12 +0000)]
linuxkpi: Really add bitmap_alloc and bitmap_zalloc

This was missing in r360870

Sponsored-by: The FreeBSD Foundation
4 years agolinuxkpi: Add bitmap_alloc and bitmap_free
manu [Sun, 10 May 2020 13:07:00 +0000 (13:07 +0000)]
linuxkpi: Add bitmap_alloc and bitmap_free

This is a simple call to kmallock_array/kfree, therefore include linux/slab.h as
this is where the kmalloc_array/kfree definition is.

Sponsored-by: The FreeBSD Foundation
Reviewed by: hselsasky
Differential Revision: https://reviews.freebsd.org/D24794

4 years agoOnly drop DATA chunk with lower priorities as specified in RFC 7496.
tuexen [Sun, 10 May 2020 10:03:10 +0000 (10:03 +0000)]
Only drop DATA chunk with lower priorities as specified in RFC 7496.
This issue was found by looking at a reproducer generated by syzkaller.

MFC after: 3 days

4 years agoRemove rtalloc1(_fib) KPI.
melifaro [Sun, 10 May 2020 09:34:48 +0000 (09:34 +0000)]
Remove rtalloc1(_fib) KPI.

Last user of rtalloc1() KPI has been eliminated in rS360631.
As kernel is now fully switched to use new routing KPI defined in
rS359823, remove old lookup functions.

Differential Revision: https://reviews.freebsd.org/D24776

4 years ago[atheros] [if_arge] Various fixes to avoid TX stalls and bad sized packets
adrian [Sun, 10 May 2020 03:36:11 +0000 (03:36 +0000)]
[atheros] [if_arge] Various fixes to avoid TX stalls and bad sized packets

This is stuff I've been running for a couple years.  It's inspired by changes
I found in the linux ag71xx ethernet driver.

* Delay between stopping DMA and checking to see if it's stopped; this gives
  the hardware time to do its thing.

* Non-final frames in the chain need to be a multiple of 4 bytes in size.
  Ensure this is the case when assembling a TX DMA list.

* Add counters for tx/rx underflow and too-short packets.

* Log if TX/RX DMA couldn't be stopped when resetting the MAC.

* Add some more debugging / logging around TX/RX ring bits.

Tested:

* AR7240, AR7241
* AR9344 (TL-WDR3600/TL-WDR4300 APs)
* AR9331 (Carambola 2)

4 years agoclang: Reject %n for __attribute__((format(__freebsd_kprintf__)))
cem [Sat, 9 May 2020 19:26:44 +0000 (19:26 +0000)]
clang: Reject %n for __attribute__((format(__freebsd_kprintf__)))

A follow-up to r360849.

Reported by: imp
Reviewed by: emaste, imp
X-MFC-With: r360849
Differential Revision: https://reviews.freebsd.org/D24786

4 years agolinuxkpi: Add bitmap_copy and bitmap_andnot
manu [Sat, 9 May 2020 17:52:50 +0000 (17:52 +0000)]
linuxkpi: Add bitmap_copy and bitmap_andnot

bitmap_copy simply copy the bitmaps, no idea why it exists.
bitmap_andnot is similar to bitmap_and but uses !src2.

Sponsored-by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D24782

4 years agoremove %n support from printf(9)
emaste [Sat, 9 May 2020 15:56:02 +0000 (15:56 +0000)]
remove %n support from printf(9)

It can be dangerous and there is no need for it in the kernel.
Inspired by Kees Cook's change in Linux, and later OpenBSD.

Reviewed by: cem, gordon, philip
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24760

4 years agortwn: Add a new USB ID.
markj [Sat, 9 May 2020 14:49:56 +0000 (14:49 +0000)]
rtwn: Add a new USB ID.

PR: 246315
Submitted by: Idwer Vollering <vidwer+fbsdbugs@gmail.com>
MFC after: 1 week

4 years agoAdd ARM loader path to uefi(8) man page.
trasz [Sat, 9 May 2020 14:19:29 +0000 (14:19 +0000)]
Add ARM loader path to uefi(8) man page.

MFC after: 2 weeks
Sponsored by: DARPA

4 years agoAdd space for RSSI in data member.
takawata [Sat, 9 May 2020 14:15:44 +0000 (14:15 +0000)]
Add space for RSSI in data member.
RSSI is put just after actual data.

Submitted by: Marc Veldman
PR: 245920

4 years agoAvoid spurious ENOMEMs from sysctl hw.pagesizes.
kib [Sat, 9 May 2020 13:00:38 +0000 (13:00 +0000)]
Avoid spurious ENOMEMs from sysctl hw.pagesizes.

Reported by: Paul Floyd <paulf@free.fr>
PR: 246215
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D24737

4 years agoDocument BUS_OOMERR.
kib [Sat, 9 May 2020 12:58:27 +0000 (12:58 +0000)]
Document BUS_OOMERR.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D24761

4 years agoDon't send clear screen until we are committed to run.
phk [Sat, 9 May 2020 10:55:34 +0000 (10:55 +0000)]
Don't send clear screen until we are committed to run.

4 years agoMention the existence of /etc/defaults/vendor.conf
bcr [Sat, 9 May 2020 10:22:00 +0000 (10:22 +0000)]
Mention the existence of /etc/defaults/vendor.conf
for custom vendor-specific changes to FreeBSD's
default settings.

While here, fix a typo: perfomance -> performance

PR: 245404
Submitted by: Jose Luis Duran

4 years agobhyve: update man page to describe the virtio-net mtu option
vmaffione [Sat, 9 May 2020 07:57:41 +0000 (07:57 +0000)]
bhyve: update man page to describe the virtio-net mtu option

r359704 introduced an 'mtu' option for the virtio-net device emulation.
Update the man page to describe the new option.

Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D24723

4 years agoloader: vdev_read() can corrupt memory
tsoome [Sat, 9 May 2020 06:25:20 +0000 (06:25 +0000)]
loader: vdev_read() can corrupt memory

When reading less than sector size but from sector boundary,
the vdev_read() will read full sector into the provided buffer
and therefore corrupting memory past buffer end.

MFC after: 2 days

4 years agoinstallworld: attempt a certctl rehash at the tail end
kevans [Sat, 9 May 2020 02:01:29 +0000 (02:01 +0000)]
installworld: attempt a certctl rehash at the tail end

This can be run as root or normal user with no problem; if they hadn't
twisted the WITHOUT_CAROOT knob, we'll attempt to use the host certctl to
rehash the DESTDIR. This would allow one to build systems WITHOUT_OPENSSL +
WITH_CAROOT with a populated /etc/ssl that they can then use with an
appropriate *ssl from somewhere else.

Cross-builds are fine because this will always use the host certctl, or just
nag if it's missing and it wasn't a WITHOUT_CAROOT build.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24641

4 years agofusefs: fix two small bugs in the tests' expectations
asomers [Fri, 8 May 2020 23:00:02 +0000 (23:00 +0000)]
fusefs: fix two small bugs in the tests' expectations

These two errors have been present since the tests' introduction.
Coincidentally every test (I think there's only one) that cares about that
field also works when the field's value is 0.

MFC after: 2 weeks

4 years agofusefs: better dtrace probes for asynchronous invalidation operations
asomers [Fri, 8 May 2020 22:26:52 +0000 (22:26 +0000)]
fusefs: better dtrace probes for asynchronous invalidation operations

MFC after: 2 weeks

4 years ago[etherswitch] bump register width to 32 bits.
adrian [Fri, 8 May 2020 22:22:12 +0000 (22:22 +0000)]
[etherswitch] bump register width to 32 bits.

Some ethernet switches have very large register windows; for example
the AR8316 switch MIB starts at 0x20000.

Submitted by: Mori Hiroki <yamori813@yahoo.co.jp>

4 years agoSync relocation definitions
mhorne [Fri, 8 May 2020 22:21:56 +0000 (22:21 +0000)]
Sync relocation definitions

Add the most recent relocation types from the RISC-V ELF psABI spec.

MFC after: 3 days

4 years agoEmbed dst sockaddr into rtentry and remove rte packet counter
melifaro [Fri, 8 May 2020 21:06:10 +0000 (21:06 +0000)]
Embed dst sockaddr into rtentry and remove rte packet counter

Currently each rtentry has dst&gateway allocated separately from another zone,
 bloating cache accesses.

Current 'struct rtentry' has 12 "mandatory" radix pointers in the beginning,
 leaving 4 usable pointers/32 bytes in the first 2 cache lines (amd64).
Fields needed for the datapath are destination sockaddr and rt_nhop.

So far it doesn't look like there is other routable addressing protocol other
 than IPv4/IPv6/MPLS, which uses keys longer than 20 bytes.
With that in mind, embed dst into struct rtentry, making the first 24 bytes
 of rtentry within 128 bytes. That is enough to make IPv6 address within first
 128 bytes.

It is still pretty easy to add code for supporting separately-allocated dst,
 however it doesn't make a lot of sense in having such code without a use case.

As rS359823 moved the gateway to the nexthop structure, the dst embedding change
 removes the need for any additional allocations done by rt_setgate().

Lastly, as a part of cleanup, remove counter(9) allocation code, as this field
 is not used in packet processing anymore.

Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D24669

4 years agoAdd more obsolete files
antoine [Fri, 8 May 2020 20:15:18 +0000 (20:15 +0000)]
Add more obsolete files

4 years agobhyve: Pass the full string of options to the network backends.
afedorov [Fri, 8 May 2020 17:15:54 +0000 (17:15 +0000)]
bhyve: Pass the full string of options to the network backends.

Reviewed by: vmaffione
Approved by: vmaffione (mentor)
Sponsored by: vstack.com
Differential Revision: https://reviews.freebsd.org/D24735

4 years ago[net80211] Use the unicast key when transmitting DWDS AP multicast frames.
adrian [Fri, 8 May 2020 17:01:33 +0000 (17:01 +0000)]
[net80211] Use the unicast key when transmitting DWDS AP multicast frames.

I'm still not sure whether this is the full solution, but here goes.

I have a two node DWDS setup - a main AP with the ethernet bridge uplink
and a satellite AP in the back of the house. They're both AR9344+AR9580
dual band 11n APs.

The problem was that multicast frames was not going from the DWDS AP to
the DWDS STA. Unicast frames are fine, and multicast frames from the
DWDS STA to AP are fine.

Now, multicast and unicast frames from the STA -> AP are just transmitted
using the unicast key.  That's fine.  However, the AP -> STA multicast
frames by default are transmitted using the current default / multicast
key, the shared one between all STAs in a BSS.  Now, the DWDS implementation
ignores non WDS frames - it only allows about 4 address frames outside
of management / EAPOL frames! - so the STA side ignores the normal multicast
frames.

Instead, the AP side uses ieee80211_dwds_mcast() to send multicast frames
to each WDS VAP that was created as part of the "dynamic" part of DWDS.
This should be queuing them individually to each node instead of using
the normal multicast send path; and this is how they should get turned into
4-addr WDS frames.

HOWEVER, ieee80211_encap() was trying to use the default TX key to queue
them rather than the unicast key that's already setup.  Since this synthetic
node doesn't have the default TX key setup, transmission fails.  Things
would be fine in WEP and in open mode because in both cases you would
have static keys (or no keys) setup.  It just fails in WPA mode.

This resolves the issue.  AP DWDS multicast is now sent using the unicast
key just like in STA mode and I'm pretty sure the STA mode side will stil
work fine (as it's a STA VAP with a DWDS flag..)

Tested:

* TL-WDR3600/4300 APs

4 years agoFix a memory leak for ENCIOC_GETSTRING I introduced in r360171.
jhb [Fri, 8 May 2020 16:41:23 +0000 (16:41 +0000)]
Fix a memory leak for ENCIOC_GETSTRING I introduced in r360171.

MFC after: 1 week
Sponsored by: DARPA

4 years agosrc.conf.5: regen after BINUTILS changes
emaste [Fri, 8 May 2020 15:03:28 +0000 (15:03 +0000)]
src.conf.5: regen after BINUTILS changes

4 years agosrc.opts.mk: update BINUTILS options and add comments
emaste [Fri, 8 May 2020 14:54:40 +0000 (14:54 +0000)]
src.opts.mk: update BINUTILS options and add comments

BINUTILS is needed only for ports, and will be disabled once the failing
ports are addressed (likely by growing a binutils dependency).

BINUTILS_BOOTSTRAP is needed only on amd64, for skein_block_asm.s. There
is no need to enable it on i386.

This will all be removed before FreeBSD 13.0.

4 years agoRemove APPLEKEXT ifndefs
freqlabs [Fri, 8 May 2020 14:39:38 +0000 (14:39 +0000)]
Remove APPLEKEXT ifndefs

They are no longer useful.

Reviewed by: rmacklem
Approved by: mav (mentor)
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D24752

4 years agoReinitialize thread0's stack base after enabling XSAVE.
markj [Fri, 8 May 2020 14:38:48 +0000 (14:38 +0000)]
Reinitialize thread0's stack base after enabling XSAVE.

Otherwise the initial call to set_top_of_stack(), which occurs before
fpuinit() sets the correct value for cpu_max_ext_state_size, leaves the
stack base at an incorrect location.  Then, when the full area is
zeroed, we end up erroneously zeroing part of the following page.

Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24754

4 years agoFix the sys.geom.class.multipath.misc.fail_on_error test on stable/12
asomers [Fri, 8 May 2020 02:42:15 +0000 (02:42 +0000)]
Fix the sys.geom.class.multipath.misc.fail_on_error test on stable/12

This test uses a gnop feature (delay probability) that isn't available on
stable/12.  But it's unnecessary; the test works fine without it.  Removing
it simplifies the test and, once MFCed, will allow it to pass on stable/12.

PR: 244158
Reported by: lwhsu
MFC after: 2 weeks

4 years agoDocument le_enable subcommand
takawata [Fri, 8 May 2020 01:19:29 +0000 (01:19 +0000)]
Document le_enable subcommand

4 years agoMerge commit 21e5e1724b75 from llvm git:
emaste [Thu, 7 May 2020 21:18:37 +0000 (21:18 +0000)]
Merge commit 21e5e1724b75 from llvm git:

  getMainExecutable: Fix hand-rolled AT_EXECPATH for older FreeBSD

  Once we hit AT_NULL, we need to bail out of the loop; not just the
  enclosing switch.  This fixes basic usage (e.g. `cc --version`) when
  AT_EXECPATH isn't present on older branches (e.g. under
  emu-user-static, at the moment), where we would previously run off
  the end of ::environ.

  Patch By: kevans

  Reviewed By: arichardson

  Differential Revision:  https://reviews.llvm.org/D79239

MFC after: 3 days

4 years agoWhen in the SYN-SENT state bbr and rack will not properly send an ACK but instead...
rrs [Thu, 7 May 2020 20:29:38 +0000 (20:29 +0000)]
When in the SYN-SENT state bbr and rack will not properly send an ACK but instead start the D-ACK timer. This
causes so_reuseport_lb_test to fail since it slows down how quickly the program runs until the timeout occurs
and fails the test

Sponsored by: Netflix inc.
Differential Revision: https://reviews.freebsd.org/D24747

4 years agoBump __FreeBSD_version after linuxkpi changes
manu [Thu, 7 May 2020 19:51:53 +0000 (19:51 +0000)]
Bump __FreeBSD_version after linuxkpi changes

Requested by: zeising

4 years ago[PowerPC] kernel ifunc support for powerpc*, fix ppc64 relocation oddities.
bdragon [Thu, 7 May 2020 19:32:49 +0000 (19:32 +0000)]
[PowerPC] kernel ifunc support for powerpc*, fix ppc64 relocation oddities.

This is a general cleanup of the relocatable kernel support on powerpc,
needed to enable kernel ifuncs.

 * Fix some relocatable issues in the kernel linker, and change to using
   a RELOCATABLE_KERNEL #define instead of #ifdef __powerpc__ for parts that
   other platforms can use in the future if they wish to have ET_DYN kernels.

 * Get rid of the DB_STOFFS hack now that the kernel is relocated to the DMAP
   properly across the board on powerpc64.

 * Add powerpc64 and powerpc32 ifunc functionality.

 * Allow AIM64 virtual mode OF kernels to run from the DMAP like other AIM64
   by implementing a virtual mode restart. This fixes the runtime address on
   PowerMac G5.

 * Fix symbol relocation problems on post-relocation kernels by relocating
   the symbol table.

 * Add an undocumented method for supplying kernel symbols on powernv and
   other powerpc machines using linux-style kernel/initrd loading -- If
   you pass the kernel in as the initrd as well, the copy resident in initrd
   will be used as a source for symbols when initializing the debugger.
   This method is subject to removal once we have a better way of doing this.

Approved by: jhibbits
Relnotes: yes
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D23156

4 years agoOptionalObsoleteFiles.inc: remove objdump
emaste [Thu, 7 May 2020 18:24:32 +0000 (18:24 +0000)]
OptionalObsoleteFiles.inc: remove objdump

objdump is removed unconditionally in ObsoleteFiles.inc

4 years agoSet PCM_CAP_VIRTUAL for virtual DSP devices.
hselasky [Thu, 7 May 2020 18:15:35 +0000 (18:15 +0000)]
Set PCM_CAP_VIRTUAL for virtual DSP devices.

Submitted by: Kevin Zheng <kevinz5000@gmail.com>
PR: 246206
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agovirtio_mmio: Add casts missing from r360722
jrtc27 [Thu, 7 May 2020 17:59:17 +0000 (17:59 +0000)]
virtio_mmio: Add casts missing from r360722

This fixes -Wshift-count-overflow warnings/errors on architectures using
32-bit physical addresses.

Reported by: lwhsu

4 years ago[PowerPC] Fix powerpcspe build failure after r360569
bdragon [Thu, 7 May 2020 17:58:07 +0000 (17:58 +0000)]
[PowerPC] Fix powerpcspe build failure after r360569

On powerpcspe, vm_paddr_t is 64 bit despite it being a 32 bit platform.
Adjust compile time assertion to compensate.

4 years agolinuxkpi: Add pci_iomap and pci_iounmap
manu [Thu, 7 May 2020 17:00:51 +0000 (17:00 +0000)]
linuxkpi: Add pci_iomap and pci_iounmap

Those function are use to map/unmap io region of a pci device.
Different resource can be mapped depending on the bar so use a
tailq to store them all.

Sponsored-by: The FreeBSD Foundation
Reviewed by: emaste, hselasky
Differential Revision: https://reviews.freebsd.org/D24696

4 years agops: extend the non-standard option -d (tree view) to work with -p
pstef [Thu, 7 May 2020 16:56:18 +0000 (16:56 +0000)]
ps: extend the non-standard option -d (tree view) to work with -p

Initially it seemed that there were multiple possible ways to do it.

Processing option -p could conditionally add selected processes and
their descendants to the list for further work, but it is not guaranteed
to know whether the -d option has been used or not, and it also doesn't
have access to the process list just yet.

There is also descendant_sort() which has access to all possibly needed
information, but serves the purely post-processing purpose of sorting
output.

Then there is the loop that uses invocation information and full process
list to create a list of processes for final display. It seems the most
natural place to implement this, but indeterminate state of the process
list and volatility of the final list that is being created obstruct
adding an elegant search for all elements of process descendancy trees.

So I opted for adding another loop, just before the one I mentioned
above. For all selected processes it conditionally adds direct
descendants to the end of this list of selected processes.

Possible usage:
* ps -auxd -p $$
* ps -auxd -p 1
* while x=$(pgrep svnlite); do clear; ps auxd -p $x; sleep 2; done
* ps -auxd -p `pgrep make`

Reviewed by: kevans, kaktus (earlier version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24380

4 years agogpioiic_attach: fix a NULL pointer crash on hints-based systems
avg [Thu, 7 May 2020 13:11:32 +0000 (13:11 +0000)]
gpioiic_attach: fix a NULL pointer crash on hints-based systems

The attach method uses GPIO_GET_BUS() to get a "newbus" device
that provides a pin.  But on hints-based systems a GPIO controller
driver might not be fully initialized yet and it does not know gpiobus
hanging off it.  Thus, GPIO_GET_BUS() cannot be called yet.
The reason is that controller drivers typically create a child gpiobus
using gpiobus_attach_bus() and that leads to the following call chain:
gpiobus_attach_bus() -> gpiobus_attach() ->
bus_generic_attach(gpiobus) -> gpioiic_attach().
So, gpioiic_attach() is called before gpiobus_attach_bus() returns.

I observed this bug with nctgpio driver on amd64.
I think that the problem was introduced in r355276.

The fix is to avoid calling GPIO_GET_BUS() from the attach method.
Instead, we know that on hints-based systems only the parent gpiobus can
provide the pins.
Nothing is changed for FDT-based systems.

MFC after: 1 week

4 years agoUpdate the screen termcap entries
bapt [Thu, 7 May 2020 12:43:28 +0000 (12:43 +0000)]
Update the screen termcap entries

Those updates have been obtained form converting the terminfo information
provided by the screen sources to termcap.

MFC after: 3 days

4 years agoOptimize ENA Rx refill for low memory conditions
mw [Thu, 7 May 2020 11:28:39 +0000 (11:28 +0000)]
Optimize ENA Rx refill for low memory conditions

Sometimes, especially when there is not much memory in the system left,
allocating mbuf jumbo clusters (like 9KB or 16KB) can take a lot of time
and it is not guaranteed that it'll succeed. In that situation, the
fallback will work, but if the refill needs to take a place for a lot of
descriptors at once, the time spent in m_getjcl looking for memory can
cause system unresponsiveness due to high priority of the Rx task. This
can also lead to driver reset, because Tx cleanup routine is being
blocked and timer service could detect that Tx packets aren't cleaned
up. The reset routine can further create another unresponsiveness - Rx
rings are being refilled there, so m_getjcl will again burn the CPU.
This was causing NVMe driver timeouts and resets, because network driver
is having higher priority.

Instead of 16KB jumbo clusters for the Rx buffers, 9KB clusters are
enough - ENA MTU is being set to 9K anyway, so it's very unlikely that
more space than 9KB will be needed.

However, 9KB jumbo clusters can still cause issues, so by default the
page size mbuf cluster will be used for the Rx descriptors. This can have a
small (~2%) impact on the throughput of the device, so to restore
original behavior, one must change sysctl "hw.ena.enable_9k_mbufs" to
"1" in "/boot/loader.conf" file.

As a part of this patch (important fix), the version of the driver
was updated to v2.1.2.

Submitted by:   cperciva
Reviewed by:    Michal Krawczyk <mk@semihalf.com>
Reviewed by:    Ido Segev <idose@amazon.com>
Reviewed by:    Guy Tzalik <gtzalik@amazon.com>
MFC after:      3 days
PR:             225791, 234838, 235856, 236989, 243531
Differential Revision: https://reviews.freebsd.org/D24546

4 years agoNF has an internal option that changes the tcp_mcopy_m routine slightly (has
rrs [Thu, 7 May 2020 10:46:02 +0000 (10:46 +0000)]
NF has an internal option that changes the tcp_mcopy_m routine slightly (has
a few extra arguments). Recently that changed to only have one arg extra so
that two ifdefs around the call are no longer needed. Lets take out the
extra ifdef and arg.

Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D24736

4 years agoFix indentation of the Kitty entry
bapt [Thu, 7 May 2020 08:58:08 +0000 (08:58 +0000)]
Fix indentation of the Kitty entry

MFC after: 2 days

4 years agoAdd rib_lookup() sockaddr lookup wrapper and make ifa_ifwithroute use it.
melifaro [Thu, 7 May 2020 08:11:36 +0000 (08:11 +0000)]
Add rib_lookup() sockaddr lookup wrapper and make ifa_ifwithroute use it.

Create rib_lookup() wrapper around per-af dataplane lookup functions.
This will help in the cases of having control plane af-agnostic code.

Switch ifa_ifwithroute() to use this function instead of rtalloc1().

Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D24731

4 years agovirtio: Support MMIO bus for all devices
jrtc27 [Wed, 6 May 2020 23:31:30 +0000 (23:31 +0000)]
virtio: Support MMIO bus for all devices

The bus is independent of the device, so all devices can be attached to
either a PCI bus or an MMIO bus. For example, QEMU's virtio-rng-device
gives the MMIO variant of virtio-rng-pci, and is now detected.

Reviewed by: andrew, br, brooks (mentor)
Approved by: andrew, br, brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D24730

4 years agovirtio_mmio: Support non-transitional version 2 devices
jrtc27 [Wed, 6 May 2020 23:28:51 +0000 (23:28 +0000)]
virtio_mmio: Support non-transitional version 2 devices

The non-legacy virtio MMIO specification drops the use of PFNs and
replaces them with physical addresses. Whilst many implementations are
so-called transitional devices, also implementing the legacy
specification, TinyEMU[1] does not. Device-specific configuration
registers have also changed to being little-endian, and must be accessed
using a single aligned access for registers up to 32 bits, and two
32-bit aligned accesses for 64-bit registers.

[1] https://bellard.org/tinyemu/

Reviewed by: br, brooks (mentor)
Approved by: br, brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D24681

4 years agoDeprecate ubsec(4) for FreeBSD 13.0.
jhb [Wed, 6 May 2020 22:15:09 +0000 (22:15 +0000)]
Deprecate ubsec(4) for FreeBSD 13.0.

With the removal of in-tree consumers of DES, Triple DES, and
MD5-HMAC, the only algorithm this driver still supports is SHA1-HMAC.
This is not very useful as a standalone algorithm (IPsec AH-only with
SHA1 would be the only user).

This driver has also not been kept up to date with the original driver
in OpenBSD which supports a few more cards and AES-CBC on newer cards.
The newest card currently supported by this driver was released in
2005.

Reviewed by: cem
MFC after: 1 week
Relnotes: yes
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D24691

4 years agoMerge commit 4ca2cad94 from llvm git (by Justin Hibbits):
dim [Wed, 6 May 2020 19:10:39 +0000 (19:10 +0000)]
Merge commit 4ca2cad94 from llvm git (by Justin Hibbits):

  [PowerPC] Add clang -msvr4-struct-return for 32-bit ELF

  Summary:

  Change the default ABI to be compatible with GCC. For 32-bit ELF
  targets other than Linux, Clang now returns small structs in
  registers r3/r4. This affects FreeBSD, NetBSD, OpenBSD. There is no
  change for 32-bit Linux, where Clang continues to return all structs
  in memory.

  Add clang options -maix-struct-return (to return structs in memory)
  and -msvr4-struct-return (to return structs in registers) to be
  compatible with gcc. These options are only for PPC32; reject them on
  PPC64 and other targets. The options are like -fpcc-struct-return and
  -freg-struct-return for X86_32, and use similar code.

  To actually return a struct in registers, coerce it to an integer of
  the same size. LLVM may optimize the code to remove unnecessary
  accesses to memory, and will return i32 in r3 or i64 in r3:r4.

  Fixes PR#40736

  Patch by George Koehler!

  Reviewed By: jhibbits, nemanjai
  Differential Revision: https://reviews.llvm.org/D73290

Requested by: jhibbits
MFC after: 3 days

4 years agosrc.conf.5: regen after objdump removal
emaste [Wed, 6 May 2020 18:43:27 +0000 (18:43 +0000)]
src.conf.5: regen after objdump removal

4 years agosrc.opts.mk: with BINUTILS limited to as it is used on i386 and amd64 only
emaste [Wed, 6 May 2020 18:40:52 +0000 (18:40 +0000)]
src.opts.mk: with BINUTILS limited to as it is used on i386 and amd64 only

4 years agoupdate WITH_/WITHOUT_BINUTILS descriptions for objdump removal
emaste [Wed, 6 May 2020 18:39:55 +0000 (18:39 +0000)]
update WITH_/WITHOUT_BINUTILS descriptions for objdump removal

4 years agobinutils: disconnect objdump from the build
emaste [Wed, 6 May 2020 18:38:40 +0000 (18:38 +0000)]
binutils: disconnect objdump from the build

The in-tree binutils is old and will not be updated.  It does not support
all archs supported by FreeBSD, and for the archs it does support not all
CPU features are supported.

Other tools have migrated to copyfree alternatives.  Although llvm-objdump
is nearly a drop-in replacement for GNU objdump it is missing a few options
and has some differences in output format.  For now just remove GNU objdump;
ports and developers can use a contemporary, maintained version from ports
or packages.  We can revisit installing llvm-objdump as objdump in the
future.

PR: 212319 [exp-run]
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7338

4 years agoIn r358396 I merged llvm upstream commit 2e24219d3, which fixed "error:
dim [Wed, 6 May 2020 18:13:00 +0000 (18:13 +0000)]
In r358396 I merged llvm upstream commit 2e24219d3, which fixed "error:
unsupported relocation on symbol" when assembling arm 'adr' pseudo
instructions. However, the upstream commit did not take big-endian arm
into account.

Applying the same changes to the big-endian handling is straightforward,
thanks to Andrew Turner and Peter Smith for the hint. This will also be
submitted upstream.

MFC after: immediately, since this fix is meant for stable/11

4 years agousbhid: add several missing usages from Digitizer page
avg [Wed, 6 May 2020 15:24:31 +0000 (15:24 +0000)]
usbhid: add several missing usages from Digitizer page

This is applicable to HID in general, not just USB HID.

Inspired by: wulf
MFC after: 1 week

4 years agoarm: Don't enable interrupts in init_secondary().
markj [Wed, 6 May 2020 15:10:05 +0000 (15:10 +0000)]
arm: Don't enable interrupts in init_secondary().

This has the same reasoning as described in r357048.

Remove a stray declaration while here.

Reported and tested by: trasz
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoSimplify arm64's pmap_bootstrap() a bit.
markj [Wed, 6 May 2020 15:01:06 +0000 (15:01 +0000)]
Simplify arm64's pmap_bootstrap() a bit.

locore constructs an L2 page mapping the kernel and preloaded data
starting a KERNBASE (the same as VM_MIN_KERNEL_ADDRESS on arm64).
initarm() and pmap_bootstrap() use the preloaded metadata to
tell it where it can start allocating from.

pmap_bootstrap() currently iterates over the L2 page to find the last
valid entry, but doesn't do anything with the result.  Remove the loop
and zap some now-unused local variables.

MFC after: 2 weeks
Sponsored by: Juniper Networks, Klara Inc.
Differential Revision: https://reviews.freebsd.org/D24559

4 years agoAdd basic routing LPM tests.
melifaro [Wed, 6 May 2020 07:48:37 +0000 (07:48 +0000)]
Add basic routing LPM tests.

Differential Revision: https://reviews.freebsd.org/D24684

4 years agoGNU as: print a deprecation warning on program start
emaste [Wed, 6 May 2020 01:08:19 +0000 (01:08 +0000)]
GNU as: print a deprecation warning on program start

GNU as 2.17.50 will be removed before FreeBSD 13.

4 years agoDelete unused function newnfs_trimleading.
rmacklem [Wed, 6 May 2020 00:44:03 +0000 (00:44 +0000)]
Delete unused function newnfs_trimleading.

The NFS function called newnfs_trimleading() has not been used by the
code in long time. To give you a clue, it still had a K&R style function
declaration.
Delete it, since it is just cruft, as a part of the NFS mbuf handling
cleanup in preparation for adding ext_pgs mbuf support.
The ext_pgs mbuf support for the build/send side is needed by
nfs-over-tls.

4 years agoelfctl: update earliest FreeBSD revision to 12.2
emaste [Tue, 5 May 2020 21:50:52 +0000 (21:50 +0000)]
elfctl: update earliest FreeBSD revision to 12.2

elfctl has been merged to stable/12, and so will appear in FreeBSD 12.2

Reported by: Dewayne Geraghty
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoAvoid underflowing a variable, which would result in taking more
tuexen [Tue, 5 May 2020 19:54:30 +0000 (19:54 +0000)]
Avoid underflowing a variable, which would result in taking more
data from the stream queues then needed.

Thanks to Timo Voelker for finding this bug and providing a fix.

MFC after: 3 days

4 years agoAdd HISTORY sections to document when this
bcr [Tue, 5 May 2020 19:31:47 +0000 (19:31 +0000)]
Add HISTORY sections to document when this
functionality first appeared in FreeBSD.

Submitted by: Gordon Bergling gbergling_gmail.com
Approved by: bcr
Differential Revision: https://reviews.freebsd.org/D24677

4 years agoFix broken links in the man page by pointing to a
bcr [Tue, 5 May 2020 19:00:26 +0000 (19:00 +0000)]
Fix broken links in the man page by pointing to a
source that works or is the new location on the
same page.

Submitted by:     alfix86_gmail.com
Approved by:     bcr
Differential Revision: https://reviews.freebsd.org/D23769

4 years agols(1): Fix trivial SEGV due to NULL deref in OOM path
cem [Tue, 5 May 2020 18:06:32 +0000 (18:06 +0000)]
ls(1): Fix trivial SEGV due to NULL deref in OOM path

Reported by: Anton Rang <rang AT acm.org>
Sponsored by: Dell EMC Isilon

4 years agostrdup.3: Slightly canonicalize OOM return/error status
cem [Tue, 5 May 2020 17:57:04 +0000 (17:57 +0000)]
strdup.3: Slightly canonicalize OOM return/error status

Attempted to clean up the language around "this is a malloc'd object."  May be
passed as a parameter to free(3) is a bit obtuse.

Sponsored by: Dell EMC Isilon

4 years agopwcache.3: Explicitly document OOM condition
cem [Tue, 5 May 2020 17:55:45 +0000 (17:55 +0000)]
pwcache.3: Explicitly document OOM condition

The pwcache functions allocate memory, and may return NULL pointers if that
allocation fails and the corresponding uid or gid was not found in the local
password database.  Document this behavior.

Sponsored by: Dell EMC Isilon

4 years agoFix the computation of the numbers of entries of the mapping array to
tuexen [Tue, 5 May 2020 17:52:44 +0000 (17:52 +0000)]
Fix the computation of the numbers of entries of the mapping array to
look at when generating a SACK. This was wrong in case of sequence
numbers wrap arounds.

Thanks to Gwenael FOURRE for reporting the issue for the userland stack:
https://github.com/sctplab/usrsctp/issues/462
MFC after: 3 days

4 years agoacpi_video: try our best to work on systems without non-essential methods
avg [Tue, 5 May 2020 12:14:11 +0000 (12:14 +0000)]
acpi_video: try our best to work on systems without non-essential methods

Only _BCL and _BCM methods seem to be essential to the driver's
operation.  If _BQC is missing then we can assume that the current
brightness is whatever we set by the last _BCM invocation.  If _DCS or
_DGS is missing the we can make assumptions as well.

The change is based on a patch suggested by Anthony Jenkins
<Scoobi_doo@yahoo.com> in PR 207086.

PR: 207086
Submitted by: Anthony Jenkins <Scoobi_doo@yahoo.com (earlier version)
Reviewed by: manu
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D24653

4 years agoFix the EFI_DEBUG case, prio_str is only used when EFI_DEBUG is unset.
andrew [Tue, 5 May 2020 10:01:10 +0000 (10:01 +0000)]
Fix the EFI_DEBUG case, prio_str is only used when EFI_DEBUG is unset.

Sponsored by: Innovate UK

4 years agoAs with r352446 align blocks in boot1.efi
andrew [Tue, 5 May 2020 09:42:26 +0000 (09:42 +0000)]
As with r352446 align blocks in boot1.efi

We need to ensure the buffers are aligned before passing them to ReadBlocks.
Assume 512 bytes is enough for now.

Reviewed by: imp
MFC after: 1 month
Sponsored by: Innovate UK

4 years agoRevert r360514, to avoid unnecessary churn of the sources.
rmacklem [Tue, 5 May 2020 00:58:03 +0000 (00:58 +0000)]
Revert r360514, to avoid unnecessary churn of the sources.

r360514 prepared the NFS code for changes to handle ext_pgs mbufs on
the receive side. However, at this time, KERN_TLS does not pass
ext_pgs mbufs up through soreceive(). As such, as this time, only
the send/build side of the NFS mbuf code needs to handle ext_pgs mbufs.
Revert r360514 since the rather extensive changes required for receive
side ext_pgs mbufs are not yet needed.
This avoids unnecessary churn of the sources.

4 years agoInitial support for bhyve save and restore.
jhb [Tue, 5 May 2020 00:02:04 +0000 (00:02 +0000)]
Initial support for bhyve save and restore.

Save and restore (also known as suspend and resume) permits a snapshot
to be taken of a guest's state that can later be resumed.  In the
current implementation, bhyve(8) creates a UNIX domain socket that is
used by bhyvectl(8) to send a request to save a snapshot (and
optionally exit after the snapshot has been taken).  A snapshot
currently consists of two files: the first holds a copy of guest RAM,
and the second file holds other guest state such as vCPU register
values and device model state.

To resume a guest, bhyve(8) must be started with a matching pair of
command line arguments to instantiate the same set of device models as
well as a pointer to the saved snapshot.

While the current implementation is useful for several uses cases, it
has a few limitations.  The file format for saving the guest state is
tied to the ABI of internal bhyve structures and is not
self-describing (in that it does not communicate the set of device
models present in the system).  In addition, the state saved for some
device models closely matches the internal data structures which might
prove a challenge for compatibility of snapshot files across a range
of bhyve versions.  The file format also does not currently support
versioning of individual chunks of state.  As a result, the current
file format is not a fixed binary format and future revisions to save
and restore will break binary compatiblity of snapshot files.  The
goal is to move to a more flexible format that adds versioning,
etc. and at that point to commit to providing a reasonable level of
compatibility.  As a result, the current implementation is not enabled
by default.  It can be enabled via the WITH_BHYVE_SNAPSHOT=yes option
for userland builds, and the kernel option BHYVE_SHAPSHOT.

Submitted by: Mihai Tiganus, Flavius Anton, Darius Mihai
Submitted by: Elena Mihailescu, Mihai Carabas, Sergiu Weisz
Relnotes: yes
Sponsored by: University Politehnica of Bucharest
Sponsored by: Matthew Grooms (student scholarships)
Sponsored by: iXsystems
Differential Revision: https://reviews.freebsd.org/D19495

4 years agoAdd net epoch support back, which was taken out by accident in
tuexen [Mon, 4 May 2020 23:05:11 +0000 (23:05 +0000)]
Add net epoch support back, which was taken out by accident in
https://svnweb.freebsd.org/changeset/base/360639

Reviewed by: rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D24694

4 years agoThis fixes two issues found by ankitraheja09@gmail.com
rrs [Mon, 4 May 2020 23:02:58 +0000 (23:02 +0000)]
This fixes two issues found by ankitraheja09@gmail.com
1) When BBR retransmits the syn it was messing up the snd_max
2) When we need to send a RST we might not send it when we should

Reported by: ankitraheja09@gmail.com
Sponsored by:  Netflix.com
Differential Revision: https://reviews.freebsd.org/D24693

4 years agoUse a lookup table of algorithm types for alg_is_* helpers.
jhb [Mon, 4 May 2020 22:31:38 +0000 (22:31 +0000)]
Use a lookup table of algorithm types for alg_is_* helpers.

This makes it easier to maintain these functions as algorithms are
added or removed.

Reviewed by: cem
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D24668

4 years agoEnter the net epoch before calling the output routine in TCP BBR.
tuexen [Mon, 4 May 2020 22:02:49 +0000 (22:02 +0000)]
Enter the net epoch before calling the output routine in TCP BBR.
This was only triggered when setting the IPPROTO_TCP level socket
option TCP_DELACK.
This issue was found by runnning an instance of SYZKALLER.
Reviewed by: rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D24690

4 years agoThis commit brings things into sync with the advancements that
rrs [Mon, 4 May 2020 20:28:53 +0000 (20:28 +0000)]
This commit brings things into sync with the advancements that
have been made in rack and adds a few fixes in BBR. This also
removes any possibility of incorrectly doing OOB data the stacks
do not support it. Should fix the skyzaller crashes seen in the
past. Still to fix is the BBR issue just reported this weekend
with the SYN and on sending a RST. Note that this version of
rack can now do pacing as well.

Sponsored by:Netflix Inc
Differential Revision:https://reviews.freebsd.org/D24576

4 years agoAdjust the fb to have a way to ask the underlying stack
rrs [Mon, 4 May 2020 20:19:57 +0000 (20:19 +0000)]
Adjust the fb to have a way to ask the underlying stack
if it can support the PRUS option (OOB). And then have
the new function call that to validate and give the
correct error response if needed to the user (rack
and bbr do not support obsoleted OOB data).

Sponsoered by: Netflix Inc.
Differential Revision:  https://reviews.freebsd.org/D24574

4 years agoSet LG_VADDR to 48 on RISC-V.
brooks [Mon, 4 May 2020 17:16:30 +0000 (17:16 +0000)]
Set LG_VADDR to 48 on RISC-V.

The Sv48 PTE format is the largest currently defined address space for
RISC-V. It makes no sense to define a larger size and doing so (at
least for 64-bits) forces rtrees down a slow path.

Reviewed by: vangyzen, jhb, mhorne
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24658

4 years agoAdd RFC reference for AES-CTR with IPsec.
jhb [Mon, 4 May 2020 16:50:01 +0000 (16:50 +0000)]
Add RFC reference for AES-CTR with IPsec.

MFC after: 1 week
Sponsored by: Chelsio Communications

4 years agoSwitch DDB show route to direct rnh_matchaddr() call instead of rtalloc1().
melifaro [Mon, 4 May 2020 15:07:57 +0000 (15:07 +0000)]
Switch DDB show route to direct rnh_matchaddr() call instead of rtalloc1().

Eliminate the last rtalloc1() call to finish transition to the new routing
KPI defined in r359823.

Differential Revision: https://reviews.freebsd.org/D24663

4 years agoSimplify address parsing in DDB show route command.
melifaro [Mon, 4 May 2020 15:00:19 +0000 (15:00 +0000)]
Simplify address parsing in DDB show route command.

Use db_get_line() to overcome parser limitation.

Differential Revision: https://reviews.freebsd.org/D24662

4 years agoRemove now-unused rt_ifp,rt_ifa,rt_gateway,rt_mtu rte fields.
melifaro [Mon, 4 May 2020 14:31:45 +0000 (14:31 +0000)]
Remove now-unused rt_ifp,rt_ifa,rt_gateway,rt_mtu rte fields.

After converting routing subsystem customers to use nexthop objects
 defined in r359823, some fields in struct rtentry became unused.

This commit removes rt_ifp, rt_ifa, rt_gateway and rt_mtu from struct rtentry
 along with the code initializing and updating these fields.

Cleanup of the remaining fields will be addressed by D24669.

This commit also changes the implementation of the RTM_CHANGE handling.
Old implementation tried to perform the whole operation under radix WLOCK,
 resulting in slow performance and hacks like using RTF_RNH_LOCKED flag.
New implementation looks up the route nexthop under radix RLOCK, creates new
 nexthop and tries to update rte nhop pointer. Only last part is done under
 WLOCK.
In the hypothetical scenarious where multiple rtsock clients
 repeatedly issue RTM_CHANGE requests for the same route, route may get
 updated between read and update operation. This is addressed by retrying
 the operation multiple (3) times before returning failure back to the
 caller.

Differential Revision: https://reviews.freebsd.org/D24666

4 years agoRevert r360204, sys.netipsec.tunnel.empty.v{4,6} are fixed by r360560
lwhsu [Mon, 4 May 2020 11:23:55 +0000 (11:23 +0000)]
Revert r360204, sys.netipsec.tunnel.empty.v{4,6} are fixed by r360560

PR: 245832
Sponsored by: The FreeBSD Foundation

4 years ago[evdev] Sync event codes with Linux kernel 5.6
wulf [Mon, 4 May 2020 11:00:24 +0000 (11:00 +0000)]
[evdev] Sync event codes with Linux kernel 5.6

MFC after: 2 weeks

4 years ago[evdev] Add AT translated set1 scancodes for F-unlocked F1-12 keys.
wulf [Mon, 4 May 2020 10:59:17 +0000 (10:59 +0000)]
[evdev] Add AT translated set1 scancodes for F-unlocked F1-12 keys.

"F lock" is a switch between two sets of scancodes for function keys F1-F12
found on some Logitech and Microsoft PS/2 keyboards [1]. When "F lock" is
pressed, then F1-F12 act as function keys and produce usual keyscans for
these keys. When "F lock" is depressed, F1-F12 produced the same keyscans
but prefixed with E0.
Some laptops use [2] E0-prefixed F1-F12 scancodes for non-standard keys.

[1] https://www.win.tue.nl/~aeb/linux/kbd/scancodes-6.html
[2] https://reviews.freebsd.org/D21565

MFC after: 2 weeks

4 years agoOptimise use of sg_page_count() in __sg_page_iter_next() in the LinuxKPI.
hselasky [Mon, 4 May 2020 10:10:07 +0000 (10:10 +0000)]
Optimise use of sg_page_count() in __sg_page_iter_next() in the LinuxKPI.
No need to compute value twice.

No functional change intended.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoImplement more scatter and gather functions in the LinuxKPI.
hselasky [Mon, 4 May 2020 09:58:45 +0000 (09:58 +0000)]
Implement more scatter and gather functions in the LinuxKPI.

Differential Revision: https://reviews.freebsd.org/D24611
Submitted by: ashafer_badland.io (Austin Shafer)
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoFix warning about sleeping with non-sleepable lock when allocating
hselasky [Mon, 4 May 2020 08:05:01 +0000 (08:05 +0000)]
Fix warning about sleeping with non-sleepable lock when allocating
"current" from linux_cdev_pager_populate() in the LinuxKPI:

Backtrace:
witness_debugger()
witness_warn()
uma_zalloc_arg()
malloc()
linux_alloc_current()
linux_cdev_pager_populate()
vm_fault()
vm_fault_trap()
trap_pfault()
trap()
calltrap()

Suggested by: avg@
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years ago - Fix logic error in swapoff case: follow same handling of p and
delphij [Mon, 4 May 2020 05:49:11 +0000 (05:49 +0000)]
 - Fix logic error in swapoff case: follow same handling of p and
   linelen in the swapon case.
 - Use strlcpy instead of strncpy.

MFC after: 1 week

4 years agoFix intermittent cleanup failures in the ggated test
asomers [Sun, 3 May 2020 18:10:54 +0000 (18:10 +0000)]
Fix intermittent cleanup failures in the ggated test

MFC after: 2 weeks

4 years agoAdd session locking in cfiscsi_ioctl_handoff().
mav [Sun, 3 May 2020 16:14:55 +0000 (16:14 +0000)]
Add session locking in cfiscsi_ioctl_handoff().

While there, remove ifdef around cs_target check in cfiscsi_ioctl_list().
I am not sure why this ifdef was added, but without this check code will
crash below on NULL dereference.

Submitted by: Aleksandr Fedorov <aleksandr.fedorov@itglobal.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24587

4 years agopf: Improve DIOCADDRULE validation
kp [Sun, 3 May 2020 16:09:35 +0000 (16:09 +0000)]
pf: Improve DIOCADDRULE validation

We expect the addrwrap.p.dyn value to be set to NULL (and assert such),
but do not verify it on input.

Reported-by: syzbot+936a89182e7d8f927de1@syzkaller.appspotmail.com
Reviewed by: melifaro (previous version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24538