Commit Graph

13340 Commits

Author SHA1 Message Date
Ed Schouten
4e1847781b Import the latest CloudABI definitions, version 0.16.
The most important change in this release is the removal of the
poll_fd() system call; CloudABI's equivalent of kevent(). Though I think
that kqueue is a lot saner than many of its alternatives, our
experience is that emulating this system call on other systems
accurately isn't easy. It has become a complex API, even though I'm not
convinced this complexity is needed. This is why we've decided to take a
different approach, by looking one layer up.

We're currently adding an event loop to CloudABI's C library that is API
compatible with libuv (except when incompatible with Capsicum).
Initially, this event loop will be built on top of plain inefficient
poll() calls. Only after this is finished, we'll work our way backwards
and design a new set of system calls to optimize it.

Interesting challenges will include integrating asynchronous I/O into
such a system call API. libuv currently doesn't aio(4) on Linux/BSD, due
to it being unreliable and having undesired semantics.

Obtained from:	https://github.com/NuxiNL/cloudabi
2017-10-18 19:22:53 +00:00
Brooks Davis
2a243b9539 Switch procstat from subcommand flags to verbs
- Use an enumerated value instead of separate flags for commands
- Look for a verb if no command flag is set
- Lookup the "xocontainer" value based on the command
- Document the new command verbs in the man-page

Submitted by:	kdrakehp@zoho.com
Differential Revision:	https://reviews.freebsd.org/D10916
2017-10-14 18:38:36 +00:00
Ed Maste
fe7f211c0e truss: mention 'H' in usage
r295930 introduced the 'H' option to display thread IDs, but did not add
the option to usage().

PR:		222837
Submitted by:	Oliver Kiddle <okiddle@yahoo.co.uk>
MFC after:	1 week
2017-10-13 13:47:55 +00:00
Mateusz Guzik
92b25dcd61 xinstall: plug an infinite loop in directory creation
If stat continues to fail with ENOENT and mkdir with EEXIST the code wont
finish. In particular this can show up when the target path follows through
a symlink to a non-existent directory.

Reported by:	ae
MFC after:	1 week
2017-10-12 13:59:23 +00:00
Enji Cooper
838c6d51d5 Mute gcc warning about p not being possibly initialized
I'm running into this warning on a tinderbox run with gcc 4.2.1 with mips and
powerpc.

MFC after:	1 week
2017-10-10 15:41:35 +00:00
Kyle Evans
4835edfa0d patch(1): Don't overrun line buffer in some cases
Patches like file.txt attached to PR 190195 with a final line formed
like ">(EOL)" could cause a copy past the end of the current line buffer. In the
case of PR 191641, this caused a duplicate line to be copied into the resulting
file.

Instead of running past the end, treat it as if it were a blank line.

PR:		191641
Reviewed by:	cem, emaste, pfg
Approved by:	emaste (mentor)
Differential Revision:	https://reviews.freebsd.org/D12609
2017-10-09 14:50:02 +00:00
Jeremie Le Hen
e415aa2846 Remove rcmds.
If they are still needed, you can find them in the net/bsdrcmds port.

This was proposed June, 20th and approved by various committers [1].
They have been marked as deprecated on CURRENT in r320644 [2] on July, 4th.
Both stable/11 and release/11.1 contain the deprecation notice (thanks to
allanjude@).

Note that ruptime(1)/rwho(1)/rwhod(8) were initially thought to be part of
rcmds but this was a mistake and those are therefore NOT removed.

[1] https://lists.freebsd.org/pipermail/freebsd-arch/2017-June/018239.html
[2] https://svnweb.freebsd.org/base?view=revision&revision=320644

Reviewed by:	bapt, brooks
Differential Revision:	https://reviews.freebsd.org/D12573
2017-10-06 08:43:14 +00:00
Kyle Evans
7b9f317cf3 hexdump: Remove expected test failures for now succeeding tests
r323990 fixed the -s flag breakage reported by PR 219173. Mark the
corresponding hexdump tests accordingly, since they should now both succeed.

PR:		222781
Reported by:	ngie
Reviewed by:	emaste, ngie
Approved by:	emaste (mentor)
Differential Revision:	https://reviews.freebsd.org/D12590
2017-10-04 18:11:00 +00:00
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