Commit Graph

197129 Commits

Author SHA1 Message Date
Dimitry Andric
f8270a6221 Ensure that lint does not pick up C11 keywords (e.g. _Noreturn), even
if C11 mode is used.  It does not support any C11 constructs.

MFC after:	3 days
2015-01-29 18:44:21 +00:00
Luiz Otavio O Souza
c67d5d66bf Rename the avila, cambria and zynq GPIO driver names to match the expected
string.

With this change it is not necessary redeclare the driver relations with
gpiobus and gpioc.

This also prevents redundant declarations when gpiobusvar.h is included
(which is going to happen soon).
2015-01-29 18:08:50 +00:00
Pedro F. Giffuni
71501ba6e3 MFV r277870
Fix compile warnings for gcc-4.4.x
This also fixes at least a warning with clang 3.6.0
including the fix for r277841.

MFC after:	1 week
2015-01-29 15:35:55 +00:00
Pedro F. Giffuni
490f7995d3 Revert r277841: It will be re-merged through the vendor area. 2015-01-29 15:33:05 +00:00
Ed Maste
7a47d65d5d Use zero register instead of immediate 0x0 in MIPS assembly
It seems GAS makes the substitution automatically, but Clang's
integrated assembler does not (yet). It fails with "invalid operand for
instruction."

Reported by:	sbruno
2015-01-29 15:30:04 +00:00
Oleksandr Tymoshenko
f100177dfb Set LCDC clock frequency to 2*148500 KHz
Minimum LCDC is 2 so clock freq shouild be 2*max_pixel_clock. Maximum pixel
clock for HDMI is 148500 (1920x1080). But AM335x can not run in this mode
due to bandwidth and clock limitations
2015-01-29 01:59:42 +00:00
Pedro F. Giffuni
0d6953ea1d Fix compile warnings for gcc-4.4.x
author	Christos Zoulas <christos@zoulas.com>
	Mon, 26 Oct 2009 12:27:43 -0500 (13:27 -0400)
committer	Christos Zoulas <christos@zoulas.com>
	Mon, 26 Oct 2009 12:27:43 -0500 (13:27 -0400)
commit	e6301006ef97d31745f9ffbb17c58cb39d18c6aa (partial)
2015-01-29 01:55:24 +00:00
Pedro F. Giffuni
f773f195ea MFV r277866
amd: Add extra check for NULL before deref.

CID:		274421
Obtained from:	NetBSD
MFC after:	4 days
2015-01-29 01:28:39 +00:00
Pedro F. Giffuni
395a48cfad Revert r277814: It will be re-merged through the vendor area. 2015-01-29 01:26:23 +00:00
Pedro F. Giffuni
d732da5406 avoid possible null pointer deref (coverity)
author	Christos Zoulas <christos@zoulas.com>
	Wed, 17 Sep 2008 15:07:20 -0500 (20:07 +0000)
committer	Christos Zoulas <christos@zoulas.com>
	Wed, 17 Sep 2008 15:07:20 -0500 (20:07 +0000)
commit	d414de481f6efe52455c19f64e911d0db34d185a
2015-01-28 23:22:42 +00:00
Pedro F. Giffuni
e925d4a747 amd: flatten the tree 2015-01-28 22:55:06 +00:00
Jilles Tjoelker
49ba8a68f0 sem_post(): Fix and document semaphore value overflow error.
The error code is per Austin Group issue #315.

I provided different wording for the manual page change.

Submitted by:	pluknet
MFC after:	1 week
2015-01-28 22:42:56 +00:00
Dimitry Andric
3bb4600164 Fix the following -Wcast-qual warnings in usr.sbin/sa/db.c:
usr.sbin/sa/db.c:82:20: error: cast from 'char const (*)[9]' to 'void *' drops const qualifier [-Werror,-Wcast-qual]
        key.data = (void*)&VERSION_KEY;
                          ^
usr.sbin/sa/db.c:178:20: error: cast from 'char const (*)[9]' to 'void *' drops const qualifier [-Werror,-Wcast-qual]
        key.data = (void*)&VERSION_KEY;
                          ^

Replace the VERSION_KEY define with a writable char array, so no const
qualifier needs to be dropped anymore.

Submitted by:	rdivacky
2015-01-28 22:22:49 +00:00
Dimitry Andric
9304cfd07c Fix multiple instances of the following clang 3.6.0 warning in ppp:
usr.sbin/ppp/command.c:2054:74: error: address of array 'arg->bundle->radius.cfg.file'
will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
      if (arg->bundle->radius.alive.interval && !arg->bundle->radius.cfg.file) {
                                                ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~

In all cases, the file field of struct radius is a char array, but the
intent was to check whether the string is empty, so add an indirection
to achieve that.  Use a similar approach for the sockname field of
struct server.
2015-01-28 21:33:49 +00:00
Dimitry Andric
3f7acdfe6e Fix the following clang 3.6.0 warnings in pciconf:
usr.sbin/pciconf/pciconf.c:237:12: error: address of array 'p->pd_name' will
always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                            (p->pd_name && *p->pd_name) ? p->pd_name :
                             ~~~^~~~~~~ ~~
usr.sbin/pciconf/pciconf.c:239:12: error: address of array 'p->pd_name' will
always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                            (p->pd_name && *p->pd_name) ? (int)p->pd_unit :
                             ~~~^~~~~~~ ~~

The pd_name field of struct pci_conf is an array, so it can never be null.
Remove the unnecessary check.
2015-01-28 21:21:35 +00:00
Jamie Gritton
464aad1407 Add allow.mount.fdescfs jail flag.
PR:		192951
Submitted by:	ruben@verweg.com
MFC after:	3 days
2015-01-28 21:08:09 +00:00
Cy Schubert
e946956c6c ipfilter 5.1.2 (vs 4.1.28 in previous releases of FreeBSD) stores IPv4
and IPv6 rules in a single table. ipf -6 -Fa will flush the whole table,
including IPv4 rules. This patch removes the redundant ipf -I -6 -Fa
statement.

PR:		188318
MFC after:	2 weeks
2015-01-28 21:01:55 +00:00
Sean Bruno
a142c86130 Check for invalid length or more than max length for the interpreter, instead
of the validity of the string pointer holding the interpreter.

Submitted by:	sson
Reviewed by:	dim
MFC after:	3 days
2015-01-28 20:22:48 +00:00
Ed Maste
272a972b88 Preserve hard & symbolic links when modifying source file
Strip is often used to modify existing files, rather than creating new
files. If the existing file has hard links or is a symbolic link, act as
if editing the file in place and preserve the links.

Reported by:	luigi
Reviewed by:	imp, rpaulo
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D1682
2015-01-28 18:37:09 +00:00
Dimitry Andric
54edb5043c Fix the following clang 3.6.0 warning in contrib/amd/hlfsd/homedir.c:
contrib/amd/hlfsd/homedir.c:497:8: error: address of array 'buf' will
always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
  if (!buf || buf[0] == '\0')
      ~^~~

In the affected function, 'buf' is declared as an array of char, so it
can never be null.  Remove the unecessary check.
2015-01-28 18:19:25 +00:00
Glen Barber
47176cacac Update release(7) to reflect renaming the 'system' target
to 'disc1'.

MFC after:	3 weeks
X-MFC-with:	r277458, r277536, r277606, r277609, r277836
Sponsored by:	The FreeBSD Foundation
2015-01-28 18:13:16 +00:00
Glen Barber
5a5f93de64 Fix a typo in a comment.
MFC after:	1 week
X-MFC-with:	r277837
Sponsored by:	The FreeBSD Foundation
2015-01-28 17:39:57 +00:00
Glen Barber
429c554fd6 Provide a description for the 'tests.txz' distribution
in the MANIFEST file.

Turn off the test suite installation by default.

Tested with:	head@r277834
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2015-01-28 17:34:27 +00:00
Glen Barber
a55e34eb28 Rename the 'system' target to 'disc1', which is specific
to the disc1.iso installer image.

Replace 'system' with 'release' in CLEANFILES, and add
'disc1' to CLEANDIRS.

Ensure the 'dvd' target depends on 'packagesystem'.

Fix 'mini-memstick.img' prerequisite, which should be the
'bootonly' target, not 'disc1' (previously 'system').

Use .TARGET as the target installation directory for the
disc1.iso and bootonly.iso images, which now expand to
'disc1' and 'bootonly' respectively, mimicking the behavior
of the 'dvd' target.

Remove '@true' from the 'release' target, and instead use
'touch ${.TARGET}' to prevent multiple iterations of
'make release' from clobbering previously-built installer
medium.

Tested with:	head@r277834
MFC after:	3 weeks
X-MFC-with:     r277458, r277536, r277606, r277609
Sponsored by:	The FreeBSD Foundation
2015-01-28 17:32:45 +00:00
Ruslan Bukin
6411d14d62 Add ARMv7 performance monitoring counters.
Differential Revision:	https://reviews.freebsd.org/D1687
Reviewed by:	rpaulo
Sponsored by:	DARPA, AFRL
2015-01-28 16:08:07 +00:00
Edward Tomasz Napierala
21cee0c5ce When there are no automounted filesystems, autounmountd(8) should wait
for filesystem event, instead of looping on a timeout.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-01-28 15:46:11 +00:00
Enji Cooper
0d972b25f6 Revert r277357 as expr has been enhanced to better detect overflow conditions,
and now the tests pass

PR: 196867
X-MFC with: r277798
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-01-28 11:38:12 +00:00
Konstantin Belousov
f40cb1c645 Update mtime for tmpfs files modified through memory mapping. Similar
to UFS, perform updates during syncer scans, which in particular means
that tmpfs now performs scan on sync.  Also, this means that a mtime
update may be delayed up to 30 seconds after the write.

The vm_object' OBJ_TMPFS_DIRTY flag for tmpfs swap object is similar
to the OBJ_MIGHTBEDIRTY flag for the vnode object, it indicates that
object could have been dirtied.  Adapt fast page fault handler and
vm_object_set_writeable_dirty() to handle OBJ_TMPFS_NODE same as
OBJT_VNODE.

Reported by:	Ronald Klop <ronald-lists@klop.ws>
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2015-01-28 10:37:23 +00:00
Konstantin Belousov
3544b0f68f tmpfs does not use UVM on FreeBSD.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2015-01-28 10:25:35 +00:00
Xin LI
63cffd61d1 MFV r255258:
Diff reduction with upstream.  The actual change was merged in r272483
already.

MFC after:	2 weeks
2015-01-28 08:56:48 +00:00
Adrian Chadd
d5d2dbef65 Cast everything to something longer than 32 bits so the sample mask
doesn't get truncated to 32 bits.

Without this, 3x3 NICs transmitting at an MCS rate whose rix (rate
index) in the rate table is > 31 end up returning errors, as the
sample rate code doesn't think the rate is set in the rate table.

Tested:

* AR9380, STA, speaking 3x3 to an AP
2015-01-28 04:44:42 +00:00
Adrian Chadd
06c746edad Print out the final_rix if there's a problem. 2015-01-28 04:42:40 +00:00
Adrian Chadd
99f46e36f1 Add a new HAL capability - required to compile the updated AR9300
HAL i have lying about.
2015-01-28 04:02:56 +00:00
Michael Tuexen
aec9ef9745 Whitespace change. 2015-01-27 21:30:24 +00:00
Pedro F. Giffuni
1c139114b6 amd: Add extra check for NULL before deref.
CID:		274421
Obtained from:	NetBSD
MFC after:	5 days
2015-01-27 20:48:05 +00:00
Pedro F. Giffuni
76c76d54f8 sed: fix pasto from previous r277802.
MFC after:	3 days
2015-01-27 19:46:19 +00:00
Xin LI
9049b13f8f Use unsigned int for index value.
Without this change a local attacker could trigger a panic by
tricking the kernel into accessing undefined kernel memory.

We would like to acknowledge Francisco Falcon from CORE Security
Technologies who discovered the issue and reported to the
FreeBSD Security Team.

More information can be found at CORE Security's advisory at:
http://www.coresecurity.com/content/freebsd-kernel-multiple-vulnerabilities

This is an errata candidate for releng/10.1 and releng/9.3.  Earlier
releases are not affected.

Reported by:	Francisco Falcon from CORE Security Technologies
Security:	CVE-2014-0998
Reviewed by:	dumbbell
MFC after:	3 days
2015-01-27 19:35:41 +00:00
Xin LI
6a58f0e913 Fix SCTP stream reset vulnerability.
We would like to acknowledge Gerasimos Dimitriadis who reported
the issue and Michael Tuexen who analyzed and provided the
fix.

Security:	FreeBSD-SA-15:03.sctp
Security:	CVE-2014-8613
Submitted by:	tuexen
2015-01-27 19:35:38 +00:00
Xin LI
38f2a43815 Fix SCTP SCTP_SS_VALUE kernel memory corruption and disclosure vulnerability.
We would like to acknowledge Clement LECIGNE from Google Security Team and
Francisco Falcon from Core Security Technologies who discovered the issue
independently and reported to the FreeBSD Security Team.

Security:	FreeBSD-SA-15:02.kmem
Security:	CVE-2014-8612
Submitted by:	tuexen
2015-01-27 19:35:36 +00:00
Pedro F. Giffuni
fc04dce059 Fix resource leak and dereference after NULL.
process.c:
Protect access against NULL.

main.c:
Prevent outfile overwrite resource leak.

CID:	271181
CID:	1006930

Obtained from:	NetBSD
MFC after:	3 days
2015-01-27 18:58:24 +00:00
Dimitry Andric
c7d7e597b4 Constify a struct savexmm pointer in pt_ucontext_to_fpreg(), to silence
a -Wcast-qual warning from clang 3.6.0.
2015-01-27 18:56:46 +00:00
Randall Stewart
cb8266e797 Fix yet another coverty warning (missing io is NULL check) and in examining that
warning I see yet another issue where we should be pclosing the io in the event
of the error and its a command (not fclose only).
2015-01-27 18:56:22 +00:00
Edward Tomasz Napierala
da8e209f33 Fix sysctl name.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-01-27 18:27:07 +00:00
Stefan Eßer
8da97f0057 Fix overflow check for multiplication:
- Add special test to detect the case of -1 * INTMAX_MIN
- Protect against elimination of the test division by the optimizer

Garrett Cooper noticed that the overflow checks were incomplete, and Bruce
Evans suggested the use of the "volatile" qualifier to counter the effect
of the undefined behaviour, when the prior multiplication caused overflow,
and he also suggested improvements to the comments.

Reviewed by:	bde
MFC after:	1 week
2015-01-27 18:04:41 +00:00
Andrey V. Elsukov
b489a49fc0 key_spdget uses key_setdumpsp() without SPTREE_RLOCK held (it uses
referenced pointer to sp). Remove SPTREE_RLOCK_ASSERT from
key_setdumpsp() to fix wrong assertion.

Reported by:	Emeric POUPON
Obtained from:	Yandex LLC
Sponsored by:	Yandex LLC
2015-01-27 17:46:55 +00:00
Andriy Gapon
85f95fffd7 hook userland threads suspend + resume into acpi suspend code
Also, split power_suspend into power_suspend and power_suspend_early.

power_suspend_early is called before the userland is frozen.
power_suspend is called after the userland is frozen.

Currently only VT switching is hooked to power_suspend_early.
This is needed because switching away from X server requires its
cooperation, so obviously X server must not be frozen when that happens.

Freezing userland during ACPI suspend is useful because not all drivers
correctly handle suspension concurrent with other activity.  This is
especially applicable to drivers ported from other operating systems
that suspend all software activity between placing drivers and hardware
into suspended state.
In particular drm2/radeon (radeonkms) depends on the described
procedure.  The driver does not have any internal synchronization
between suspension activities and processing of userland requests.

Many thanks to kib for the code that allows to freeze and thaw all
userland threads.

Note that ideally we also need to park / inhibit (non-special) kernel
threads as well to ensure that they do not call into drivers.

MFC after:	17 days
2015-01-27 17:33:18 +00:00
Andriy Gapon
6dfa4578d6 vt(4): Use power_{suspend,resume} event handlers to implement
suspend/resume

The goal is to avoid that the vt(4) resume happens before the video
display is resumed. The original patch was provided by Andriy Gapon.

This new patch registers the handlers in vt_upgrade(). This is done
once, thanks to the VDF_ASYNC flag. I abused this flag because it was
already abused by the keyboard allocation. The event handlers then call
the backend if it provides callbacks for suspend/resume.

Differential Revision:	https://reviews.freebsd.org/D1004
On behalf of:	dumbbell
MFC after:	2 weeks
2015-01-27 15:28:46 +00:00
Konstantin Belousov
cda374fe00 The sys_quotactl() contract demands that the mount point is
vfs_unbusy()ed when the cmd is Q_QUOTAON, regardless of other input
parameters or error return.

Submitted by:	Conrad Meyer
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:  https://reviews.freebsd.org/D1684
Tested by:	pho
MFC after:	1 week
2015-01-27 10:32:49 +00:00
Konstantin Belousov
3834f92359 Rewrite pmap_enter(9) man page.
In collaboration with:	alc
Differential Revision:  https://reviews.freebsd.org/D1531
Sponsored by:	The FreeBSD Foundation and EMC / Isilon Storage Division
MFC after:	1 week
2015-01-27 09:48:02 +00:00
Nathan Whitehorn
c7be335e3e Fix bug in mapppings of multiple pages exposed by updates to the VSCSI
support in QEMU. Each page of a many page mapping was getting mapped to
the same physical address, which is not the desired behavior.

MFC after:	1 week
2015-01-27 07:20:00 +00:00