Commit Graph

13332 Commits

Author SHA1 Message Date
Conrad Meyer
3cd1f90972 chpass(1): Check crypt(3) return and handle error appropriately
This change is spiritually similar to the earlier r231994.

PR:		222756
Submitted by:	Lubos Boucek <bouceklubos AT gmail.com>
Obtained from:	DragonflyBSD 2020c8fec4168a5020f984a093224fade3074b25
2017-10-04 01:12:26 +00:00
Edward Tomasz Napierala
3cfa7c6e48 Make procstat(1) recognize process descriptors, so that it shows
"P" instead of "?" in "procstat -af" output. Note that there are
still a few more DTYPE_* kinds we don't decode yet.

Reported by:	rwatson
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D12426
2017-10-03 11:45:24 +00:00
Conrad Meyer
2c9a33f557 Correct sense of crypt(3) NULL checks in init(8) and lock(1)
In r231994, an attempt was made to fix crypt(3) failure returns (NULL).
However, instead of treating crypt(3) failure as authentication failure,
some of the changes treated crypt(3) failure as authentication success.
This is wrong.

r324225 fixed this for ppp, which also inspired this review.  The other
changes in the 231994 revision were audited for correctness and look ok.

Reviewed by:	jhb
Security:	yes
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D12571
2017-10-03 00:53:11 +00:00
Gleb Smirnoff
0e229f343f Hide struct socket and struct unpcb from the userland.
Violators may define _WANT_SOCKET and _WANT_UNPCB respectively and
are not guaranteed for stability of the structures.  The violators
list is the the usual one: libprocstat(3) and netstat(1) internally
and lsof in ports.

In struct xunpcb remove the inclusion of kernel structure and add
a bunch of spare fields.  The xsocket already has socket not included,
but add there spares as well.  Embed xsockbuf into xsocket.

Sort declarations in sys/socketvar.h to separate kernel only from
userland available ones.

PR:		221820 (exp-run)
2017-10-02 23:29:56 +00:00
Eugene Grosbein
8942852cbc rsh: introduce new option -N disabling shutdown of socket sending path.
This prevents premature disconnection of rsh session with protocol
implementation confused by "end-of-file" condition for standard
input stream. For example, modern Cisco IOS (15.x) versions
can be managed with "rsh -N" cron jobs having /dev/null as stdin.

PR:		205144
Approved by:	avg (mentor)
MFC after:	1 week
2017-10-02 16:33:04 +00:00
Martin Matuska
5c831a5bd6 MFV r324145,324147:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #905: Support for Zstandard read and write filters
  PR #922: Avoid overflow when reading corrupt cpio archive
  Issue #935: heap-based buffer overflow in xml_data (CVE-2017-14166)
  OSS-Fuzz 2936: Place a limit on the mtree line length
  OSS-Fuzz 2394: Ensure that the ZIP AES extension header is large enough
  OSS-Fuzz 573: Read off-by-one error in RAR archives (CVE-2017-14502)

MFC after:	1 week
Security:	CVE-2017-14166, CVE-2017-14502
2017-10-01 00:40:23 +00:00
Baptiste Daroussin
451c2bec47 man(1): silent the output of mandoc when testing
This reduce the spam a user may face when mandoc tries to
figure out if it can renders a manpage or fallback on groff(1)

Reported by:	bdrewery
MFC after:	3 days
2017-09-29 07:44:48 +00:00
Baptiste Daroussin
65d4f317ea calendar: replace strcpy/strcat with asprintf 2017-09-26 11:16:33 +00:00
Fedor Uporov
7ed082c4bb Add myself to the calendar.freebsd
Reviewed by:    pfg (mentor)
Approved by:    pfg (mentor)
2017-09-24 14:36:01 +00:00
Mariusz Zaborski
2560d18180 We use a few different ifdef's names to check if we are using Casper or not,
let's standardize this. Now we are always use WITH_CASPER name.

Discussed with:	emaste@
MFC after:	1 month
2017-09-21 14:41:41 +00:00
Ilya Bakulin
029c02a3ae Make basic Broadcom I/O space reading functions work
It's now possible to use Broadcom functions to read the I/O registers of
SDIO card. The functions were copied from the BSD-licensed Broadcom Linux driver
as-is. To make it possible, a small Linux compatibility layer was introduced.

Currently the card responds with the correct version number ("magic")
when reading the corresponding address.

Approved by:	imp (mentor)
Differential Revision:	https://reviews.freebsd.org/D12111
2017-09-18 20:01:01 +00:00
John Baldwin
dda1cfcf59 Add an -a flag to getconf.
When -a is specified, the name and value of all system or path
configuration values is reported to standard output.

Reviewed by:	kib (earlier version)
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D12373
2017-09-15 22:55:15 +00:00
Michael Tuexen
05d70babff Remove tailing whitespace. 2017-09-15 20:46:51 +00:00
Ed Maste
6e7bfaecee fastmatch.h: remove duplicate #defines
Reviewed by:	kevans
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D12375
2017-09-15 13:34:00 +00:00
John Baldwin
27efb0a242 Add a NT_ARM_VFP ELF core note to hold VFP registers for each thread.
The core note matches the format and layout of NT_ARM_VFP on Linux.
Debuggers use the AT_HWCAP flags to determine how many VFP registers
are actually used and their format.

Reviewed by:	mmel (earlier version w/o gcore)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D12293
2017-09-14 15:07:48 +00:00
Warner Losh
73f7ff91b2 Implement gawk multiple-arg extension to and, or, and xor.
gawk allows multiple arguemnts to bit-wiste and, or and xor
functions. Implement an arbitrary number of arguments for these
functions. Also, use NULL in preference to 0 to match rest of file.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D12361
2017-09-14 05:48:23 +00:00
Gordon Tetlow
4572fb3faf Deorbit catman. The tradeoff of disk for performance has long since tipped
in favor of just rendering the manpage instead of relying on pre-formatted
catpages. Note, this does not impede the ability to use existing catpages,
it just removes the utility to generate them.

Reviewed by:	imp, allanjude
Approved by:	emaste (mentor)
Differential Revision:	https://reviews.freebsd.org/D12317
2017-09-13 16:35:16 +00:00
Michael Tuexen
83f60cb202 Add a command line option for using a wider field for displaying
addresses. This allows the table to be consistent when IPv6
addresses have to be printed.
While there, document the -v option in the man page.

Sponsored by:	Netflix, Inc.
2017-09-13 06:57:52 +00:00
Michael Tuexen
e389705ed3 Add support for printing the path state for SCTP association. 2017-09-12 21:36:13 +00:00
Michael Tuexen
49b836f2ea Add printing of the remote encapsulation port for SCTP associations.
Sponsored by:	Netflix, Inc.
2017-09-12 21:07:48 +00:00
Michael Tuexen
e5cccc35c3 Add support to print the TCP stack being used.
Sponsored by:	Netflix, Inc.
2017-09-12 13:34:43 +00:00
Mark Johnston
8e15d40d24 Provide an error message if KTR symbols in a vmcore cannot be resolved.
libkvm does not set an error string in this case, so we were previously
failing silently.

MFC after:	1 week
2017-09-11 15:18:43 +00:00
Ilya Bakulin
42439531c8 Add information about new src committer (kibab)
Approved by:	imp (mentor)
Differential Revision:	https://reviews.freebsd.org/D12304
2017-09-10 20:33:23 +00:00
Jonathan Anderson
bab31140a2 Remove redundant source and object files.
Reviewed by:	bdrewery, ngie
MFC after:	1 week
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D12208
2017-09-09 13:18:32 +00:00
Michael Tuexen
c1fa847030 The combination of IPv6 and SCTP is also supported.
MFC after:	1 week
2017-09-09 07:48:58 +00:00
Enji Cooper
71607cbea7 Unbreak :broken_pipe
- Capture exit code in pipeline and test in output.
- Drop awk use in favor of `sleep 2`. This helps guarantee the EPIPE
  behavior without the potential race.
2017-09-09 06:24:21 +00:00
Enji Cooper
7c69f31eb6 Check result of seq call and save output via atf_check -o
This ensures that seq outputting to ints will not fail as silently if there's
an error.
2017-09-09 05:50:47 +00:00
Ed Schouten
733ba7f881 Merge pipes and socket pairs.
Now that CloudABI's sockets API has been changed to be addressless and
only connected socket instances are used (e.g., socket pairs), they have
become fairly similar to pipes. The only differences on CloudABI is that
socket pairs additionally support shutdown(), send() and recv().

To simplify the ABI, we've therefore decided to remove pipes as a
separate file descriptor type and just let pipe() return a socket pair
of type SOCK_STREAM. S_ISFIFO() and S_ISSOCK() are now defined
identically.
2017-09-05 07:46:45 +00:00
John Baldwin
39a3a4386a Decode pathconf() names, *at() flags, and sysarch() numbers in libsysdecode.
Move tables that were previously in truss over to libsysdecode.  truss
output is unchanged, but kdump has been updated to decode these fields.
In addition, sysdecode_sysarch_number() should support all platforms
whereas the old table in truss only supported x86.
2017-09-04 05:34:36 +00:00
Greg Lehey
a0a93de728 Spelling. 2017-09-02 23:17:35 +00:00
Conrad Meyer
b2b1603e17 tail(1): Do not print bogus errno string
In the case where write(2) does not return -1, it does not initialize errno.
This can happen when a broken pipe causes a short write.

I attempted to adapt the submitted test case to ATF but could not figure out
how to make the test run in the ATF environment.  So the aborted test is
left disabled, in case someone would like to run it manually or fix it.

PR:		221976
Submitted by:	<martin AT lispworks.com> (earlier version)
Sponsored by:	Dell EMC Isilon
2017-09-01 22:37:49 +00:00
Greg Lehey
b290ac7ba4 Spelling. 2017-08-30 23:49:14 +00:00
John Baldwin
13e5e6b616 Decode signal information returned by system calls.
Specifically, decode the siginfo structure returned by sigtimedwait(),
sigwaitinfo(), and wait6().  While here, also decode the signal number
returned in the second argument to sigwait().
2017-08-30 15:45:23 +00:00
John Baldwin
3cc32ea655 Trim stale prototype for ioctlname(). 2017-08-30 15:32:47 +00:00
Baptiste Daroussin
1caaf3ea4f Don't call kresolv_list() if using netstat on live kernel
kresolve_list() is calling many kldsym(2). Removing that call on when collecting
stats for the running kernel improves the startup time and CPU usage.

Submitted by:	Nikita Kozlov (nikita.kozlov@blade-group.com)
Reviewed by:	cem
MFC after:	2 weeks
Sponsored by:	blade
Differential Revision:	https://reviews.freebsd.org/D12151
2017-08-30 07:58:33 +00:00
Ed Schouten
b53b978a6c Complete the CloudABI networking refactoring.
Now that all of the packaged software has been adjusted to either use
Flower (https://github.com/NuxiNL/flower) for making incoming/outgoing
network connections or can have connections injected, there is no longer
need to keep accept() around. It is now a lot easier to write networked
services that are address family independent, dual-stack, testable, etc.

Remove all of the bits related to accept(), but also to
getsockopt(SO_ACCEPTCONN).
2017-08-30 07:30:06 +00:00
Luca Pizzamiglio
03bf38d631 Adding personal information about pizzamig as port committer
Approved by:	olivier (mentor)
Approved by:	lme (mentor)
Differential Revision:	https://reviews.freebsd.org/D12145
2017-08-28 19:34:39 +00:00
John Baldwin
ff577cb645 Decode extra signal information for caught signals.
Decode fields from the siginfo_t stored in the PT_LWPINFO structure when a
signal is caught by a traced process.  This includes the signal code
(si_code) as well as additional members such as si_addr, si_pid, etc.
2017-08-28 02:42:20 +00:00
Sean Bruno
32a04bb81d Use counter(9) for PLPMTUD counters.
Remove unused PLPMTUD sysctl counters.

Bump UPDATING and FreeBSD Version to indicate a rebuild is required.

Submitted by:	kevin.bowling@kev009.com
Reviewed by:	jtl
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D12003
2017-08-25 19:41:38 +00:00
John Baldwin
d86cddf0f0 Decode arguments passed to thr_set_name().
MFC after:	1 month
2017-08-25 19:06:36 +00:00
Ed Schouten
e71fe5ce0a Make entries for the United States more consistent.
MFC after:	1 week
2017-08-25 12:28:34 +00:00
Andrey V. Elsukov
a7fe257e0a Add melifaro@ to the calendar.freebsd
Submitted by:	melifaro
2017-08-25 11:24:45 +00:00
Ed Schouten
8212ad9a99 Sync CloudABI compatibility against the latest upstream version (v0.13).
With Flower (CloudABI's network connection daemon) becoming more
complete, there is no longer any need for creating any unconnected
sockets. Socket pairs in combination with file descriptor passing is all
that is necessary, as that is what is used by Flower to pass network
connections from the public internet to listening processes.

Remove all of the kernel bits that were used to implement socket(),
listen(), bindat() and connectat(). In principle, accept() and
SO_ACCEPTCONN may also be removed, but there are still some consumers
left.

Obtained from:	https://github.com/NuxiNL/cloudabi
MFC after:	1 month
2017-08-25 11:01:39 +00:00
Steven Hartland
9fe191043b Add myself (smh) to calendar.freebsd
Sponsored by:	Multiplay
2017-08-25 08:21:02 +00:00
Kyle Evans
05ad821531 bsdgrep: add a primitive literal matcher
fgrep/grep -F will error out at runtime if compiled with a regex(3)
that does not define REG_NOSPEC or REG_LITERAL. glibc is one such regex(3)
implementation, and as it turns out they don't support literal matching at
all.

Provide a primitive literal matcher for use with glibc and other
implementations that don't support literal matching so that we don't
completely lose fgrep/grep -F if compiled against libgnuregex on stable/10,
stable/11, or other systems that we don't necessarily support.

This is a wholly unoptimized implementation with no plans to optimize it as
of now. This is due to both its use-case being primarily on unsupported
systems in the near-distant future and that it's reinventing the wheel that
we already have available as a feature of regex(3).

Reviewed by:	cem, emaste, ngie
Approved by:	emaste (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D12056
2017-08-24 01:23:33 +00:00
John Baldwin
de6feefdb7 Improve the coverage of debug symbols for MK_DEBUG_FILES.
- Include debug symbols in static libraries.  This permits binaries
  to include debug symbols for functions obtained from static libraries.
- Permit the C/C++ compiler flags added for MK_DEBUG_FILES to be
  overridden by setting DEBUG_FILES_CFLAGS.  Use this to limit the debug
  information for llvm libraries and binaries.

Reviewed by:	emaste
Sponsored by:	DARPA / AFRL
Differential Revision:	https://reviews.freebsd.org/D12025
2017-08-23 23:30:25 +00:00
Enji Cooper
e4cf0a367e Clarify the fact that Andrey (ache) passed away in Moscow
Take care friend <3.
2017-08-18 07:34:34 +00:00
Greg Lehey
bef5445959 Goodbye, ache. 2017-08-18 00:25:27 +00:00
Kyle Evans
de3d7a8286 bsdgrep: cast pmatch.rm_so to fix build when linking against libgnuregex
Reported by:	many
Approved by:	emaste (mentor)
MFC after:	immediate
2017-08-17 13:40:45 +00:00
Enji Cooper
188e46ab03 Add supporting changes for Add limited sandbox capability to "make check"
Non-tests/... changes:
- Add HAS_TESTS= to Makefiles with libraries and programs to enable iteration
  and propagate the appropriate environment down to *.test.mk.

tests/... changes:
- Add appropriate support Makefile.inc's to set HAS_TESTS in a minimal manner,
  since tests/... is a special subdirectory tree compared to the others.

MFC after:	2 months
MFC with:	r322511
Reviewed by:	arch (silence), testing (silence)
Differential Revision:	D12014
2017-08-14 19:21:37 +00:00