]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoRevert r288628 and instead fix a discrepancy between the posix_fadvise(2)
markj [Sat, 3 Oct 2015 22:27:14 +0000 (22:27 +0000)]
Revert r288628 and instead fix a discrepancy between the posix_fadvise(2)
man page and POSIX: posix_fadvise(2) returns an error number on failure.

Reported by: jilles
MFC after: 1 week

8 years agorum(4): fix stats interpretation in rum_ratectl_task()
adrian [Sat, 3 Oct 2015 22:26:59 +0000 (22:26 +0000)]
rum(4): fix stats interpretation in rum_ratectl_task()

Testing:

* WUSB54GC, STA mode

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3690

8 years agorum(4): set short/long retry limits
adrian [Sat, 3 Oct 2015 22:22:26 +0000 (22:22 +0000)]
rum(4): set short/long retry limits

Now device will use retry limit, which is set via 'ifconfig <interface>
maxretry <number>'.

Tested:

* Tested on WUSB54GC, STA mode.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3689

8 years agorum(4): fix sequence number generation.
adrian [Sat, 3 Oct 2015 22:15:59 +0000 (22:15 +0000)]
rum(4): fix sequence number generation.

* drop erroneous RT2573_TX_MORE_FRAG flag;
* provide RT2573_TX_HWSEQ where needed.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3672

8 years agonet80211: drop ieee80211_beacon_offsets parameter from ieee80211_beacon_alloc() and...
adrian [Sat, 3 Oct 2015 22:12:25 +0000 (22:12 +0000)]
net80211: drop ieee80211_beacon_offsets parameter from ieee80211_beacon_alloc() and ieee80211_beacon_update()

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3659

8 years agonet80211: drop redundant 3rd parameter from iv_key_set().
adrian [Sat, 3 Oct 2015 21:48:27 +0000 (21:48 +0000)]
net80211: drop redundant 3rd parameter from iv_key_set().

The MAC can be fetched from the key struct.

I added the ndis updates to make it compile.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3657

8 years agorum(4): drop unused 'node id' parameter.
adrian [Sat, 3 Oct 2015 20:53:10 +0000 (20:53 +0000)]
rum(4): drop unused 'node id' parameter.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3655

8 years agorum(4): add support for hardware encryption (WEP, TKIP and CCMP).
adrian [Sat, 3 Oct 2015 20:49:08 +0000 (20:49 +0000)]
rum(4): add support for hardware encryption (WEP, TKIP and CCMP).

This diff includes:

* Transmitter Addresses, Keys and TKIP MIC addition to the Security Key Table.
* Proper SEC Control Registers initialization and maintenance.
* Additional flags and values in TX descriptor, which are required for encryption support.
* Error checking in RX path.

Tested:

* Tested on WUSB54GC, STA (WEP, TKIP, CCMP), HOSTAP (CCMP) and IBSS (CCMP, WPA-None) modes.
* rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528, STA mode (CCMP+TKIP)

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3640

8 years agorum(4): implement iv_update_beacon call (fixes client power save support).
adrian [Sat, 3 Oct 2015 20:45:43 +0000 (20:45 +0000)]
rum(4): implement iv_update_beacon call (fixes client power save support).

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3632

8 years agorum(4): attach rum_update_slot to ic_updateslot.
adrian [Sat, 3 Oct 2015 20:44:16 +0000 (20:44 +0000)]
rum(4): attach rum_update_slot to ic_updateslot.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3631

8 years agoMake GCC happy
bdrewery [Sat, 3 Oct 2015 20:24:23 +0000 (20:24 +0000)]
Make GCC happy

8 years agoInclude stddef.h for ptrdiff_t
bdrewery [Sat, 3 Oct 2015 20:06:50 +0000 (20:06 +0000)]
Include stddef.h for ptrdiff_t

8 years agoThe return value of posix_fadvise(2) is just an error status, so
markj [Sat, 3 Oct 2015 19:37:41 +0000 (19:37 +0000)]
The return value of posix_fadvise(2) is just an error status, so
sys_posix_fadvise() should simply return the errno (or 0) to syscallenter()
rather than setting a return value.

MFC after: 1 week

8 years agoReduce the scope of a variable to the only file where it is used.
alc [Sat, 3 Oct 2015 19:27:52 +0000 (19:27 +0000)]
Reduce the scope of a variable to the only file where it is used.

8 years agoStyle fix.
bdrewery [Sat, 3 Oct 2015 19:08:36 +0000 (19:08 +0000)]
Style fix.

8 years agoAdd decoding for struct statfs.
bdrewery [Sat, 3 Oct 2015 18:57:15 +0000 (18:57 +0000)]
Add decoding for struct statfs.

Reviewed by: jhb (briefly)

8 years agorum(4): split rum_prepare_beacon() into 'alloc' and 'set' stages
adrian [Sat, 3 Oct 2015 17:49:11 +0000 (17:49 +0000)]
rum(4): split rum_prepare_beacon() into 'alloc' and 'set' stages

Note: I manually had to merge this; I merged in the "put beacon_offsets
into vap" commit before this.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3628

8 years agorum(4): add support for AHDEMO mode.
adrian [Sat, 3 Oct 2015 17:34:11 +0000 (17:34 +0000)]
rum(4): add support for AHDEMO mode.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3627

8 years agorum(4): simplify rum_set_bssid(), rum_set_macaddr() and rum_update_promisc()
adrian [Sat, 3 Oct 2015 17:30:57 +0000 (17:30 +0000)]
rum(4): simplify rum_set_bssid(), rum_set_macaddr() and rum_update_promisc()

Tested:

* rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528, STA mode

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3626

8 years agoMute this cookie as well
bdrewery [Sat, 3 Oct 2015 17:28:46 +0000 (17:28 +0000)]
Mute this cookie as well

8 years agorum(4): do not corrupt MAC address
adrian [Sat, 3 Oct 2015 17:18:35 +0000 (17:18 +0000)]
rum(4): do not corrupt MAC address

Don't override the NIC MAC address with an overridden MAC address for
a VAP.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3625

8 years agorum(4): add error handling for rum_enable_tsf_sync() and rum_prepare_beacon()
adrian [Sat, 3 Oct 2015 17:11:21 +0000 (17:11 +0000)]
rum(4): add error handling for rum_enable_tsf_sync() and rum_prepare_beacon()

Tested:

* rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528, STA mode
  Note: haven't tested AP mode yet; will do once the rest of the
  AP mode / power save commits are in.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3624

8 years agoPerform a single batched update to the object's paging-in-progress count
alc [Sat, 3 Oct 2015 17:04:52 +0000 (17:04 +0000)]
Perform a single batched update to the object's paging-in-progress count
rather than updating it for each page.

8 years agorum(4): move some code from rum_init() into separate function.
adrian [Sat, 3 Oct 2015 16:37:38 +0000 (16:37 +0000)]
rum(4): move some code from rum_init() into separate function.

Tested:

* rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528, STA mode

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3623

8 years agoRemove redundant COMPAT_32BIT guard on pkgconfig files. This is already handled
bdrewery [Sat, 3 Oct 2015 16:34:21 +0000 (16:34 +0000)]
Remove redundant COMPAT_32BIT guard on pkgconfig files.  This is already handled
by the LIBRARIES_ONLY mechanism protecting FILES.

Sponsored by: EMC / Isilon Storage Division

8 years agorum(4): add error handling in initialization path
adrian [Sat, 3 Oct 2015 16:21:06 +0000 (16:21 +0000)]
rum(4): add error handling in initialization path

Tested:

* Tested on WUSB54GC, STA mode.
* rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528, STA mode

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3622

8 years agoAvoid make compatibility mode issues with creating cookies from r287844 and r287848.
bdrewery [Sat, 3 Oct 2015 16:09:55 +0000 (16:09 +0000)]
Avoid make compatibility mode issues with creating cookies from r287844 and r287848.

Also hide the cookie creation.

Suggested by: imp, Daniel O'Connor

8 years agorum(4): simplify error handling rum_raw_xmit()
adrian [Sat, 3 Oct 2015 15:58:00 +0000 (15:58 +0000)]
rum(4): simplify error handling rum_raw_xmit()

Move the mbuf free responsibility to the caller of the hardware xmit
function, not the hardware xmit function itself.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3621

8 years agorum(4): check mbuf size before accessing its contents
adrian [Sat, 3 Oct 2015 15:52:58 +0000 (15:52 +0000)]
rum(4): check mbuf size before accessing its contents

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3610

8 years agorum(4): add TSF field into radiotap headers
adrian [Sat, 3 Oct 2015 15:49:55 +0000 (15:49 +0000)]
rum(4): add TSF field into radiotap headers

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3607

8 years agorun(4): Add initial support for IBSS merge.
adrian [Sat, 3 Oct 2015 15:48:21 +0000 (15:48 +0000)]
run(4): Add initial support for IBSS merge.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3592

8 years agoUse getaddrinfo() to fill struct sockaddr_un. It now supports
hrs [Sat, 3 Oct 2015 12:49:05 +0000 (12:49 +0000)]
Use getaddrinfo() to fill struct sockaddr_un.  It now supports
SOCK_DGRAM and SOCK_SEQPACKET in addition to SOCK_STREAM.

8 years ago- Move PF_LOCAL at the end of the array. PF_INET{,6} is used more often.
hrs [Sat, 3 Oct 2015 12:40:54 +0000 (12:40 +0000)]
- Move PF_LOCAL at the end of the array.  PF_INET{,6} is used more often.

- Add SOCKTYPE_ANY to PF_LOCAL.

- Apply AI_CANONNAME to only AF_INET{,6}.  It is not meaningful for the
  other AFs.

8 years ago- Schedule DAD for IN6_IFF_TENTATIVE addresses in nd6_timer(). This
hrs [Sat, 3 Oct 2015 12:09:12 +0000 (12:09 +0000)]
- Schedule DAD for IN6_IFF_TENTATIVE addresses in nd6_timer().  This
  catches cases that DAD probes cannot be sent because of
  IFF_UP && !IFF_DRV_RUNNING.

- nd6_dad_starttimer() now calls nd6_dad_ns_output(), instead of
  calling it before nd6_dad_starttimer().

- Do not release an entry in dadq when a duplicate entry is being
  added.

8 years agoRestore original array_rd_sz semantics.
mav [Sat, 3 Oct 2015 11:05:58 +0000 (11:05 +0000)]
Restore original array_rd_sz semantics.

Before r278702 prefetch was blocked for I/Os > 1MB, after -- >= 1MB.
1MB I/Os are used for bulk operations in CTL (XCOPY, VERIFY), and disabling
prefetch for them reduced the performance.

This is temporary local patch, that should be replaced when upstreamed.

Discussed with: mahrens
MFC after: 3 days

8 years agoAdd IFCAP_LINKSTATE support.
hrs [Sat, 3 Oct 2015 09:15:23 +0000 (09:15 +0000)]
Add IFCAP_LINKSTATE support.

8 years agoRemove beacon offsets usage from if_rum.
adrian [Sat, 3 Oct 2015 06:35:17 +0000 (06:35 +0000)]
Remove beacon offsets usage from if_rum.

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

8 years agourtwn(4): fix sequence numbering for QoS frames
adrian [Sat, 3 Oct 2015 06:07:01 +0000 (06:07 +0000)]
urtwn(4): fix sequence numbering for QoS frames

Tested:

* urtwn0: MAC/BB RTL8188EU, RF 6052 1T1R, STA mode

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3684

8 years agoural(4): reduce copy-paste in ural_newstate().
adrian [Sat, 3 Oct 2015 05:55:16 +0000 (05:55 +0000)]
ural(4): reduce copy-paste in ural_newstate().

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3656

8 years agorum(4): add command queue for running sleepable tasks in non-sleepable contexts
adrian [Sat, 3 Oct 2015 05:46:35 +0000 (05:46 +0000)]
rum(4): add command queue for running sleepable tasks in non-sleepable contexts

Tested:

* Tested on WUSB54GC, STA mode.
* rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3629

8 years agorum(4): some non-functional changes / cleanup
adrian [Sat, 3 Oct 2015 05:44:05 +0000 (05:44 +0000)]
rum(4): some non-functional changes / cleanup

* Remove unused sc_txtap_len/sc_rxtap_len fields.
* Remove unused ackrate variable.
* Remove unneded warning in rum_update_mcast().
* Use nitems().
* Replace some hardcoded values for RT2573_MAC_CSR1 register.
* Remove second argument for RUM_LOCK_ASSERT() - it is always the same.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3605

8 years agoBump number of prefixes in O_IP_<SRC|DST> from 15 to 31 (max possible).
melifaro [Sat, 3 Oct 2015 05:42:25 +0000 (05:42 +0000)]
Bump number of prefixes in O_IP_<SRC|DST> from 15 to 31 (max possible).

PR: 203459
Submitted by: groos at xiplink.com
MFC after: 2 weeks

8 years agoAlways detach encap handler when reconfiguring tunnel.
ae [Sat, 3 Oct 2015 03:57:58 +0000 (03:57 +0000)]
Always detach encap handler when reconfiguring tunnel.

Reported by: hrs
MFC after: 1 week

8 years agoFix possible segmentation fault.
ae [Sat, 3 Oct 2015 03:12:57 +0000 (03:12 +0000)]
Fix possible segmentation fault.

PR: 203494
MFC after: 1 week

8 years agonet80211: add a possibility to retrieve current TX key without encapsulation.
adrian [Sat, 3 Oct 2015 00:57:33 +0000 (00:57 +0000)]
net80211: add a possibility to retrieve current TX key without encapsulation.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3639

8 years agonet80211: add new method for ieee80211_cipher (ic_setiv).
adrian [Sat, 3 Oct 2015 00:50:13 +0000 (00:50 +0000)]
net80211: add new method for ieee80211_cipher (ic_setiv).

This can be used to update IV state for the caller without adding
information to the mbuf.  Some hardware (eg rum) apparently requires
bits of this.

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3638

8 years agonet80211: get rid of tx_phase1_done flag (ieee80211_crypto_tkip.c).
adrian [Sat, 3 Oct 2015 00:03:07 +0000 (00:03 +0000)]
net80211: get rid of tx_phase1_done flag (ieee80211_crypto_tkip.c).

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3596

8 years agoFix post-test typo that snuck in.
grehan [Fri, 2 Oct 2015 22:05:51 +0000 (22:05 +0000)]
Fix post-test typo that snuck in.

8 years agonet80211: separate ieee80211_crypto_get_keyid() from ieee80211_crypto_encap()
adrian [Fri, 2 Oct 2015 21:25:48 +0000 (21:25 +0000)]
net80211: separate ieee80211_crypto_get_keyid() from ieee80211_crypto_encap()

Tested:

* rum(4), STA mode
* rsu(4), STA mode
* urtwn(4), STA mode

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3637

8 years agoSimple sysctl-like firmware query interface. Similar in operation
grehan [Fri, 2 Oct 2015 21:09:49 +0000 (21:09 +0000)]
Simple sysctl-like firmware query interface. Similar in operation
to the qemu one, and uses the same i/o ports but with different
messaging. Requires the 'bootrom' option to be enabled.

This is used by UEFI (and potentially other BIOSs/firmware) to
request information from bhyve. Currently, only the number of
vCPUs is made available, with more to follow.

A very large thankyou to Ben Perrault who helped out testing
an earlier version of this, and bhyve/Windows in general.

Reviewed by: tychon
Discussed with: neel
Sponsored by: Nahanni Systems

8 years agoAll the games moved to usr.bin/ in r288485.
bdrewery [Fri, 2 Oct 2015 17:58:16 +0000 (17:58 +0000)]
All the games moved to usr.bin/ in r288485.

Sponsored by: EMC / Isilon Storage Division

8 years agoRemove defunct games removed in r279150.
bdrewery [Fri, 2 Oct 2015 17:54:05 +0000 (17:54 +0000)]
Remove defunct games removed in r279150.

Sponsored by: EMC / Isilon Storage Division

8 years ago/usr/src/games was removed in r288485.
bdrewery [Fri, 2 Oct 2015 17:51:47 +0000 (17:51 +0000)]
/usr/src/games was removed in r288485.

8 years agoFix a regression with SA-15:24 patch that prevented NIS from
delphij [Fri, 2 Oct 2015 16:35:41 +0000 (16:35 +0000)]
Fix a regression with SA-15:24 patch that prevented NIS from
working.

8 years agorum(4): sync rum_enable_tsf(_sync) with run(4).
adrian [Fri, 2 Oct 2015 15:30:37 +0000 (15:30 +0000)]
rum(4): sync rum_enable_tsf(_sync) with run(4).

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3611

8 years agorum(4): create few wrappers.
adrian [Fri, 2 Oct 2015 15:28:44 +0000 (15:28 +0000)]
rum(4): create few wrappers.

Tested:

rum0: <Belkin Belkin 54g USB Network Adapter, class 0/0, rev 2.00/0.01, addr 22> on usbus0
rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3609

8 years agorum(4): move common part of rum_bbp_write() and rum_bbp_read() into rum_bbp_busy().
adrian [Fri, 2 Oct 2015 15:26:33 +0000 (15:26 +0000)]
rum(4): move common part of rum_bbp_write() and rum_bbp_read() into rum_bbp_busy().

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3608

8 years agorum(4): reduce code duplication.
adrian [Fri, 2 Oct 2015 15:22:00 +0000 (15:22 +0000)]
rum(4): reduce code duplication.

Tested:

rum0: <Belkin Belkin 54g USB Network Adapter, class 0/0, rev 2.00/0.01, addr 21> on usbus0
rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3606

8 years agoAdd aarch64 support to truss(1).
kib [Fri, 2 Oct 2015 13:30:56 +0000 (13:30 +0000)]
Add aarch64 support to truss(1).

Reviewed by: jhb
Discussed with: emaste (license)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3750

8 years agoDo not set 'flush to zero' VFPSCR_FZ bit by default. The correct
kib [Fri, 2 Oct 2015 13:25:59 +0000 (13:25 +0000)]
Do not set 'flush to zero' VFPSCR_FZ bit by default.  The correct
implementation of IEEE 754 arithmetic depends on denormals operating
correctly.  Both perl test suite and paranoia tripped over the
setting.

Reported by: Stefan Parvu <sparvu@kronometrix.org>
Discussed with: andrew
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoFreeBSD does not support SMP on ARMv5. Since processor is always
kib [Fri, 2 Oct 2015 13:21:08 +0000 (13:21 +0000)]
FreeBSD does not support SMP on ARMv5.  Since processor is always
self-consistent, there is no need in anything but compiler barrier in
the implementation of atomic_thread_fence_*() on ARMv5.  Split
implementation of fences for ARMv4/5 and ARMv6; the former use
compiler barriers, the later also perform hardware barriers.

An issue which is fixed by the change is the faults from the CP15
coprocessor accesses in the user mode.  This was uncovered by the
pthread_once() changes in r287556.

Reported by: Mattia Rossi <mattia.rossi.mailinglists@gmail.com>
Discussed with: alc, cognet, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoAdd debug file extension to kldxref(8) after r288176
emaste [Fri, 2 Oct 2015 13:16:06 +0000 (13:16 +0000)]
Add debug file extension to kldxref(8) after r288176

After r288176 kernel debug files have the extension .debug.  They also
moved to /usr/lib/debug/boot/kernel by default so in the normal case
kldxref does not encounter them.  A src.conf(5) setting may be used to
continue installing them in /boot/kernel though, so have kldxref skip
.debug files in addition to .symbols files.

Reported by: fabient
Sponsored by: The FreeBSD Foundation

8 years agoDocument CD block size of 2048.
mav [Fri, 2 Oct 2015 11:27:34 +0000 (11:27 +0000)]
Document CD block size of 2048.

8 years agoMake truss print CloudABI system call names.
ed [Fri, 2 Oct 2015 11:17:15 +0000 (11:17 +0000)]
Make truss print CloudABI system call names.

This change adds the bits that are necessary to fetch system call
arguments and return values from trapframes for CloudABI. This allows us
to properly print system calls with the right name. We need to make sure
that we properly convert error numbers when system calls fail.

We still need to improve truss to pretty-print some of the system calls
that have flags.

8 years agoSet default block size for CD to expected 2048 bytes.
mav [Fri, 2 Oct 2015 11:16:46 +0000 (11:16 +0000)]
Set default block size for CD to expected 2048 bytes.

8 years agoFinal step of eliminating the "games" distribution: Merge src/games
cperciva [Fri, 2 Oct 2015 10:08:11 +0000 (10:08 +0000)]
Final step of eliminating the "games" distribution: Merge src/games
(or what's left of it, at least) into src/usr.bin.

This change will not be MFCed.

Discussed at:   EuroBSDCon 2014
Committed from: EuroBSDCon 2015

8 years agoFail the sbuf if vsnprintf(3) fails.
phk [Fri, 2 Oct 2015 09:23:14 +0000 (09:23 +0000)]
Fail the sbuf if vsnprintf(3) fails.

8 years agoThe rpc.yppasswdd has an option to not allow shell changes (-s), but is
araujo [Fri, 2 Oct 2015 08:58:50 +0000 (08:58 +0000)]
The rpc.yppasswdd has an option to not allow shell changes (-s), but is
always passed a shell by the remote yppasswd. If an NIS client overrides the
shell provided by the ypserv, then yppasswd (pam_unix, actually, afaict)
will pass this new shell to the yppasswdd. If this shell has been set on the
client to a shell which is invalid on the server, a user will never be able
to change their password on the client.

PR: 67142
Submitted by: russell@rucus.ru.ac.za
Approved by: bapt (mentor)
Sponsored by: EuroBSDCon Sweden.

8 years agoMETA_MODE: For some reason meta mode cannot generate the intermediate tab.c
bdrewery [Fri, 2 Oct 2015 07:00:43 +0000 (07:00 +0000)]
META_MODE: For some reason meta mode cannot generate the intermediate tab.c
files.  Split up all of the targets to be more clear on how they are generated
to fix the problem.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoMETA_MODE: Fix stage_links not running in the right order without -j.
bdrewery [Fri, 2 Oct 2015 06:24:09 +0000 (06:24 +0000)]
META_MODE: Fix stage_links not running in the right order without -j.

This fixes staging errors for non-parallel builds that have LINKS.

Creating hardlinks must always happen after the actual files are installed.
The staging code was protected by an .ORDER statement that only affected
parallel -j builds but not non-parallel builds.  Fix this by making the
real stage_links.SET (stage_links.links, stage_links.mlinks, etc) targets
depend on the main targets for all of the other possible staging needs.  For
example, stage_links.links will depend on stage_as and stage_files, which have
their own dependencies to stage_as.prog or stage_files.prog or stage_files.SET,
which is enough to satistfy the ordering.

Also remove the requirement that symlinks be created last, as they can
safely be made without the source being present unlike hardlinks.  This also
fixes symlinks to come before hardlinks as it is possible, in theory, to
hardlink a symlink.  This is not actually supported here though.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix neeed -> neeeded.
adrian [Fri, 2 Oct 2015 02:21:36 +0000 (02:21 +0000)]
Fix neeed -> neeeded.

Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3595

8 years ago- Increase the max number of indirect descriptors to match
grehan [Fri, 2 Oct 2015 02:09:50 +0000 (02:09 +0000)]
- Increase the max number of indirect descriptors to match
  the largest that the Windows virtio driver can send down

- Always advertize indirect descriptors. The Illumos virtio
  driver won't attach unless this capability is seen.

Reviewed by: neel

8 years agoDon't create cookie until the command is all finished, it or the commands
bdrewery [Thu, 1 Oct 2015 21:52:25 +0000 (21:52 +0000)]
Don't create cookie until the command is all finished, it or the commands
after may fail.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix the path to the correct u-boot.bin file to write to
gjb [Thu, 1 Oct 2015 19:48:10 +0000 (19:48 +0000)]
Fix the path to the correct u-boot.bin file to write to
the disk image, which fixes boot issues.

Tested on: BananaPi
Sponsored by: The FreeBSD Foundation

8 years agoMore aggressively fill WUT read pipeline.
mav [Thu, 1 Oct 2015 19:07:15 +0000 (19:07 +0000)]
More aggressively fill WUT read pipeline.

On some tests I've measured 5% copy speedup from this.

8 years agoRather than groveling around in a socket address structure for a socket
jhb [Thu, 1 Oct 2015 18:18:58 +0000 (18:18 +0000)]
Rather than groveling around in a socket address structure for a socket
address's length (and then overriding it if it "looks wrong"), use the
next argument to the system call to determine the length.  This is more
reliable since this is what the kernel depends on anyway and is also
simpler.

8 years agoThe id_t type used to pass IDs to wait6(2) and procctl(6) is a 64-bit
jhb [Thu, 1 Oct 2015 17:50:41 +0000 (17:50 +0000)]
The id_t type used to pass IDs to wait6(2) and procctl(6) is a 64-bit
integer.  Fix the argument decoding to treat this as a quad instead of an
int.  This includes using QUAD_ALIGN and QUAD_SLOTS as necessary.  To
continue printing IDs in decimal, add a new QuadHex argument type that
prints a 64-bit integer in hex, use QuadHex for the existing off_t arguments,
repurpose Quad to print a 64-bit integer in decimal, and use Quad for id_t
arguments.

This fixes the decoding of wait6(2) and procctl(2) on 32-bit platforms.

8 years ago- Remove extra integer argument from truncate() and ftruncate(). This is
jhb [Thu, 1 Oct 2015 17:28:07 +0000 (17:28 +0000)]
- Remove extra integer argument from truncate() and ftruncate().  This is
  probably fallout from the removal of the extra padding argument before
  off_t in 7.  However, that padding still exists for 32-bit powerpc, so
  use QUAD_ALIGN.
- Fix QUAD_ALIGN to be zero for powerpc64.  It should only be set to 1
  for 32-bit platforms that add padding to align 64-bit arguments.

8 years agoMost error cases in i915_gem_do_execbuffer() jump to one of two labels to
jhb [Thu, 1 Oct 2015 16:59:07 +0000 (16:59 +0000)]
Most error cases in i915_gem_do_execbuffer() jump to one of two labels to
release resources (such as unholding pages) when errors occur.  Some
recently added error checks return immediately instead of jumping to a
label resulting in leaks.  Fix these to jump to a label to do cleanup
instead.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3745

8 years agoEnsure that vop_stdadvise() does not call getblk() on vnodes that have an
markj [Thu, 1 Oct 2015 16:34:53 +0000 (16:34 +0000)]
Ensure that vop_stdadvise() does not call getblk() on vnodes that have an
empty bufobj. Otherwise, vnodes belonging to filesystems that do not use the
buffer cache may trigger assertion failures.

Reported by: Fabien Keil

8 years agoMake zero WUT use WRITE SAME with recently allowed NDOB flag.
mav [Thu, 1 Oct 2015 16:30:20 +0000 (16:30 +0000)]
Make zero WUT use WRITE SAME with recently allowed NDOB flag.

8 years agoImplement SPC-3 exceptions to SPC-2 RESERVE and RELEASE behavior.
mav [Thu, 1 Oct 2015 12:57:37 +0000 (12:57 +0000)]
Implement SPC-3 exceptions to SPC-2 RESERVE and RELEASE behavior.

8 years agoUnify PR variable names to reduce confusion.
mav [Thu, 1 Oct 2015 12:15:36 +0000 (12:15 +0000)]
Unify PR variable names to reduce confusion.

8 years agoAn IPI must be cleared before it is handled otherwise next IPI could be
andrew [Thu, 1 Oct 2015 12:09:05 +0000 (12:09 +0000)]
An IPI must be cleared before it is handled otherwise next IPI could be
missed. In other words, if a new request for an IPI is sent while the
previous request is being handled but the IPI is not cleared yet, the
clearing of the previous IPI request also clears the new one and the
handling is missed.

There are only three MP interrupt controllers in ARM now. Two of them are
fixed by this change, the third one is correct, probably only just by
accident. The fix is minimalistic as new interrupt framework is awaited.

It was debugged on RPi2 where missing IPI handling together with SCHED_ULE
led to situation in which tdq_ipipending was not cleared and so IPI_PREEMPT
was stopped to be sent. Various odditys were found related to slow system
response time like various events timed out, and slow console response.

Submitted by: Svatopluk Kraus <onwahe@gmail.com>
Reviewed by: loos, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3722

8 years agoDisable suspend when we're shutting down. This solves the "tell FreeBSD
cperciva [Thu, 1 Oct 2015 10:52:26 +0000 (10:52 +0000)]
Disable suspend when we're shutting down.  This solves the "tell FreeBSD
to shut down; close laptop lid" scenario which otherwise tended to end
with a laptop overheating or the battery dying.

The implementation uses a new sysctl, kern.suspend_blocked; init(8) sets
this while rc.suspend runs, and the ACPI sleep code ignores requests while
the sysctl is set.

Discussed on: freebsd-acpi (35 emails)
MFC after: 1 week

8 years agoUse pmap_load more consistently. While here try to only load the data once
andrew [Thu, 1 Oct 2015 10:43:40 +0000 (10:43 +0000)]
Use pmap_load more consistently. While here try to only load the data once
when we reuse the same data.

Obtained from: EuroBSDCon Devsummit
Sponsored by: ABT Systems Ltd

8 years agoPass 8 arguments to makecontext on arm64 as this is all we support.
andrew [Thu, 1 Oct 2015 09:53:12 +0000 (09:53 +0000)]
Pass 8 arguments to makecontext on arm64 as this is all we support.

Obtained from: EuroBSDCon Devsummit
Sponsored by: ABT Systems Ltd

8 years agoAdd the ENTRY/END entries around the exception handlers.
andrew [Thu, 1 Oct 2015 09:44:15 +0000 (09:44 +0000)]
Add the ENTRY/END entries around the exception handlers.

Obtained from: EuroBSDCon Devsummit
Sponsored by: ABT Systems Ltd

8 years agoAlso build ofwdump on arm64.
andrew [Thu, 1 Oct 2015 09:40:33 +0000 (09:40 +0000)]
Also build ofwdump on arm64.

Obtained from: EuroBSDCon Devsummit
Sponsored by: ABT Systems Ltd

8 years agoUpdate the arm64 ttys file to enable the correct uart based on which device
andrew [Thu, 1 Oct 2015 09:36:18 +0000 (09:36 +0000)]
Update the arm64 ttys file to enable the correct uart based on which device
the console is attached to. This makes this file identical to the 32-bit
arm version of this file.

Obtained from: EuroBSDCon devsummit
Sponsored by: ABT Systems Ltd

8 years agoFix `make depend` in sys/modules/otus
lwhsu [Thu, 1 Oct 2015 05:56:38 +0000 (05:56 +0000)]
Fix `make depend` in sys/modules/otus

Reviewed by: delphij
Approved by: delphij
Differential Revision: https://reviews.freebsd.org/D3751

8 years agoPartially revert r288433, with a minor change:
gjb [Thu, 1 Oct 2015 01:50:20 +0000 (01:50 +0000)]
Partially revert r288433, with a minor change:

Spell 'k' correctly.

Spotted by: loos (thank you!)
Sponsored by: The FreeBSD Foundation

8 years agoFix FAT_SIZE by removing '-b' argument passing, which was
gjb [Thu, 1 Oct 2015 00:34:38 +0000 (00:34 +0000)]
Fix FAT_SIZE by removing '-b' argument passing, which was
a result of my misunderstanding on what Crochet was doing
in this case for these boards.

Sponsored by: The FreeBSD Foundation

8 years agoMETA_MODE: Set HOST_CXX and HOST_CPP and chain them down into CXX/CPP for host builds.
bdrewery [Wed, 30 Sep 2015 23:14:23 +0000 (23:14 +0000)]
META_MODE: Set HOST_CXX and HOST_CPP and chain them down into CXX/CPP for host builds.

Sponsored by: EMC / Isilon Storage Division

8 years agoAs a step towards the elimination of PG_CACHED pages, rework the handling
markj [Wed, 30 Sep 2015 23:06:29 +0000 (23:06 +0000)]
As a step towards the elimination of PG_CACHED pages, rework the handling
of POSIX_FADV_DONTNEED so that it causes the backing pages to be moved to
the head of the inactive queue instead of being cached.

This affects the implementation of POSIX_FADV_NOREUSE as well, since it
works by applying POSIX_FADV_DONTNEED to file ranges after they have been
read or written.  At that point the corresponding buffers may still be
dirty, so the previous implementation would coalesce successive ranges and
apply POSIX_FADV_DONTNEED to the result, ensuring that pages backing the
dirty buffers would eventually be cached.  To preserve this behaviour in an
efficient manner, this change adds a new buf flag, B_NOREUSE, which causes
the pages backing a VMIO buf to be placed at the head of the inactive queue
when the buf is released.  POSIX_FADV_NOREUSE then works by setting this
flag in bufs that underlie the specified range.

Reviewed by: alc, kib
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3726

8 years agowordexp: Rewrite to make WRDE_NOCMD reliable.
jilles [Wed, 30 Sep 2015 21:32:29 +0000 (21:32 +0000)]
wordexp: Rewrite to make WRDE_NOCMD reliable.

Shell syntax is too complicated to detect command substitution and unquoted
operators reliably without implementing much of sh's parser. Therefore, have
sh do this detection.

While changing sh's support anyway, also read input from a pipe instead of
arguments to avoid {ARG_MAX} limits and improve privacy, and output count
and length using 16 instead of 8 digits.

The basic concept is:
execl("/bin/sh", "sh", "-c", "freebsd_wordexp ${1:+\"$1\"} -f "$2",
    "", flags & WRDE_NOCMD ? "-p" : "", <pipe with words>);

The WRDE_BADCHAR error is still implemented in libc. POSIX requires us to
fail strings containing unquoted braces with code WRDE_BADCHAR. Since this
is normally not a syntax error in sh, there is still a need for checking
code in libc, we_check().

The new we_check() is an optimistic check that all the characters
  <newline> | & ; < > ( ) { }
are quoted. To avoid duplicating too much sh logic, such characters are
permitted when quoting characters are seen, even if the quoting characters
may themselves be quoted. This code reports all WRDE_BADCHAR errors; bad
characters that get past it and are a syntax error in sh return WRDE_SYNTAX.

Although many implementations of WRDE_NOCMD erroneously allow some command
substitutions (and ours even documented this), there appears to be code that
relies on its security (codesearch.debian.net shows quite a few uses).
Passing untrusted data to wordexp() still exposes a denial of service
possibility and a fairly large attack surface.

Reviewed by: wblock (man page only)
MFC after: 2 weeks
Relnotes: yes
Security: fixes command execution with wordexp(untrusted, WRDE_NOCMD)

8 years agoReplace most of the beforeinstall: hack with FILES mechanism.
bdrewery [Wed, 30 Sep 2015 20:47:27 +0000 (20:47 +0000)]
Replace most of the beforeinstall: hack with FILES mechanism.

This now generates the files into the OBJDIR as needed.  Some of the files
are installed directly from the src directory.  Files which are generated
from the src directory are renamed to .in to generate them and avoid
colliding with the checked-in file when CURDIR=OBJDIR.

The remaining beforeinstall: handling still needs to be reworked as it does
not work well with staging for packaging.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoMETA_MODE: Remove unneeded groff/tmac special GENDIRDEPS_FILTER.
bdrewery [Wed, 30 Sep 2015 20:40:51 +0000 (20:40 +0000)]
META_MODE: Remove unneeded groff/tmac special GENDIRDEPS_FILTER.

This is converting the path usr/share/tmac.*stage to something else, but
nothing ever installs or reads from such a path.  They might look in
stage.*usr/share/tmac, but that's not what this is matching.  Additionally
the .dirdeps match all of the tmac files back to gnu/usr.bin/groff/tmac
fine.

Sponsored by: EMC / Isilon Storage Division

8 years agoUse proper STAILQ_* macros where possible.
mav [Wed, 30 Sep 2015 20:38:35 +0000 (20:38 +0000)]
Use proper STAILQ_* macros where possible.

8 years agoSeveral changes to truss.
jhb [Wed, 30 Sep 2015 19:13:32 +0000 (19:13 +0000)]
Several changes to truss.
- Refactor the interface between the ABI-independent code and the
  ABI-specific backends.  The backends now provide smaller hooks to
  fetch system call arguments and return values.  The rest of the
  system call entry and exit handling that was previously duplicated
  among all the backends has been moved to one place.
- Merge the loop when waiting for an event with the loop for handling stops.
  This also means not emulating a procfs-like interface on top of ptrace().
  Instead, use a single event loop that fetches process events via waitid().
  Among other things this allows us to report the full 32-bit exit value.
- Use PT_FOLLOW_FORK to follow new child processes instead of forking a new
  truss process for each new child.  This allows one truss process to monitor
  a tree of processes and truss -c should now display one total for the
  entire tree instead of separate summaries per process.
- Use the recently added fields to ptrace_lwpinfo to determine the current
  system call number and argument count.  The latter is especially useful
  and fixes a regression since the conversion from procfs.  truss now
  generally prints the correct number of arguments for most system calls
  rather than printing extra arguments for any call not listed in the
  table in syscalls.c.
- Actually check the new ABI when processes call exec.  The comments claimed
  that this happened but it was not being done (perhaps this was another
  regression in the conversion to ptrace()).  If the new ABI after exec
  is not supported, truss detaches from the process.  If truss does not
  support the ABI for a newly executed process the process is killed
  before it returns from exec.
- Along with the refactor, teach the various ABI-specific backends to
  fetch both return values, not just the first.  Use this to properly
  report the full 64-bit return value from lseek().  In addition, the
  handler for "pipe" now pulls the pair of descriptors out of the
  return values (which is the true kernel system call interface) but
  displays them as an argument (which matches the interface exported by
  libc).
- Each ABI handler adds entries to a linker set rather than requiring
  a statically defined table of handlers in main.c.
- The arm and mips system call fetching code was changed to follow the
  same pattern as amd64 (and the in-kernel handler) of fetching register
  arguments first and then reading any remaining arguments from the
  stack.  This should fix indirect system call arguments on at least
  arm.
- The mipsn32 and n64 ABIs will now look for arguments in A4 through A7.
- Use register %ebp for the 6th system call argument for Linux/i386 ABIs
  to match the in-kernel argument fetch code.
- For powerpc binaries on a powerpc64 system, fetch the extra arguments
  on the stack as 32-bit values that are then copied into the 64-bit
  argument array instead of reading the 32-bit values directly into the
  64-bit array.

Reviewed by: kib (earlier version)
Tested on: amd64 (FreeBSD/amd64 & i386), i386, arm (earlier version)
Tested on: powerpc64 (FreeBSD/powerpc64 & powerpc)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D3575