Commit Graph

221315 Commits

Author SHA1 Message Date
Pedro F. Giffuni
4b6fa244b2 mpsutil(8): let calloc(3) do the multiplying. 2017-03-13 20:49:31 +00:00
Pedro F. Giffuni
87959e27fd nscd(8): let calloc(3) do the multiplying.
MFC after:	1 week
2017-03-13 20:34:53 +00:00
Pedro F. Giffuni
6613eaa42b mkimg(1): let calloc(3) do the multiplication.
Reviewed by:	marcel
MFC after:	1 week
2017-03-13 20:14:07 +00:00
Bryan Drewery
bba279e552 hier(7): Fix entry location for /usr/share/vt.
MFC after:	2 weeks
2017-03-13 19:54:20 +00:00
Mark Johnston
e20ff1a4d4 Update a comment to reflect reality.
MFC after:	1 week
2017-03-13 18:45:25 +00:00
Mark Johnston
9fc47d244c Fix a backwards comparison in the code to dump a DTrace debug buffer.
PR:		217739
MFC after:	1 week
2017-03-13 18:43:00 +00:00
Conrad Meyer
fdb727f4f2 alias_proxy.c: Fix accidental error quashing
This was introduced on accident in r165243, when return sites were unified
to add a lock around LibAliasProxyRule().

PR:		217749
Submitted by:	Svyatoslav <razmyslov at viva64.com>
Sponsored by:	Viva64 (PVS-Studio)
2017-03-13 18:05:31 +00:00
Enji Cooper
f321675a98 bsnmpd: fix segfault when trans_insert_port(..) is called with multiple
out of order addresses

Move `port->transport` initialization before the TAILQ_FOREACH(..) loop
to ensure that the value is properly initialized before it's inserted
into the TAILQ.

MFC after:	1 week
PR:		217760
Submitted by:	eugen
Sponsored by:	Dell EMC Isilon
2017-03-13 18:01:01 +00:00
Conrad Meyer
da1d1cd3fe scif_sas_controller: Fix inverted logic range check
PR:		217742
Submitted by:	Svyatoslav <razmyslov at viva64.com>
Sponsored by:	Viva64 (PVS-Studio)
2017-03-13 17:58:08 +00:00
Conrad Meyer
49b6a5d60a nat64lsn: Use memset() with structure, not pointer, size
PR:		217738
Submitted by:	Svyatoslav <razmyslov at viva64.com>
Sponsored by:	Viva64 (PVS-Studio)
2017-03-13 17:53:46 +00:00
Enji Cooper
7e431900a5 sbin/dhclient: fix vendor storage leak in parse_option_decl(..)
This ensures the storage isn't leaked when non-NULL and the function
returns early, prior to the `free(vendor)` later on in the function.

MFC after:	1 week
Reported by:	Coverity
CID:		1007111-1007113
Reviewed by:	cem
Sponsored by:	Dell EMC Isilon
Differential Revision:	D9993
2017-03-13 17:45:00 +00:00
Enji Cooper
87b3dc5107 lib/libcam/cam_cdbparse.3: fix manpage warnings
- Add comma before and after 'e.g.'; remove surrounding parentheses
  that were unnecessary after this change [1].
- Add .Mt when referencing ken and Peter Dufault's email addresses
  [2].
- Sprinkle around .An use where proper [2].

Bump .Dd for the change

MFC after:	1 week
Reported by:	igor [1], manlint [2]
Reviewed by:	imp
Sponsored by:	Dell EMC Isilon
Differential Revision:	D9968
2017-03-13 17:35:55 +00:00
Navdeep Parhar
73832aae54 cxgbe(4): Fix an always-true assertion (reported by PVS-Studio).
sys/dev/cxgbe/t4_main.c: PVS-Studio: Expression is Always True (CWE-571) (3)

PR:		217746
Submitted by:	Svyatoslav (razmyslov at viva64 com)
MFC after:	1 week
2017-03-13 17:16:29 +00:00
Enji Cooper
513bdaa141 Fix -Wunused-but-set-warning with ret
While here, resolve Coverity warnings by demonstrating that vfprintf's
return value is being explicitly ignored.

MFC after:	1 week
Reported by:	gcc 6.3.0
Tested with:	clang, gcc 4.2.1, gcc 6.3.0
Sponsored by:	Dell EMC Isilon
2017-03-13 17:15:45 +00:00
Enji Cooper
6c5b1b394d sbin/dhclient: fix a memory leak in parse_client_lease_statement(..)
The memory stored by `lease` would have previously been leaked if an
unterminated lease declaration was found in an early-return code path.

MFC after:	1 week
Reported by:	clang static analyzer, Coverity
CID:		1007114
Submitted by:	Tom Rix <trix@juniper.net>
Sponsored by:	Dell EMC Isilon; Juniper, Inc
Differential Revision:	D9992
2017-03-13 17:05:49 +00:00
Adrian Chadd
e3e94c963e [net80211] begin fleshing out per-VAP WME configurations.
As part of (eventual) p2p/tdls/multi-STA support, a lot of global configuration
parameters (WME, ERP (slot, preamble), channel width, HT protmode, etc are the
biggest offenders) should be per-VAP.

For multi-BSS VAP operation they may be linked, but for p2p/TDLS
operation that can be off-channel they can definitely be different
(think: 2GHz STA, 5GHz p2p.)

The global configuration view of these is mostly a "configure the current
non-smart-firmware NIC" view.  This should be split up into per-VAP state,
then a global non-smart-firmware-NIC management layer to handle channel
changes and such in software.

This is step one in a loooong road for this.  It should be a big non-functional
change for everyone.

* create a per-VAP WME update call.
* call it if its set, and call the global callback if it isn't

This still uses global WME state - it's just preparation for a future change
which will make the WME state per-VAP and fall through to a shared WME
configuration for hostap operation.

Note: this requires a full kernel recompile; the internal net80211 ABI has changed.

Reviewed by:	avos
Differential Revision:	https://reviews.freebsd.org/D9986
2017-03-13 16:44:06 +00:00
Baptiste Daroussin
78f6a0c14a Do not die if cap_rights_limit reports ENOSYS
Reported by:	mmel
2017-03-13 15:34:21 +00:00
Marcelo Araujo
7f5f84f08f After r315112 I broke the tests with eli, instead to pass 0, I should pass
M_NOWAIT to g_media_changed() that will call g_post_event() with this flag.

Reported by:	lwhsu, ngie and ae
2017-03-13 13:56:01 +00:00
Scott Long
d8474e52e3 Report disk flags via the sysctl tree 2017-03-13 11:09:17 +00:00
Andrey V. Elsukov
250a8e2720 Ignore ifnet renaming in the bpf ifnet departure handler.
PR:		213015
MFC after:	1 week
2017-03-13 09:04:10 +00:00
Scott Long
286ab2b514 Add constants and descriptions for some new PCI class definitions 2017-03-13 07:45:15 +00:00
Pedro F. Giffuni
e449183c70 Minor libc cleanup: let calloc(3) do the multiplication.
MFC after:	3 days
2017-03-13 04:14:03 +00:00
Enji Cooper
c876175c61 lib/libcam/cam.3: note that cam_freeccb(3) with ccb == NULL is a no-op
This allows me to accurately test this scenario, and for others to rely
on the behavior, instead of relying on knowledge obtained via code
inspection.

Wording borrowed from free(3).

MFC after:	1 week
Requested by:	ken (D9928)
Reviewed by:	imp
Sponsored by:	Dell EMC Isilon
Differential Revision:	D9969
2017-03-13 02:12:33 +00:00
Enji Cooper
12211016f5 Fix CFLAGS for including netipsec headers #includes
The netipsec headers are referenced via netipsec/..., not ./... .
Thus, assuming that the netipsec/... is nested under ${SRCTOP}/sys/netipsec
is wrong.

This tripped up some individuals building ^/head on systems pre-r314812.

MFC after:	1 week
Reported by:	Roberto Rodriguez Jr <rob.rodz.jr9@gmail.com>
Sponsored by:	Dell EMC Isilon
2017-03-13 01:05:25 +00:00
Baptiste Daroussin
ff80781570 Readd codes that creates a tmp file for diffing stdout or devices 2017-03-12 20:19:37 +00:00
Oleksandr Tymoshenko
5bc8258168 [evdev] Fix Right Alt and Keypad Enter event codes for atkbd(4) and kbdmux(4) drivers
Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D9320
2017-03-12 19:28:44 +00:00
Oleksandr Tymoshenko
6bc7e1b21b [evdev] Fix race condition between client's event queue reading and dropping
Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D9320
2017-03-12 19:27:44 +00:00
Oleksandr Tymoshenko
670aa764b0 [evdev] Do not ignore result evdev_register in UI_DEV_CREATE handler
Make sure that uinput state field reflects actual state by checking
evdev_register result for errors

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
Differential Revision:	https://reviews.freebsd.org/D9320
2017-03-12 19:26:24 +00:00
Warner Losh
ffec315183 Convert gnu to using SRCTOP
Prefer SRCTOP over CURDIR/../../contrib, etc. However, retain the "up
one level" instances of ../ because they are really relative to this
part of the tree and not a means to find the root of the tree. As
such, it's better to leave them since that further the goal of being
able to move directories if watned to in the future.

Differential Revision:	https://reviews.freebsd.org/D9932
Sponsored by:		Netflix
Silence	On:		arch@ (twice)
2017-03-12 18:59:16 +00:00
Warner Losh
23583802cf Make rescue use SRCTOP
Transition to SRCTOP. Also, standardize of {} instead of () variable
deliminators while I'm here.

Differential Revision:	https://reviews.freebsd.org/D9932
Sponsored by:		Netflix
Silence	On:		arch@ (twice)
2017-03-12 18:59:09 +00:00
Warner Losh
484482b8ad Fix two CURDIR references in comments that should be SRCTOP
references.

Differential Revision:	https://reviews.freebsd.org/D9932
Sponsored by:		Netflix
Silence	On:		arch@ (twice)
2017-03-12 18:59:05 +00:00
Warner Losh
28d60d6a80 Convert include over to SRCTOP
Use SRCTOP in place of .CURDIR/.. as appropriate. The hand-crafted
relative paths for the "links" option remain, though, since those are
relative to /usr/include/sys/<blah> not to the source tree.

Differential Revision:	https://reviews.freebsd.org/D9932
Sponsored by:		Netflix
Silence	On:		arch@ (twice)
2017-03-12 18:59:00 +00:00
Warner Losh
6dcff5b77c Move /etc/ to SRCTOP
Prefer ${SRCTOP}/ to ${.CURDIR}/../ and ${.CURDIR}/../../ as appropriate.

Differential Revision:  https://reviews.freebsd.org/D9932
Sponsored by:		Netflix
Silence On:		arch@ (twice)
2017-03-12 18:58:55 +00:00
Warner Losh
a35f04fba2 Adopt SRCTOP in usr.bin
Prefer ${SRCTOP}/foo over ${.CURDIR}/../../foo and ${SRCTOP}/usr.bin/foo
over ${.CURDIR}/../foo for paths in Makefiles.

Differential Revision:	https://reviews.freebsd.org/D9932
Sponsored by:		Netflix
Silence on:		arch@ (twice)
2017-03-12 18:58:44 +00:00
Ian Lepore
e3f87f6c70 Change 'Hz' back to 'HZ'... it's referring to the kernel config option
named HZ, not being used as an abbreviation of the unit of measure.
2017-03-12 18:07:03 +00:00
Warner Losh
1c2eb3e8d1 Export the actual LID state via sysctl. This allows more complex
policies about when to suspend based on other events happening AND the
lid being closed through the use of clever devd or other scripts.
2017-03-12 18:00:02 +00:00
Ian Lepore
8a3966405e Correct the abbreviations for microseconds (us, not ms), and for Hz (not HZ). 2017-03-12 17:43:45 +00:00
Pedro F. Giffuni
94a1344578 Revert r314780
libpam: extra bounds checking through reallocarray(3).

It appears to be causing brokenness when reporting PAM_* environment
variables. This requires more investigation.

Reported by:	lstewart
2017-03-12 17:41:51 +00:00
Alexander Motin
c44f58fce9 Remove strange config_intrhook_establish() magic.
Interrupts are enabled as part of chip reset just during driver attach.
Later "enabling" of already enabled interrupts is useless.

MFC after:	2 weeks
2017-03-12 16:55:18 +00:00
Pedro F. Giffuni
9f36610f9e libc: provide some bounds-checking through reallocarray(3).
reallocarray(3) is a non portable extension that originated in OpenBSD.
Given that it is already in FreeBSD's libc it is useful for the cases
where reallocation involves a multiplication.

MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D9955
2017-03-12 16:03:34 +00:00
Alexander Motin
ab23521a49 Try to slight untangle I/O and loop status handling.
MFC after:	2 weeks
2017-03-12 15:36:07 +00:00
Alexander Motin
229203af68 Remove code for unsupported FreeBSD versions.
MFC after:	2 weeks
2017-03-12 14:17:57 +00:00
Konstantin Belousov
9a2dde8013 Avoid reusing p_ksi while it is on queue.
When sending SIGCHLD informing reaper that a zombie was reparented to
it, we might race with the situation where the previous parent still
not finished delivering SIGCHLD and having its p_ksi structure on the
signal queue.  While on queue, the ksi should not be used for another
send.

Fix this by copying p_ksi into newly allocated ksi, which is directly
put onto reaper sigqueue.  The later ensures that siginfo for reaper
SIGCHLD is always present, similar to guarantees for siginfo of child.

Reported by:	bdrewery
Discussed with:	jilles
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-03-12 13:58:51 +00:00
Konstantin Belousov
2b6d1a639b Follow-up to r313690.
Fix two missed places where vm_object offset to index calculation
should use unsigned shift, to allow handling of full range of unsigned
offsets used to create device mappings.

Reported and tested by:	royger (previous version)
Reviewed by:	alc (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-03-12 13:53:13 +00:00
Konstantin Belousov
9bcf2f2da0 Accept linkers representation for ELF segments with zero on-disk length.
For such segments, GNU bfd linker writes knowingly incorrect value
into the the file offset field of the program header entry, with the
motivation that file should not be mapped for creation of this segment
at all.

Relax checks for the ELF structure validity when on-disk segment
length is zero, and explicitely set mapping length to zero for such
segments to avoid validating rounding arithmetic.

PR:	217610
Reported by:	Robert Clausecker <fuz@fuz.su>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-03-12 13:51:13 +00:00
Konstantin Belousov
973d67c407 Style.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-03-12 13:49:42 +00:00
Konstantin Belousov
1e4296c919 Ktracing kevent(2) calls with unusual arguments might leads to an
overly large allocation requests.

When ktrace-ing io, sys_kevent() allocates memory to copy the
requested changes and reported events.  Allocations are sized by the
incoming syscall lengths arguments, which are user-controlled, and
might cause overflow in calculations or too large allocations.

Since io trace chunks are limited by ktr_geniosize, there is no sense
it even trying to satisfy unbounded allocations.  Export ktr_geniosize
and clamp the buffers sizes in advance.

PR:	217435
Reported by:	Tim Newsham <tim.newsham@nccgroup.trust>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-03-12 13:48:24 +00:00
Alexander Motin
2b665a98b5 Some more polishing.
MFC after:	13 days
2017-03-12 12:38:16 +00:00
Dag-Erling Smørgrav
64c422355d Add a __printflike() that would have caught the bug fixed in r314396. 2017-03-12 11:54:35 +00:00
Tijl Coosemans
971c1c4219 - Remove separate handling of /bin and /usr/bin in manpath. They are no
longer a special case.
- Prefer PREFIX/share/man over PREFIX/man.
- Add /usr/local/share/man to man_default_path.
- Update manpath man page.

Reviewed by:	bapt
2017-03-12 10:56:19 +00:00