Commit Graph

243985 Commits

Author SHA1 Message Date
Ed Maste
7381dcc9ee libc: remove gets
gets is unsafe and shouldn't be used (for many years now).  Leave it in
the existing symbol version so anything that previously linked aginst it
still runs, but do not allow new software to link against it.

(The compatability/legacy implementation must not be static so that
the symbol and in particular the compat sym gets@FBSD_1.0 make it
into libc.)

PR:		222796 (exp-run)
Reported by:	Paul Vixie
Reviewed by:	allanjude, cy, eadler, gnn, jhb, kib, ngie (some earlier)
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D12298
2019-09-01 16:12:05 +00:00
Santhosh Raju
47b9005348 Add myself (fox) and update the mentor information.
Approved by:	philip (mentor)
2019-09-01 15:39:28 +00:00
Vincenzo Maffione
253b2ec199 netmap: import changes from upstream (SHA 137f537eae513)
- Rework option processing.
 - Use larger integers for memory size values in the
   memory management code.

MFC after:	2 weeks
2019-09-01 14:47:41 +00:00
Mateusz Guzik
2796c209b0 vfs: stop refing freed mount points in vop_stdgetwritemount
The code used blindly ref based on an unsafely red address and then would
backpedal if necessary. This was safe in terms of memory access since
mounts are type-stable, but made for a potential a bug where the mount
was reused and had the count reset to 0 before this code decreased it.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21411
2019-09-01 14:01:09 +00:00
Michael Tuexen
b21097894e Fix initialization of top_fsn.
MFC after:		3 days
2019-09-01 10:39:16 +00:00
Michael Tuexen
6182677fb3 Improve the handling of state cookie parameters in INIT-ACK chunks.
This fixes problem with parameters indicating a zero length or partial
parameters after an unknown parameter indicating to stop processing. It
also fixes a problem with state cookie parameters after unknown
parametes indicating to stop porcessing.
Thanks to Mark Wodrich from Google for finding two of these issues
by fuzz testing the userland stack and reporting them in
https://github.com/sctplab/usrsctp/issues/355
and
https://github.com/sctplab/usrsctp/issues/352

MFC after:		3 days
2019-09-01 10:09:53 +00:00
Jung-uk Kim
1c9c1f5903 Add support for TP-Link Archer T2U Nano.
MFC after:	2 weeks
2019-09-01 06:40:58 +00:00
Mateusz Guzik
e0f4540a2a nullfs: reduce areas protected by vnode interlock in null_lock
Similarly to the other routine stop taking the interlock for the lower
vnode. The interlock for nullfs vnode is still taken to ensure
stability of ->v_data.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21480
2019-09-01 02:52:00 +00:00
Kyle Evans
32287ea72b posixshm: switch to OBJT_SWAP in advance of other changes
Future changes to posixshm will start tracking writeable mappings in order
to support file sealing. Tracking writeable mappings for an OBJT_DEFAULT
object is complicated as it may be swapped out and converted to an
OBJT_SWAP. One may generically add this tracking for vm_object, but this is
difficult to do without increasing memory footprint of vm_object and blowing
up memory usage by a significant amount.

On the other hand, the swap pager can be expanded to track writeable
mappings without increasing vm_object size. This change is currently in
D21456. Switch over to OBJT_SWAP in advance of the other changes to the
swap pager and posixshm.
2019-09-01 00:33:16 +00:00
Aleksandr Rybalko
c96574f39c ARM kernel can get RAM regions three ways:
o from FDT;
o from EFI;
o from Linux Boot API (ATAG).
U-Boot may pass RAM info all that 3 ways simultaneously.
We do select between FDT and EFI, but not for ATAG.
So this is not problem fix, but correctness check.

MFC after:	2 weeks
2019-08-31 21:28:06 +00:00
Li-Wen Hsu
24612bfd1f Unskip test cases from netbsd-tests by defining __HAVE_FENV
This unskips:
  - lib.libc.stdlib.strtod_test.strtod_round
  - lib.msun.fe_round_test.t_nofe_round

In lib/msun/tests/Makefile only define on fe_round_test.c because
lib.msun.ilogb_test.ilogb will get wrong results and needs more examination.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-08-31 20:45:45 +00:00
Li-Wen Hsu
c4bf2f169a Fix dtrace test case after r351423 due to ping6(8) options changed
Failure test case:
    cddl.usr.sbin.dtrace.common.ip.t_dtrace_contrib.tst_ipv6localicmp_ksh

Sponsored by:	The FreeBSD Foundation
2019-08-31 15:10:27 +00:00
Li-Wen Hsu
8dc0ad14ad Fix tests use /etc/motd after r350184 by using an always existing file
Sponsored by:	The FreeBSD Foundation
2019-08-31 14:41:58 +00:00
Mateusz Guzik
e9fff745a7 zfs: fix snapshot dir destruction after introducion of VOP_NEED_INACTIVE
Reported by:	lwhsu
PR:		240221
Sponsored by:	The FreeBSD Foundation
2019-08-31 13:24:22 +00:00
Michael Tuexen
e30a1788fa Improve function definition.
MFC after:		3 days
2019-08-31 13:13:40 +00:00
Michael Tuexen
ec24a1b67c Improve the handling of illegal sequence number combinations in received
data chunks. Abort the association if there are data chunks with larger
fragement sequence numbers than the fragement sequence of the last
fragment.
Thanks to Mark Wodrich from Google who found this issue by fuzz testing
the userland stack and reporting this issue in
https://github.com/sctplab/usrsctp/issues/355

MFC after:		3 days
2019-08-31 08:18:49 +00:00
Toomas Soome
fd7e6079bc loader.efi: use shift 16 in efipart as it is max ashift supported by zfs 2019-08-31 06:24:09 +00:00
Mateusz Guzik
c2b600f98f vfs: add a missing VNODE_REFCOUNT_FENCE_REL to v_incr_usecount_locked
Sponsored by:	The FreeBSD Foundation
2019-08-30 21:54:45 +00:00
Sevan Janiyan
e12102f114 Earliest reference to /dev/null I can find is in v4 sh(1) and nulldev in
nsys/ken/subr.c
via TUHS archive
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V4

MFC after:	5 days
2019-08-30 21:49:00 +00:00
Toomas Soome
9f7b00f230 qemu-system-aarch64 does list block device with very large block size
Also insert Vendor device as "parent" disk (found in
qemu-system-aarch64 -cpu cortex-a57).

This does fix lsdev in loader.efi on this platform.
2019-08-30 20:54:30 +00:00
Matt Joras
16cf6bdbb6 Wrap a vlan's parent's if_output in a separate function.
When a vlan interface is created, its if_output is set directly to the
parent interface's if_output. This is fine in the normal case but has an
unfortunate consequence if you end up with a certain combination of vlan
and lagg interfaces.

Consider you have a lagg interface with a single laggport member. When
an interface is added to a lagg its if_output is set to
lagg_port_output, which blackholes traffic from the normal networking
stack but not certain frames from BPF (pseudo_AF_HDRCMPLT). If you now
create a vlan with the laggport member (not the lagg interface) as its
parent, its if_output is set to lagg_port_output as well. While this is
confusing conceptually and likely represents a misconfigured system, it
is not itself a problem. The problem arises when you then remove the
lagg interface. Doing this resets the if_output of the laggport member
back to its original state, but the vlan's if_output is left pointing to
lagg_port_output. This gives rise to the possibility that the system
will panic when e.g. bpf is used to send any frames on the vlan
interface.

Fix this by creating a new function, vlan_output, which simply wraps the
parent's current if_output. That way when the parent's if_output is
restored there is no stale usage of lagg_port_output.

Reviewed by:	rstone
Differential Revision:	D21209
2019-08-30 20:19:43 +00:00
Mark Johnston
d794b3a3c2 Update and clean up the UMA man page.
- Fix warnings from igor and mandoc.
- Provide a brief description of the separation between zones and their
  backend slab allocators.
- Document cache zones and secondary zones.
- Document the kernel config options added in r350659.
- Document the uma_zalloc_pcpu() and uma_zfree_pcpu() wrappers.
- Document uma_zone_reserve(), uma_zone_reserve_kva() and
  uma_zone_prealloc().
- Document uma_zone_alloc() and uma_zone_freef().
- Add some missing MLINKs and Xrefs.

MFC after:	2 weeks
2019-08-30 19:35:44 +00:00
Maksim Yevmenkin
444e5d09b5 avoid holding PCB mutex during copyin/copyout()
Reported by:	imp, mms dot vanbreukelingen at gmail dot com
Reviewed by:	imp
2019-08-30 16:35:31 +00:00
John Baldwin
7105f82769 Add entries for unmapped mbufs and KTLS. 2019-08-30 16:30:09 +00:00
Mark Johnston
7da9377b0d Properly check for an interrupted cv_wait_sig().
The returned error number may be EINTR or ERESTART depending on
whether or not the signal is supposed to interrupt the system call.

Reported and tested by:	pho
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-08-30 15:40:31 +00:00
Xin LI
cf955ebf6f Remove unneeded blank line. No functional change.
MFC after:	2 weeks
2019-08-30 06:06:12 +00:00
Mateusz Guzik
3bb8d8d8c9 vfs: tidy up assertions in vfs_subr
- assert unlocked vnode interlock in vref
- assert right counts in vputx
- print debug info for panic in vdrop

Sponsored by:	The FreeBSD Foundation
2019-08-30 00:45:53 +00:00
Ed Maste
d676fedfbc xdma: avoid NULL deref in error case
Reported by:	Dr Silvio Cesare of InfoSect
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2019-08-30 00:40:08 +00:00
Ed Maste
7e0025dea2 qlxgbe: avoid NULL deref in error case
Reported by:	Dr Silvio Cesare of InfoSect
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2019-08-30 00:38:16 +00:00
Ed Maste
ec8416f76d exynos5: avoid NULL deref in error case
Reported by:	Dr Silvio Cesare of InfoSect
MFC after:	3 days
MFC with:	r351618
Sponsored by:	The FreeBSD Foundation
2019-08-30 00:36:17 +00:00
Ed Maste
b2f68d35aa exynos5: avoid NULL deref in error case
Reported by:	Dr Silvio Cesare of InfoSect
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2019-08-30 00:34:27 +00:00
Mateusz Guzik
13c73428dc nullfs: use VOP_NEED_INACTIVE
Reviewed by:	kib
Tested by:	pho (previous version)
Sponsored by:	The FreeBSD Foundation
2019-08-30 00:30:03 +00:00
Gleb Smirnoff
35d3dd8b12 Use mbuf queue instead of ifqueue in USB network drivers.
Reviewed by:	stevek
2019-08-30 00:05:04 +00:00
Gleb Smirnoff
b2005c033e Allow mbuf queues to be unlimited.
There is number of legacy code that uses ifqueue without setting
a limit on it first. Easier to allow for that rather than improve
legacy drivers.
2019-08-30 00:03:41 +00:00
Jason Helfman
7d5b071384 - address missing whitespace for indent
PR:		239727
Submitted by:	gbergling@gmail.com
Reviewed by:	0mp@
MFC after:	1 week
2019-08-29 23:23:12 +00:00
Mark Johnston
9222b82368 Remove unused VM page locking macros.
They were orphaned by r292373.

Reviewed by:	asomers
MFC after:	1 week
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D21469
2019-08-29 22:13:15 +00:00
John Baldwin
6a1e1c2c48 Simplify bhyve vlapic ESR logic.
The bhyve virtual local APIC uses an instance-global flag to indicate
when an error LVT is being delivered to prevent infinite recursion.
Use a function argument instead to reduce the amount of instance-global
state.

This was inspired by reviewing the bhyve save/restore work, which
saves a copy of the instance-global state for each vlapic.

Smart OS bug:	https://smartos.org/bugview/OS-7777
Submitted by:	Patrick Mooney
Reviewed by:	markj, rgrimes
Obtained from:	SmartOS / Joyent
Differential Revision:	https://reviews.freebsd.org/D20365
2019-08-29 18:23:38 +00:00
Niclas Zeising
e5ab16b74b Use relative paths in ObsoleteFiles.inc
Approved by:	imp
Differential Revision:	https://reviews.freebsd.org/D21467
2019-08-29 17:25:50 +00:00
Niclas Zeising
ab0e86509c pwm.9 symlink shouldn't be removed
When the pwm.9 manual was removed, a symlink between pwmbus.9 and pwm.9 was
created, but there's an entry in ObsoleteFiles.inc to remove pwn.9, meaning
that on every installation pwm.9 is created, and make delete-old deletes it.

Remove the entry from ObsoleteFiles.inc, the symlink is clearly intentional
and shouldn't be removed.

Reviewed by:	imp, ian
Approved by:	imp (implicit, review OK)
Differential Revision:	https://reviews.freebsd.org/D21198
2019-08-29 17:17:39 +00:00
Alexander Motin
6a216c0bb5 Take proper lock in ses_setphyspath_callback().
XPT_DEV_ADVINFO call should be protected by the lock of the specific
device it is addressed to, not the lock of SES device.  In some weird
case, probably with hardware violating standards, it sometimes caused
NULL dereference due to race.

To protect from it further, add lock assertion to *_dev_advinfo().

MFC after:	1 week
Sponsored by:	iXsystems, Inc.
2019-08-29 17:02:02 +00:00
Alexander Motin
f4330e6155 Man page for AMD Non-Transparent Bridge (ntb_hw_amd) driver.
Submitted by:	Rajesh Kumar <rajesh1.kumar@amd.com>
Reviewed by:	bcr
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D21462
2019-08-29 13:46:54 +00:00
Yuri Pankov
2051169a4f ichsmb: defer smbus attach until interrupts are available
This fixes a "timed sleep before timers are working" panic seen
while attaching jedec_dimm(4) instances too early in the boot.

Submitted by:	ian
Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D21452
2019-08-29 12:49:21 +00:00
Ed Maste
3485f4574e vnic: avoid NULL deref in error case
Reported by:	Dr Silvio Cesare of InfoSect
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2019-08-29 12:05:06 +00:00
Andriy Gapon
0093b755a7 scsi_cd: whitespace cleanup
Remove trailing whitespace and fix mixed indentation.

MFC after:	3 weeks
2019-08-29 08:26:40 +00:00
Andriy Gapon
c9f2918e69 scsi_cd: ifdef out cdsize()
It was used only by the old cdcheckmedia().

MFC after:	3 weeks
2019-08-29 08:19:11 +00:00
Andriy Gapon
dd78f43259 scsi_cd: make the media check asynchronous
This makes the media check process asynchronous, so we no longer block
in cdstrategy() to check for media.

PR:		219857
Obtained from:	ken
MFC after:	3 weeks
2019-08-29 07:51:11 +00:00
Konstantin Belousov
6470c8d3db Rework v_object lifecycle for vnodes.
Current implementation of vnode_create_vobject() and
vnode_destroy_vobject() is written so that it prepared to handle the
vm object destruction for live vnode.  Practically, no filesystems use
this, except for some remnants that were present in UFS till today.
One of the consequences of that model is that each filesystem must
call vnode_destroy_vobject() in VOP_RECLAIM() or earlier, as result
all of them get rid of the v_object in reclaim.

Move the call to vnode_destroy_vobject() to vgonel() before
VOP_RECLAIM().  This makes v_object stable: either the object is NULL,
or it is valid vm object till the vnode reclamation.  Remove code from
vnode_create_vobject() to handle races with the parallel destruction.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D21412
2019-08-29 07:50:25 +00:00
Konstantin Belousov
1604022248 UFS: stop reusing the vnode for reallocated inode.
In ffs_valloc(), force reclaim existing vnode on inode reuse, instead
of trying to re-initialize the same vnode for new purposes.  This is
done in preparation of changes to the vp->v_object lifecycle handling.

A new FFSV_REPLACE flag to ffs_vgetf() directs the function to
vgone(9) the vnode if found in vfs hash, instead of returning it.

Reviewed by:	markj, mckusick
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D21412
2019-08-29 07:45:23 +00:00
Edward Tomasz Napierala
3dd61c212c Fix qmath(3) build problems with GCC 8.
Discussed with:	asomers
Sponsored by:	Klara Systems
Differential Revision:	https://reviews.freebsd.org/D21442
2019-08-29 07:39:31 +00:00
Konstantin Belousov
04359b5e1e Remove useless redefinition of NSFBUFS in i386/vm_machdep.c.
Sponsored by:	The FreeBSD Foundation
2019-08-29 07:34:14 +00:00