]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoPass the pcb to store the vfp state in to vfp_save_state. This fixes a bug
Andrew Turner [Mon, 3 Aug 2015 11:05:02 +0000 (11:05 +0000)]
Pass the pcb to store the vfp state in to vfp_save_state. This fixes a bug
in savectx where it will be used to store the current state however will
pass in a pcb when vfp_save_state expected a thread pointer.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

9 years agoFix KSTACK_PAGES check in ZFS module
Steven Hartland [Mon, 3 Aug 2015 09:34:09 +0000 (09:34 +0000)]
Fix KSTACK_PAGES check in ZFS module

The check introduced by r285946 failed to add the dependency on
opt_kstack_pages.h which meant the default value for the platform instead
of the customised options KSTACK_PAGES=X was being tested.

Also wrap in #ifdef __FreeBSD__ for portability.

MFC after: 3 days
Sponsored by: Multiplay

9 years agoSet p_osrel to __FreeBSD_version on process startup.
Ed Schouten [Mon, 3 Aug 2015 07:29:57 +0000 (07:29 +0000)]
Set p_osrel to __FreeBSD_version on process startup.

Certain system calls have quirks applied to make them work as if called
on an older version of FreeBSD. As CloudABI executables don't have the
FreeBSD OS release number in the ELF header, this value is set to zero,
making the system calls fall back to typically historic, non-standard
behaviour.

Reviewed by: kib

9 years agoFix bugs spotted by gcc
Baptiste Daroussin [Mon, 3 Aug 2015 06:06:56 +0000 (06:06 +0000)]
Fix bugs spotted by gcc

Reported by: adrian

9 years agoActually set quiet to something.
Adrian Chadd [Mon, 3 Aug 2015 05:59:30 +0000 (05:59 +0000)]
Actually set quiet to something.

/usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c: In function 'pw_user_next':
/usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c:680: warning: statement with no effect

9 years agoMake image_copyout_zeroes() an interface function.
Marcel Moolenaar [Mon, 3 Aug 2015 01:24:48 +0000 (01:24 +0000)]
Make image_copyout_zeroes() an interface function.

9 years agoPass correct type of argument to ti_gpio_unmask_irq in ti_gpio_activate_resource
Oleksandr Tymoshenko [Mon, 3 Aug 2015 01:22:49 +0000 (01:22 +0000)]
Pass correct type of argument to ti_gpio_unmask_irq in ti_gpio_activate_resource

9 years agolooks like all archs either have clang or cdefs included before..
John-Mark Gurney [Sun, 2 Aug 2015 21:33:40 +0000 (21:33 +0000)]
looks like all archs either have clang or cdefs included before..
drop this include as unnecessary..

Requested by: bde

9 years agoAdd an example program (in Python) for the AMD Am79c900 (ILACC)
Marcel Moolenaar [Sun, 2 Aug 2015 21:24:03 +0000 (21:24 +0000)]
Add an example program (in Python) for the AMD Am79c900 (ILACC)
ethernet controller. The ethernet controller is emulated by VMware
Fusion (for example) and is a good device to demonstrate how to use
the bus space and busdma functions due to its simple programming.

The program sets up the DMA structures, sends a DHCP discover packet,
waits 2 seconds, and iterates over the receive ring for an offer.

9 years agoUse intmax_t rather than long long
Baptiste Daroussin [Sun, 2 Aug 2015 19:49:24 +0000 (19:49 +0000)]
Use intmax_t rather than long long

9 years agoConvert the year used for regression test fro 2043 to 2037
Baptiste Daroussin [Sun, 2 Aug 2015 18:20:36 +0000 (18:20 +0000)]
Convert the year used for regression test fro 2043 to 2037

This makes the regression tests pass on systems where time_t is 32bits

9 years agoDon't forget to check the vendor when probing. Also, there's no need
Warner Losh [Sun, 2 Aug 2015 16:26:41 +0000 (16:26 +0000)]
Don't forget to check the vendor when probing. Also, there's no need
to double check for if the card has probed before. In fact, there's no
reason to single check either. Simplify the code as a result.
$FreeBSD$ added to lxutil.c in a non-standard way to help keep the
diffs with upstream to a minimum.

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

9 years agoDon't take the port numbers for packets containing ABORT chunks from
Michael Tuexen [Sun, 2 Aug 2015 16:07:30 +0000 (16:07 +0000)]
Don't take the port numbers for packets containing ABORT chunks from
a freed mbuf. Just use them from the stcb.

MFC after: 3 days

9 years agoAdd a manual page for the cloudabi and cloudabi64 kernel modules.
Ed Schouten [Sun, 2 Aug 2015 14:56:30 +0000 (14:56 +0000)]
Add a manual page for the cloudabi and cloudabi64 kernel modules.

CloudABI has two separate kernel modules: cloudabi and cloudabi64. The
first module contains all the pointer size independent code, whereas
cloudabi64 contains the actual 64-bits specific system calls and the ELF
loader.

Reviewed by: wblock
Obtained from: https://github.com/NuxiNL/freebsd
Differential Revision: https://reviews.freebsd.org/D3258

9 years agoFix build on 32bits
Baptiste Daroussin [Sun, 2 Aug 2015 13:50:11 +0000 (13:50 +0000)]
Fix build on 32bits

9 years agoSplit some extra long lines
Baptiste Daroussin [Sun, 2 Aug 2015 13:33:17 +0000 (13:33 +0000)]
Split some extra long lines

9 years agoSplit some extra long lines
Baptiste Daroussin [Sun, 2 Aug 2015 13:32:23 +0000 (13:32 +0000)]
Split some extra long lines

9 years agoCleanup a bit includes
Baptiste Daroussin [Sun, 2 Aug 2015 13:22:46 +0000 (13:22 +0000)]
Cleanup a bit includes

9 years agoAdd regression tests about adding already existsing groups/users
Baptiste Daroussin [Sun, 2 Aug 2015 13:02:53 +0000 (13:02 +0000)]
Add regression tests about adding already existsing groups/users

9 years agoFix regression: report if a group already exists when creating it
Baptiste Daroussin [Sun, 2 Aug 2015 12:56:25 +0000 (12:56 +0000)]
Fix regression: report if a group already exists when creating it

9 years agoFix regression: report again if a username already exists when creating it
Baptiste Daroussin [Sun, 2 Aug 2015 12:54:15 +0000 (12:54 +0000)]
Fix regression: report again if a username already exists when creating it

9 years agoRemove dead code
Baptiste Daroussin [Sun, 2 Aug 2015 12:48:36 +0000 (12:48 +0000)]
Remove dead code

9 years agoRewrite parsing subcommands arguments of pw(8)
Baptiste Daroussin [Sun, 2 Aug 2015 12:47:50 +0000 (12:47 +0000)]
Rewrite parsing subcommands arguments of pw(8)

Now each subcommands checks its arguments in a dedicated functions.

This helps improving input validation, code readability/maintainability
While here:
- Add a -y option to pw userdel/usermod so it can maintain NIS servers if
  nispasswd is not defined in pw.conf(5)
- Allow pw -r <rootdir> to remove directory with userdel -r
- Fix bug when renaming a user which was not renaming the user name it groups
  it is a member of.
- Only parse pw.conf(5) when needed.

9 years agoProperly handle IPV6_NEXTHOP socket option in selectroute().
Andrey V. Elsukov [Sun, 2 Aug 2015 12:40:56 +0000 (12:40 +0000)]
Properly handle IPV6_NEXTHOP socket option in selectroute().

 o remove disabled code;
 o if nexthop address is link-local, use embedded scope zone id to
   determine outgoing interface;
 o properly fill ro_dst before doing route lookup;
 o remove LLE lookup, instead check rt_flags for RTF_GATEWAY bit.

Sponsored by: Yandex LLC

9 years agoRemove redundant check.
Andrey V. Elsukov [Sun, 2 Aug 2015 11:58:24 +0000 (11:58 +0000)]
Remove redundant check.

9 years agoAdd removed tests to ObsoleteFiles.inc
Baptiste Daroussin [Sun, 2 Aug 2015 02:23:30 +0000 (02:23 +0000)]
Add removed tests to ObsoleteFiles.inc

Submitted by: ngie

9 years agoFix a couple of markup typos.
John Baldwin [Sun, 2 Aug 2015 02:00:20 +0000 (02:00 +0000)]
Fix a couple of markup typos.

MFC after: 2 weeks

9 years agoRename busdma_sync() to busdma_sync_range() and rename the
Marcel Moolenaar [Sun, 2 Aug 2015 01:09:30 +0000 (01:09 +0000)]
Rename busdma_sync() to busdma_sync_range() and rename the
base and size parameters to ofs and len (resp). Add a new
busdma_sync() that makes the entire MD coherent.

9 years agoRegenerate after r286174.
Mark Johnston [Sun, 2 Aug 2015 00:56:16 +0000 (00:56 +0000)]
Regenerate after r286174.

9 years agoAdd a src.conf option to build and install the DTrace test suite.
Mark Johnston [Sun, 2 Aug 2015 00:37:33 +0000 (00:37 +0000)]
Add a src.conf option to build and install the DTrace test suite.

Reviewed by: gnn, ngie
Differential Revision: https://reviews.freebsd.org/D3195

9 years agoRemove netbsd tests on pw(8)
Baptiste Daroussin [Sun, 2 Aug 2015 00:33:34 +0000 (00:33 +0000)]
Remove netbsd tests on pw(8)

First they are redundant with the tests we currently have on pw(8)
Second they to modify the host database instead of being self contained withing
the test directory

9 years agoDon't hardcode the module or function component of lockstat probes.
Mark Johnston [Sun, 2 Aug 2015 00:24:21 +0000 (00:24 +0000)]
Don't hardcode the module or function component of lockstat probes.

MFC after: 1 week

9 years ago- Remove hardcoded paths for the perl executable.
Mark Johnston [Sun, 2 Aug 2015 00:23:18 +0000 (00:23 +0000)]
- Remove hardcoded paths for the perl executable.
- Rather than assuming that a process is listening on 127.0.0.1:22, use
  nc(1) to find an available port and bind to it for the duration of the
  test.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

9 years agomark this function as deprecated, and put the warning first, since I
John-Mark Gurney [Sun, 2 Aug 2015 00:22:14 +0000 (00:22 +0000)]
mark this function as deprecated, and put the warning first, since I
doubt most people will read to the end...  Note the use of sys/cdefs.h
for pre-C11 compilers...

I didn't included a note about being compatibile w/ userland since a
C11 feature should be obviously usable in userland...

Suggested by: imp

9 years agoPerform bounds checking when constructing a format string.
Mark Johnston [Sun, 2 Aug 2015 00:18:48 +0000 (00:18 +0000)]
Perform bounds checking when constructing a format string.

This was detected by the FORTIFY_SOURCE build.

PR: 201657
Reported by: pfg
MFC after: 2 weeks

9 years agoconvert to C11's _Static_assert, and pull in sys/cdefs.h for
John-Mark Gurney [Sun, 2 Aug 2015 00:15:52 +0000 (00:15 +0000)]
convert to C11's _Static_assert, and pull in sys/cdefs.h for
compatibility w/ older non-C11 compilers...

passed make tinerdbox..

Suggested by: imp

9 years agoAvoid dereferencing curthread->td_proc->p_cred in DTrace probe context.
Mark Johnston [Sun, 2 Aug 2015 00:11:56 +0000 (00:11 +0000)]
Avoid dereferencing curthread->td_proc->p_cred in DTrace probe context.

When a process is exiting, there is a narrow window where p_cred may be
NULL while its threads are still executing. Specifically, the last thread
to exit a process sets the process state to PRS_ZOMBIE with the proc
spinlock held and then calls thread_exit(). thread_exit() drops the spin
lock, permitting the process to be reaped and thus causing its cred struct
to be released. However, the exiting thread may still cause DTrace probes
to fire by calling sched_throw(), resulting in a double fault if such a
probe enabling attempts to access the GID or UID DIF variables.

The thread's cred reference is not susceptible to this race since it is not
released until after the thread has exited.

MFC after: 1 week

9 years agoDon't modify curthread->td_locks unless INVARIANTS is enabled.
Mark Johnston [Sun, 2 Aug 2015 00:03:08 +0000 (00:03 +0000)]
Don't modify curthread->td_locks unless INVARIANTS is enabled.

This field is only used in a KASSERT that verifies that no locks are held
when returning to user mode. Moreover, the td_locks accounting is only
correct when LOCK_DEBUG > 0, which is implied by INVARIANTS.

Reviewed by: jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3205

9 years agoSet output pin initial value based on pin's pinmux pullup/pulldown setup
Oleksandr Tymoshenko [Sat, 1 Aug 2015 23:10:36 +0000 (23:10 +0000)]
Set output pin initial value based on pin's pinmux pullup/pulldown setup

Some of FDT blobs for AM335x-based devices use pinmux pullup/pulldown
flag to setup initial GPIO ouputp value, e.g. 4DCAPE-43 sets LCD DATAEN
signal this way. It works for Linux because Linux driver does not enforce
pin direction until after it's requested by consumer. So input with pullup
flag set acts as output with GPIO_HIGH value

Reviewed by: loos

9 years agorc.subr: Allow rc.conf.d with multi-directory local_startup.
Jilles Tjoelker [Sat, 1 Aug 2015 22:00:25 +0000 (22:00 +0000)]
rc.subr: Allow rc.conf.d with multi-directory local_startup.

I also changed ${...%*/rc.d} to ${...%/rc.d} since the shortest match always
has an empty string for the asterisk.

PR: 201641
Submitted by: Jamie Landeg-Jones (original version)
MFC after: 1 week

9 years agoFree mbufs when busdma loading fails.
Hans Petter Selasky [Sat, 1 Aug 2015 20:40:37 +0000 (20:40 +0000)]
Free mbufs when busdma loading fails.

Reviewed by: erj, sbruno
MFC after: 1 month

9 years ago- Add myself to the calendar.freebsd. (fix typo in r286160)
Jason Unovitch [Sat, 1 Aug 2015 17:48:35 +0000 (17:48 +0000)]
- Add myself to the calendar.freebsd. (fix typo in r286160)

Approved by: delphij (mentor)
Differential Revision: https://reviews.FreeBSD.org/D3265

9 years ago- Add myself to the committers-ports.dot and add my mentor relationship.
Jason Unovitch [Sat, 1 Aug 2015 17:29:52 +0000 (17:29 +0000)]
- Add myself to the committers-ports.dot and add my mentor relationship.
- Add myself to the calendar.freebsd.

Approved by: delphij (mentor)
Differential Revision: https://reviews.FreeBSD.org/D3265

9 years agouse : instead of true...
John-Mark Gurney [Sat, 1 Aug 2015 17:27:47 +0000 (17:27 +0000)]
use : instead of true...

Change file file to file1 file2, partly for igor, and partly because
it's odd to pass the same file to a command twice..

9 years agoClear P_TRACED before reparenting a detached process back to its
John Baldwin [Sat, 1 Aug 2015 16:27:52 +0000 (16:27 +0000)]
Clear P_TRACED before reparenting a detached process back to its
original parent. Otherwise the debugee will be set as an orphan of
the debugger.

Add tests for tracing forks via PT_FOLLOW_FORK.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D2809

9 years agoRemove things that crept in after badly checked revert
Baptiste Daroussin [Sat, 1 Aug 2015 12:20:55 +0000 (12:20 +0000)]
Remove things that crept in after badly checked revert

9 years agoPartial revert of r286152
Baptiste Daroussin [Sat, 1 Aug 2015 12:18:48 +0000 (12:18 +0000)]
Partial revert of r286152

More work needed on the cli validation

9 years agoFix build
Baptiste Daroussin [Sat, 1 Aug 2015 11:52:48 +0000 (11:52 +0000)]
Fix build

9 years agoFix formatting of new code
Baptiste Daroussin [Sat, 1 Aug 2015 11:31:59 +0000 (11:31 +0000)]
Fix formatting of new code
Fix sorting or errstr
Remove useless initialisation or errstr

Reported by: bde

9 years agoRevert r286148
Baptiste Daroussin [Sat, 1 Aug 2015 10:40:17 +0000 (10:40 +0000)]
Revert r286148

9 years agoValidate expiration days and password days from commmand line and pw.conf
Baptiste Daroussin [Sat, 1 Aug 2015 10:25:55 +0000 (10:25 +0000)]
Validate expiration days and password days from commmand line and pw.conf

9 years agoValidate the max_uid/max_gid boundaries and entry type in pw.conf
Baptiste Daroussin [Sat, 1 Aug 2015 10:10:13 +0000 (10:10 +0000)]
Validate the max_uid/max_gid boundaries and entry type in pw.conf

9 years agoCast uid/git to uintmax_t when using printf-like functions so the size of
Baptiste Daroussin [Sat, 1 Aug 2015 09:55:47 +0000 (09:55 +0000)]
Cast uid/git to uintmax_t when using printf-like functions so the size of
uid/gid size remains a implementation detail

9 years agoHandle +:*:: the same way we handle +::: when checking group file
Baptiste Daroussin [Sat, 1 Aug 2015 08:39:55 +0000 (08:39 +0000)]
Handle +:*:: the same way we handle +::: when checking group file

The first is what the documentation recommands for NIS client

9 years agoUse strtoumax instead of strtoul
Baptiste Daroussin [Sat, 1 Aug 2015 08:35:20 +0000 (08:35 +0000)]
Use strtoumax instead of strtoul

9 years agoAllow CloudABI processes to create shared memory objects.
Ed Schouten [Sat, 1 Aug 2015 07:51:48 +0000 (07:51 +0000)]
Allow CloudABI processes to create shared memory objects.

Summary:
Use the newly created `kern_shm_open()` function to create objects with
just the rights that are actually needed.

Reviewers: jhb, kib

Subscribers: imp

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

9 years agoAdd kern_shm_open().
Ed Schouten [Sat, 1 Aug 2015 07:21:14 +0000 (07:21 +0000)]
Add kern_shm_open().

This allows you to specify the capabilities that the new file descriptor
should have. This allows us to create shared memory objects that only
have the rights we're interested in.

The idea behind restricting the rights is that it makes it a lot easier
for CloudABI to get consistent behaviour across different operating
systems. We only need to make sure that a shared memory implementation
consistently implements the operations that are whitelisted.

Approved by: kib
Obtained from: https://github.com/NuxiNL/freebsd

9 years agoBuffer overflow in wall(1).
Pedro F. Giffuni [Sat, 1 Aug 2015 01:29:55 +0000 (01:29 +0000)]
Buffer overflow in wall(1).

Revert r286102 and apply a cleaner fix.
Tested for overflows by FORTIFY_SOURCE GSoC (with clang).

Suggested by: bde
Reviewed by: Oliver Pinter
Tested by: Oliver Pinter
MFC after: 3 days

9 years agoAdd support for keys that include 4 byte SALT values,
George V. Neville-Neil [Fri, 31 Jul 2015 23:40:18 +0000 (23:40 +0000)]
Add support for keys that include 4 byte SALT values,
including GCM and ICM/CTR modes for AES.

Reviewed by: jmg
MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)

9 years agoRemove two unnecessary sleeps from the hot path in bpf(4).
Luiz Otavio O Souza [Fri, 31 Jul 2015 21:43:27 +0000 (21:43 +0000)]
Remove two unnecessary sleeps from the hot path in bpf(4).

The first one never triggers because bpf_canfreebuf() can only be true for
zero-copy buffers and zero-copy buffers are not read with read(2).

The second also never triggers, because we check the free buffer before
calling ROTATE_BUFFERS().  If the hold buffer is in use the free buffer
will be NULL and there is nothing else to do besides drop the packet.  If
the free buffer isn't NULL the hold buffer _is_ free and it is safe to
rotate the buffers.

Update the comment in ROTATE_BUFFERS macro to match the logic described
here.

While here fix a few typos in comments.

MFC after: 2 weeks
Sponsored by: Rubicon Communications (Netgate)

9 years agoRemove the sleep from the buffer allocation routine.
Luiz Otavio O Souza [Fri, 31 Jul 2015 20:25:54 +0000 (20:25 +0000)]
Remove the sleep from the buffer allocation routine.

The buffer must be allocated (or even changed) before the interface is set
and thus, there is no need to verify if the buffer is in use.

MFC after: 2 weeks
Sponsored by: Rubicon Communications (Netgate)

9 years agoDo not allocate the buffers at opening of the descriptor, because once
Luiz Otavio O Souza [Fri, 31 Jul 2015 20:02:12 +0000 (20:02 +0000)]
Do not allocate the buffers at opening of the descriptor, because once
the buffer is allocated we are committed to a particular buffer method
(BPF_BUFMODE_BUFFER in this case).

If we are using zero-copy buffers, the userland program must register its
buffers before set the interface.

If we are using kernel memory buffers, we can allocate the buffer at the
time that the interface is being set.

This fix allows the usage of BIOCSETBUFMODE after r235746.

Update the comments to reflect the recent changes.

MFC after: 2 weeks
Sponsored by: Rubicon Communications (Netgate)

9 years agoSummary: Remove unsupported 3des-deriv encryption algorithm from documentation.
George V. Neville-Neil [Fri, 31 Jul 2015 17:41:53 +0000 (17:41 +0000)]
Summary: Remove unsupported 3des-deriv encryption algorithm from documentation.

9 years agoUse standard 'THE AUTHOR' license text
Ed Maste [Fri, 31 Jul 2015 16:45:42 +0000 (16:45 +0000)]
Use standard 'THE AUTHOR' license text

Approved by: jmg

9 years agoTry to put the CPU into a low power state if we failed to otherwise halt
Andrew Turner [Fri, 31 Jul 2015 15:54:34 +0000 (15:54 +0000)]
Try to put the CPU into a low power state if we failed to otherwise halt
the system.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

9 years agoLoad the stack in stack_save and stack_save_td. This uses the generalised
Andrew Turner [Fri, 31 Jul 2015 15:32:32 +0000 (15:32 +0000)]
Load the stack in stack_save and stack_save_td. This uses the generalised
unwind_frame function to read each stack frame until either the pc or stack
are no longer withing the kernel's address space.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

9 years agoPull pmspcv (pms(4)) from GENERIC. It has PCI ID conflicts
Glen Barber [Fri, 31 Jul 2015 15:23:48 +0000 (15:23 +0000)]
Pull pmspcv (pms(4)) from GENERIC.  It has PCI ID conflicts
with ahd(4), mvs(4), and likely other drivers.

MFC after: immediately
With hat: re
Sponsored by: The FreeBSD Foundation

9 years agoAdd support for uma_small_alloc and uma_small_free, and make use of these.
Andrew Turner [Fri, 31 Jul 2015 14:17:26 +0000 (14:17 +0000)]
Add support for uma_small_alloc and uma_small_free, and make use of these.
This is copied from the amd64 version with minor changes. These should be
merged into a single file as from a quick look there are other copies of
the same file in other parts of the tree.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

9 years agoAdd memrw. This has had minimal testing, and will likely panic the kernel
Andrew Turner [Fri, 31 Jul 2015 13:39:51 +0000 (13:39 +0000)]
Add memrw. This has had minimal testing, and will likely panic the kernel
when trying to read data from outside the DMAP region. I expect this panic
to be from within uiomove_fromphys, which needs to grow support to support
such addresses.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

9 years agoAdd more atomic_swap_* functions.
Andrew Turner [Fri, 31 Jul 2015 13:34:43 +0000 (13:34 +0000)]
Add more atomic_swap_* functions.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

9 years agoAdd VIRT_IN_DMAP to check if a virtual address is from the DMAP range.
Andrew Turner [Fri, 31 Jul 2015 13:32:25 +0000 (13:32 +0000)]
Add VIRT_IN_DMAP to check if a virtual address is from the DMAP range.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

9 years agoAdd ELF Tool Chain's brandelf(1) to contrib
Ed Maste [Fri, 31 Jul 2015 12:37:40 +0000 (12:37 +0000)]
Add ELF Tool Chain's brandelf(1) to contrib

Noticed by pfg after r286070 (ar and elfdump)

9 years agoFix accidental line wrapping introduced in r286122.
Ed Schouten [Fri, 31 Jul 2015 10:46:45 +0000 (10:46 +0000)]
Fix accidental line wrapping introduced in r286122.

9 years agoLimit rights on process descriptors.
Ed Schouten [Fri, 31 Jul 2015 10:21:58 +0000 (10:21 +0000)]
Limit rights on process descriptors.

On CloudABI, the rights bits returned by cap_rights_get() match up with
the operations that you can actually perform on the file descriptor.

Limiting the rights is good, because it makes it easier to get uniform
behaviour across different operating systems. If process descriptors on
FreeBSD would suddenly gain support for any new file operation, this
wouldn't become exposed to CloudABI processes without first extending
the rights.

Extend fork1() to gain a 'struct filecaps' argument that allows you to
construct process descriptors with custom rights. Use this in
cloudabi_sys_proc_fork() to limit the rights to just fstat() and
pdwait().

Obtained from: https://github.com/NuxiNL/freebsd

9 years agoApply erratum for mrs ICC_IAR1_EL1 speculative execution on ThunderX
Zbigniew Bodek [Fri, 31 Jul 2015 10:00:45 +0000 (10:00 +0000)]
Apply erratum for mrs ICC_IAR1_EL1 speculative execution on ThunderX

ERRATUM:     22978, 23154
PASS (rev.): 1.0/1.1

Reviewed by:   imp
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3184

9 years agoLimit the number of times we loop inside the DWC OTG poll handler to
Hans Petter Selasky [Fri, 31 Jul 2015 09:12:31 +0000 (09:12 +0000)]
Limit the number of times we loop inside the DWC OTG poll handler to
avoid starving other fast interrupts. Fix a comment while at it.

MFC after: 1 week
Suggested by: Svatopluk Kraus <onwahe@gmail.com>

9 years agoAnsify if_stf.c
Andrey V. Elsukov [Fri, 31 Jul 2015 09:04:22 +0000 (09:04 +0000)]
Ansify if_stf.c

9 years agoRemove unneded #include "opt_inet.h".
Andrey V. Elsukov [Fri, 31 Jul 2015 09:02:28 +0000 (09:02 +0000)]
Remove unneded #include "opt_inet.h".

9 years agoDocument the existence of cloudabi_load and cloudabi64_load.
Ed Schouten [Fri, 31 Jul 2015 08:45:35 +0000 (08:45 +0000)]
Document the existence of cloudabi_load and cloudabi64_load.

9 years agotemporarily fix build.. This isn't the final fix, and testing is
John-Mark Gurney [Fri, 31 Jul 2015 07:48:08 +0000 (07:48 +0000)]
temporarily fix build..  This isn't the final fix, and testing is
still on going, but it has passed world for mips and powerpc...

I know this has an extra semicolon, but this is the patch that is
tested...

Looks like better fix is to use _Static_assert...

9 years agocxgbe(4): initialize debug_flags from the kernel environment.
Navdeep Parhar [Fri, 31 Jul 2015 04:50:47 +0000 (04:50 +0000)]
cxgbe(4): initialize debug_flags from the kernel environment.

MFC after: 3 days

9 years agovn_io_fault() handling of the LOR for i/o into the file-backed buffers
Konstantin Belousov [Fri, 31 Jul 2015 04:12:51 +0000 (04:12 +0000)]
vn_io_fault() handling of the LOR for i/o into the file-backed buffers
has observable overhead when the buffer pages are not resident or not
mapped.  The overhead comes at least from two factors, one is the
additional work needed to detect the situation, prepare and execute
the rollbacks.  Another is the consequence of the i/o splitting into
the batches of the held pages, causing filesystems see series of the
smaller i/o requests instead of the single large request.

Note that expected case of the resident i/o buffer does not expose
these issues.  Provide a prefaulting for the userspace i/o buffers,
disabled by default.  I am careful of not enabling prefaulting by
default for now, since it would be detrimental for the applications
which speculatively pass extra-large buffers of anonymous memory to
not deal with buffer sizing (if such apps exist).

Found and tested by: bde, emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoThe implementation note isn't true anymore..
John-Mark Gurney [Fri, 31 Jul 2015 03:28:02 +0000 (03:28 +0000)]
The implementation note isn't true anymore..

Not that anyone reads it, but those that do, remind them that this
isn't usable in userland...  I can't wait till this doc is wrong..

9 years agoBuffer overflow in wall(1).
Pedro F. Giffuni [Fri, 31 Jul 2015 01:12:31 +0000 (01:12 +0000)]
Buffer overflow in wall(1).

This affected syslogd, wall and talkd.
Detected by FORTIFY_SOURCE GSoC (with clang).

Submitted by: Oliver Pinter
Differential Revision: https://reviews.freebsd.org/D3254
Reviewed by: delphij, jmg
MFC after: 3 days

9 years agothese are comparing authenticators and need to be constant time...
John-Mark Gurney [Fri, 31 Jul 2015 00:31:52 +0000 (00:31 +0000)]
these are comparing authenticators and need to be constant time...
This could be a side channel attack...  Now that we have a function
for this, use it...

jmgurney/ipsecgcm: 24d704cc and 7f37a14

9 years agoClean up this header file...
John-Mark Gurney [Fri, 31 Jul 2015 00:23:21 +0000 (00:23 +0000)]
Clean up this header file...

use CTASSERTs now that we have them...

Replace a draft w/ RFC that's over 10 years old.

Note that _AALG and _EALG do not need to match what the IKE daemons
think they should be..  This is part of the KABI...  I decided to
renumber AESCTR, but since we've never had working AESCTR mode, I'm
not really breaking anything..  and it shortens a loop by quite
a bit..

remove SKIPJACK IPsec support...  SKIPJACK never made it out of draft
(in 1999), only has 80bit key, NIST recommended it stop being used
after 2010, and setkey nor any of the IKE daemons I checked supported
it...

jmgurney/ipsecgcm: a357a33c75808be008669b27b6d6

Reviewed by: gnn (earlier version)

9 years agoCorrect IPSec SA statistic keeping
Ermal Luçi [Thu, 30 Jul 2015 20:56:27 +0000 (20:56 +0000)]
Correct IPSec SA statistic keeping

The IPsec SA statistic keeping is used even for decision making on expiry/rekeying SAs.
When there are multiple transformations being done the statistic keeping might be wrong.

This mostly impacts multiple encapsulations on IPsec since the usual scenario it is not noticed due to the code path not taken.

Differential Revision: https://reviews.freebsd.org/D3239
Reviewed by: ae, gnn
Approved by: gnn(mentor)

9 years agoRevert r285125 until rmlocks get fixed.
Mateusz Guzik [Thu, 30 Jul 2015 19:52:43 +0000 (19:52 +0000)]
Revert r285125 until rmlocks get fixed.

Right now there is a chance that sysctl unregister will cause reader to
block on the sx lock associated with sysctl rmlock, in which case kernels
with debug enabled will panic.

9 years agoUse correct number of arguments to semctl() for IPC_RMID.
Craig Rodrigues [Thu, 30 Jul 2015 19:44:46 +0000 (19:44 +0000)]
Use correct number of arguments to semctl() for IPC_RMID.

PR: 118292
Submitted by: araujo
Differential Revision: D2669

9 years agoFix a rendering issue in the zfs(8) manual.
Glen Barber [Thu, 30 Jul 2015 19:34:24 +0000 (19:34 +0000)]
Fix a rendering issue in the zfs(8) manual.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

9 years agoUpdate snd_una description to make it more readable.
Hiren Panchasara [Thu, 30 Jul 2015 19:24:49 +0000 (19:24 +0000)]
Update snd_una description to make it more readable.

Differential Revision: https://reviews.freebsd.org/D3179
Reviewed by: gnn
Sponsored by: Limelight Networks

9 years agoThe kernel option and module are actually called pmspcv.
Christian Brueffer [Thu, 30 Jul 2015 19:08:23 +0000 (19:08 +0000)]
The kernel option and module are actually called pmspcv.

MFC after: 3 days

9 years agoAdd GPIO backlight driver compatible with Linux FDT bindings.
Oleksandr Tymoshenko [Thu, 30 Jul 2015 19:04:14 +0000 (19:04 +0000)]
Add GPIO backlight driver compatible with Linux FDT bindings.
Brightness is controlled through sysctl dev.gpiobacklight.X.brightness:
  - any value greater than 0: backlight is on
  - any value less than or equal to  0: backlight is off

FDT bindings docs in Linux tree:
    Documentation/devicetree/bindings/video/backlight/gpio-backlight.txt

9 years agoGet function prototypes for msg, shm, sem functions
Craig Rodrigues [Thu, 30 Jul 2015 18:59:01 +0000 (18:59 +0000)]
Get function prototypes for msg, shm, sem functions
from header files.

Differential Revision: D2669

9 years agoib mad: fix an incorrect use of list_for_each_entry
Mark Johnston [Thu, 30 Jul 2015 18:28:37 +0000 (18:28 +0000)]
ib mad: fix an incorrect use of list_for_each_entry

In tf_dequeue(), if we reach the end of the list without finding a
non-cancelled element, "tmp" will be a pointer into the list head, so the
tmp->canceled check is bogus. Use a flag instead.

Submitted by: Tao Liu <Tao.Liu@isilon.com>
Reviewed by: hselasky
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3244

9 years agoDo not pretend that vm_fault(9) supports unwiring the address. Rename
Konstantin Belousov [Thu, 30 Jul 2015 18:28:34 +0000 (18:28 +0000)]
Do not pretend that vm_fault(9) supports unwiring the address.  Rename
the VM_FAULT_CHANGE_WIRING flag to VM_FAULT_WIRE.  Assert that the
flag is only passed when faulting on the wired map entry.  Remove the
vm_page_unwire() call, which should be never reachable.

Since VM_FAULT_WIRE flag implies wired map entry, the TRYPAGER() macro
is reduced to the testing of the fs.object having a default pager.
Inline the check.

Suggested and reviewed by: alc
Tested by: pho (previous version)
MFC after: 1 week

9 years agoMake some variables and functions static.
Craig Rodrigues [Thu, 30 Jul 2015 18:08:08 +0000 (18:08 +0000)]
Make some variables and functions static.

9 years agoUpdat the committers graph
Allan Jude [Thu, 30 Jul 2015 17:02:23 +0000 (17:02 +0000)]
Updat the committers graph

Approved by: marcel (mentor)
Differential Revision: https://reviews.freebsd.org/D3251

9 years agoAdd enough of pmap_page_set_memattr to run gstat. It still needs to split
Andrew Turner [Thu, 30 Jul 2015 16:17:44 +0000 (16:17 +0000)]
Add enough of pmap_page_set_memattr to run gstat. It still needs to split
the DMAP 1G pages so we set the attributes only on the specified page.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

9 years agoImprove comments.
Konstantin Belousov [Thu, 30 Jul 2015 15:47:53 +0000 (15:47 +0000)]
Improve comments.

Submitted by: bde
MFC after: 2 weeks