kib [Fri, 8 Feb 2013 11:17:47 +0000 (11:17 +0000)]
MFC r246218:
Backup FATs were sometimes marked dirty by copying their first block
from the primary FAT, and then they were not marked clean on unmount.
Force marking them clean when appropriate.
pluknet [Thu, 7 Feb 2013 11:09:16 +0000 (11:09 +0000)]
MFC r226043 (manually):
Remove assertion against empty NFSv4 ACLs. An empty ACL is not exactly
valid - we don't allow for setting it on a file, for example - but it's
not something we should assert on.
For STABLE kernel, it changes nothing, because it's not compiled with
INVARIANTS. If it was, it would fix crashes. It also fixes an assert
in libc encountered with NFSv4 without nfsuserd(8) running.
mav [Wed, 6 Feb 2013 18:41:12 +0000 (18:41 +0000)]
MFC r242175:
Remove priority enforcement from xpt_ation(). It is not good and even not
safe in some cases to reduce CCB priority after it was scheduled with high
priority. This fixes reproducible deadlock when command sent through the
pass interface while ATA XPT recovers from command timeout.
Instead of that enforce priority at passioctl(). libcam provides no obvious
interface to specify CCB priority and so much (all?) code specifies zero
(highest) priority. This change limits pass CCBs priority to NORMAL run
level, allowing XPT to complete bus and device recovery after reset before
running any payload.
delphij [Tue, 5 Feb 2013 09:53:32 +0000 (09:53 +0000)]
MFC r243779 (marcel):
Protect against DoS attacks, such as being described in CVE-2010-2632.
The changes were derived from what has been committed to NetBSD, with
modifications. These are:
1. Preserve the existsing GLOB_LIMIT behaviour by including the number
of matches to the set of parameters to limit.
2. Change some of the limits to avoid impacting normal use cases:
GLOB_LIMIT_STRING - change from 65536 to ARG_MAX so that glob(3)
can still provide a full command line of expanded names.
GLOB_LIMIT_STAT - change from 128 to 1024 for no other reason than
that 128 feels too low (it's not a limit that impacts the
behaviour of the test program listed in CVE-2010-2632).
GLOB_LIMIT_PATH - change from 1024 to 65536 so that glob(3) can
still provide a fill command line of expanded names.
3. Protect against buffer overruns when we hit the GLOB_LIMIT_STAT or
GLOB_LIMIT_READDIR limits. We append SEP and EOS to pathend in
those cases. Return GLOB_ABORTED instead of GLOB_NOSPACE when we
would otherwise overrun the buffer.
This change also modifies the existing behaviour of glob(3) in case
GLOB_LIMIT is specifies by limiting the *new* matches and not all
matches. This is an important distinction when GLOB_APPEND is set or
when the caller uses a non-zero gl_offs. Previously pre-existing
matches or the value of gl_offs would be counted in the number of
matches even though the man page states that glob(3) would return
GLOB_NOSPACE when gl_matchc or more matches were found.
The limits that cannot be circumvented are GLOB_LIMIT_STRING and
GLOB_LIMIT_PATH all others can be crossed by simply calling glob(3)
again and with GLOB_APPEND set.
The entire description above applies only when GLOB_LIMIT has been
specified of course. No limits apply when this flag isn't set!
delphij [Tue, 5 Feb 2013 09:50:33 +0000 (09:50 +0000)]
MFC r243758 (marcel):
In globextend() when the pathv vector cannot be (re-)allocated, don't
free and clear the gl_pathv pointer in the glob_t structure. Such
breaks the invariant of the glob_t structure, as stated in the comment
right in front of the globextend() function. If gl_pathv was non-NULL,
then gl_pathc was > 0. Making gl_pathv a NULL pointer without also
setting gl_pathc to 0 is wrong.
Since we otherwise don't free the memory associated with a glob_t in
error cases, it's unlikely that this change will cause a memory leak
that wasn't already there to begin with. Callers of glob(3) must
call globfree(3) irrespective of whether glob(3) returned an error
or not.
MFC r243759 (marcel):
In globextend(), take advantage of the fact that realloc(NULL, size) is
equivalent to malloc(size). This eliminates the conditional expression
used for calling either realloc() or malloc() when realloc() will do
all the time.
eadler [Sat, 2 Feb 2013 23:22:39 +0000 (23:22 +0000)]
MFC r244122:
Remove 'dangerous' instructions from the example make.conf.
Clarify when and why these might be used and that this isn't a supported
configuration.
pluknet [Fri, 1 Feb 2013 15:48:29 +0000 (15:48 +0000)]
MFC r200596 (by imp):
Add NO_KERNELOBJ flag, similar to NO_KERNEL{CONFIG,DEPEND,CLEAN},
which disables doing a make obj. Use it when you know it will work
only. KERNFAST now implies NO_KERNELOBJ, since you don't need to keep
doing obj when doing incremental kernel builds.
delphij [Fri, 1 Feb 2013 07:38:26 +0000 (07:38 +0000)]
MFC r244568:
- Reduce buffer size from LINE_MAX to PATH_MAX, there is no point to store
path longer than this.
- Fix an unreached case of check against sizeof buf, which in turn leads
to an off-by-one nul byte write on the stack. The original condition
can never be satisfied because the passed boundary is the maximum value
that can be returned, so code was harmless.
mav [Thu, 31 Jan 2013 22:31:25 +0000 (22:31 +0000)]
MFC r245423, r245425, r245433:
- Print some more metadata fields.
- Small cosmetic tuning of the IRRT status constants.
- Keep value of orig_config_id metadata field. Windows driver writes there
previous value of config_id when it is changed in some cases. I guess it
may be used do avoid some split-brain conditions.
mav [Thu, 31 Jan 2013 22:27:31 +0000 (22:27 +0000)]
MFC r245400:
Windows driver writes relative volume IDs to metadata field. Use that value
as a hint for raid/rX device number to make it persistent across reboots.
mav [Thu, 31 Jan 2013 22:24:46 +0000 (22:24 +0000)]
MFC r245398:
- Add checks for Intel metadata version and attributes. Ignore disks with
unsupported metadata types like Intel Smart Response to not corrupt them.
- Improve setting of these things during metadata writing to protect from
incapable BIOS'es and other implementations.
mav [Thu, 31 Jan 2013 22:22:22 +0000 (22:22 +0000)]
MFC r245363:
Improve support for disabled disks. If disabled disk disconnected and then
reconnected back, leave it as disabled. If new disk inserted instead of
disabled, rebuild it and leave as enabled.
mav [Thu, 31 Jan 2013 22:19:39 +0000 (22:19 +0000)]
MFC r245341:
Windows handles INIT and VERIFY as array-wide and it doesn't specify which
disks should be rebuilt. Our rebuild code is same time disk-centric. To
handle this situation properly check all disks for RBLD flags, and if no
disk specified try rebuild/resync all of them except newly inserted.
mav [Thu, 31 Jan 2013 22:16:52 +0000 (22:16 +0000)]
MFC r245338:
Implement migration from single disk to RAID1/IRRT for Intel metadata.
Windows driver uses such migration when it creates new arrays. While GEOM
RAID has no mechanism to implement migration in general case, this specifc
case still can be handled easily via degraded RAID1 creation followed by
regular rebuild.
mav [Thu, 31 Jan 2013 22:13:36 +0000 (22:13 +0000)]
MFC r245326:
Add basic support for Intel Rapid Recover Technology (Intel RRT).
It is alike to RAID1, but with dedicating master and recovery disks and
providing manual control over synchronization. It allows to use recovery
disk as snapshot of the master disk from the time of the last sync.
This implementation is not functionaly complete comparing to Windows,
but it is better then silent conversion to RAID1 on first boot.
mav [Thu, 31 Jan 2013 21:26:02 +0000 (21:26 +0000)]
MFC r245519:
Recalculate volume size only for real CONCATs. For SINGLE trust volume
size given by metadata, as it should be correct and in some cases can be
smaller then subdisk size.
sbruno [Thu, 31 Jan 2013 20:32:11 +0000 (20:32 +0000)]
MFC r245459
Satisfy the intent of kern/151564: [ciss] ciss(4) should increase
CISS_MAX_LOGICAL to 107
Submitter wanted to increase the number of logical disks supported by ciss(4)
by simply raising the CISS_MAX_LOGICAL value even higher. Instead, consult
the documentation for the raid controller (OPENCISS) and poke the controller
bits to ask it for how many logical/physical disks it can handle.
Revert svn R242089 that raised CISS_MAX_LOGICAL to 64 for all controllers.
For older controllers that don't support this mechanism, fallback to the old
value of 16 logical disks. Tested on P420, P410, P400 and 6i model ciss(4)
controllers.
This should will be MFC'd back to stable/9 stable/8 and stable/7 after the MFC
period.
mav [Tue, 29 Jan 2013 17:47:07 +0000 (17:47 +0000)]
MFC r245444:
Alike to r242314 for GRAID make GRAID3 more aggressive in marking volumes
as clean on shutdown and move that action from shutdown_pre_sync stage to
shutdown_post_sync to avoid extra flapping.
ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID3
to shutdown gracefully. To handle that, mark volume as clean just when
shutdown time comes and there are no active writes.
mav [Tue, 29 Jan 2013 17:22:53 +0000 (17:22 +0000)]
MFC r245443:
Alike to r242314 for GRAID make GMIRROR more aggressive in marking volumes
as clean on shutdown and move that action from shutdown_pre_sync stage to
shutdown_post_sync to avoid extra flapping.
ZFS tends to not close devices on shutdown, that doesn't allow GEOM MIRROR
to shutdown gracefully. To handle that, mark volume as clean just when
shutdown time comes and there are no active writes.
marius [Mon, 28 Jan 2013 00:31:55 +0000 (00:31 +0000)]
MFC: r245923
- Check the return value of taskqueue_start_threads().
- At least the Saturn chips of 501-6738 cards need a delay after freezing
the external GMII pins before the internal PHY is accessible again. So
wait a bit after (un)freezing these. Also don't touch the other bits of
that configuration register. [1]
- Take advantage of nitems().
marius [Sun, 27 Jan 2013 23:21:51 +0000 (23:21 +0000)]
MFC: r245850
Revert the part of r239864 (MFC'ed to stable/8 in r241690) which removed
obtaining the SMP mutex around reading registers from other CPUs. As it
turns out, the hardware doesn't really like concurrent IPI'ing causing
adverse effects. Also the thought deadlock when using this spin lock here
and the targeted CPU(s) are also holding or in case of nested locks can't
actually happen. This is due to the fact that on sparc64, spinlock_enter()
only raises the PIL but doesn't disable interrupts completely. Thus direct
cross calls as used for the register reading (and all other MD IPI needs)
still will be executed by the targeted CPU(s) in that case.
marius [Sun, 27 Jan 2013 23:02:35 +0000 (23:02 +0000)]
MFC: r244991
- Replace partially incorrect function names in panic(9) strings with
__func__ and add some missing ones.
- Remove a stale comment.
- Remove unused NUM_ELEMENTS macro.
- Remove extra empty lines.
- Use DEVMETHOD_END.
- Use NULL rather than 0 for pointers.
marius [Sun, 27 Jan 2013 23:00:01 +0000 (23:00 +0000)]
MFC: r244990 (partial)
- Replace incorrect function names in printf(9) strings with __func__.
- Make xctrl_shutdown_reasons table const.
- Use nitems() rather than rolling an own version.
- Use DEVMETHOD_END.
- Use NULL rather than 0 for pointers.
marius [Sun, 27 Jan 2013 16:49:13 +0000 (16:49 +0000)]
MFC: 241780
- Give PIL_PREEMPT the lowest priority just above low/stray interrupts.
The reason for this is that the SPARC v9 architecture allows nested
interrupts of higher priority/level than that of the current interrupt
to occur (and we can't just entirely bypass this model, also, at least
for tick interrupts, this also wouldn't be wise). However, when a
preemption interrupt interrupts another interrupt of lower priority,
f.e. PIL_ITHREAD, and that one in turn is nested by a third interrupt,
f.e. PIL_TICK, with SCHED_ULE the execution of interrupts higher than
PIL_PREEMPT may be migrated to another CPU. In particular, tl1_ret(),
which is responsible for restoring the state of the CPU prior to entry
to the interrupt based on the (also migrated) trap frame, then is run
on a CPU which actually didn't receive the interrupt in question,
causing an inappropriate processor interrupt level to be "restored".
In turn, this causes interrupts of the first level, i.e. PIL_ITHREAD
in the above scenario, to be blocked on the target of the migration
until the correct PIL happens to be restored again on that CPU again.
Making PIL_PREEMPT the lowest real priority, this effectively prevents
this scenario from happening, as preemption interrupts no longer can
interrupt any other interrupt besides stray ones (which is no issue).
Thanks to attilio@ and especially mav@ for helping me to understand
this problem at the 201208DevSummit.
- Give PIL_STOP (which is also used for IPI_STOP_HARD, given that there's
no real equivalent to NMIs on SPARC v9) the highest possible priority
just below the hardwired PIL_TICK, so it has a chance to interrupt
more things.
delphij [Sat, 26 Jan 2013 05:25:32 +0000 (05:25 +0000)]
MFC r245768:
- Don't include date and time the driver is built, this is useful for
generating binary diffs.
- Constify a few strings used in the driver.
- Style changes to make the driver compile with default clang settings.
yongari [Thu, 24 Jan 2013 02:20:25 +0000 (02:20 +0000)]
MFC r244482:
Recognize 5720S PHY and treat it as 5708S PHY.
Unfortunately 5720S uses 5709S PHY id so add a hack to detect 5720S
PHY by checking parent device name. 5720S PHY does not support 2500SX.
gjb [Thu, 24 Jan 2013 01:41:11 +0000 (01:41 +0000)]
MFC r223148, r240252, r241541, r241543, r245756:
r223148: (ru)
- Document all trees that support CVS_UPDATE.
- Document all trees that support SUP_UPDATE.
- Document SVN_UPDATE.
- Document NO_WWWUPDATE.
- make.conf(5) mistakenly said that *SUPFILE* had defaults.
- Add an example entry for WWWSUPFILE.
r240252: (eadler)
- Remove documentation and www cvsup files as they are no longer
useful with the switch to subversion.
r241541: (joel)
- Minor mdoc improvements. Also remove unnecessary csup reference.
r241543: (eadler)
- Bump .Dd
r245756:
- Mark SUP_UPDATE as deprecated in make.conf(5), providing
instructions to use SVN_UPDATE or freebsd-update(8).
- While here, remove bogus NO_WWWUPDATE.
jhb [Wed, 23 Jan 2013 18:19:50 +0000 (18:19 +0000)]
MFC 229435:
Add special loader environment variables 'comconsole_port' and
'comconsole_pcidev'. The former allows to set the base address of the
serial console i/o port. The later takes the string of the format
'bus:device:function:[bar]' as a value and uses the serial port attached
as PCI device at the specified location for console.
Both variants pass 'hw.uart.console' variable to the uart driver to
properly hand-over the kernel console.
Change allows to use ISA serial ports other than COM1 for the
loader/kernel console without loader recompilation. Also, you can use
PCI-attached port as the console, e.g. Intel AMT serial pseudo-port on
some motherboards based on Q67 chipset.
mav [Tue, 22 Jan 2013 17:19:44 +0000 (17:19 +0000)]
MFC r244146:
Add IDs for SATA controllers on AMD Hudson-2 series chipsets.
I am not exactly sure about the naming due to lack of specs on AMD site,
but it is better to have some identification then none at all.
mav [Tue, 22 Jan 2013 17:18:34 +0000 (17:18 +0000)]
MFC r241402:
Add checks for ata_sata_scr_read() return statuses. It is mostly to silence
Clang Static Analyzer warnings as errors there are usually unlikely.
hselasky [Mon, 21 Jan 2013 07:41:27 +0000 (07:41 +0000)]
MFC r245132 and r245175:
Optimise the XHCI interrupt handling.
This patch will save CPU time when the XHCI interrupt is
shared with other devices.
Only check event rings when interrupt bits are set.
Otherwise would indicate hiding possible hardware fault(s).
hselasky [Mon, 21 Jan 2013 07:39:16 +0000 (07:39 +0000)]
MFC r243780:
- Add support for Etron EJ168 USB 3.0 Host Controllers.
This brand of controllers expects that the number of
contexts specified in the input slot context points
to an active endpoint context, else it refuses to
operate.
bapt [Tue, 15 Jan 2013 09:17:07 +0000 (09:17 +0000)]
MFC r244553,244594,244608,244639
In preparation for making 'pkg -N' the one true method of determining
whether a system has been configured to use pkgng, cause /usr/sbin/pkg
recognise a -N option and exit with a failure code when the pkg port
is not installed
bapt [Sun, 13 Jan 2013 22:36:12 +0000 (22:36 +0000)]
MFC: r243883
if PACKAGESITE url scheme is not 'file://', always try to revolv SRV records and
use them if any. It allows the bootstrap to use directly pkg.FreeBSD.org instead
of pkgbeta.FreeBSD.org
markj [Sun, 13 Jan 2013 04:14:30 +0000 (04:14 +0000)]
MFC r244995 r244996 r244997.
MFC r244995:
Fix a typo in an error message.
MFC r244996:
Have -n imply -r, since dry-run mode obviously doesn't require root
privileges.
MFC r244997:
Make sure to update the mtime of a logfile after archiving it. This
ensures that the next rotation happens at the correct time when using
interval-based rotations.
markj [Sun, 13 Jan 2013 04:13:14 +0000 (04:13 +0000)]
MFC r244719:
Add the NO_SYNC_CACHE quirk for all Apple USB MSC devices, as they
typically do not handle the SYNCHRONIZE_CACHE command - they either
return an error or the firmware enters a reset loop.
wblock [Thu, 10 Jan 2013 23:39:28 +0000 (23:39 +0000)]
MFC r245012:
Document the output of the show command. Modified version of patch
provided by Bas Smeelen <b.smeelen@ose.nl>. Use of 'gpart list'
suggested by by Andrey V. Elsukov <ae@FreeBSD.org>.
yongari [Tue, 8 Jan 2013 05:35:18 +0000 (05:35 +0000)]
MFC r244341:
Make sure to stop both TX and RX MACs in ale_stop_mac(). Previously
it used to stop TX MAC only such that MAC reconfiguration after
getting a link didn't work as expected.
rmacklem [Sun, 6 Jan 2013 01:17:58 +0000 (01:17 +0000)]
MFC: r244331
Fix the gssd daemon so that it uses syslog() to report
an error instead of calling err() when it is daemonized,
so that the error gets logged.
rmacklem [Sun, 6 Jan 2013 01:11:45 +0000 (01:11 +0000)]
MFC: r244226
The group list for a non-default export entry (a host/subnet one)
was being copied from the wrong place. This patch fixes that.
This could cause access failures for mapped users, when the group
permissions were needed.
markj [Sat, 5 Jan 2013 22:55:34 +0000 (22:55 +0000)]
- Add IFT_L2VLAN (vlan(4)) support.
- Add a -P option to support PID files. When -a is specified
/var/run/rarpd.pid is used by default, and when an interface is
specified /var/run/rarpd.<ifname>.pid is used by default.
pfg [Fri, 4 Jan 2013 04:03:39 +0000 (04:03 +0000)]
MFC r244941:
libedit: bind the correct command when using "bind -k".
"ed-argument-digit" (i. e. command 0) was incorrectly used
instead.
This bug comes from the original sources imported in 1994
and has been confirmed in upstream NetBSD.
Reported by: Yamagi Burmeister
Submitted by: Christoph Mallon
pfg [Fri, 4 Jan 2013 03:54:22 +0000 (03:54 +0000)]
MFC 244776, 244792:
gcc: avoid generating negative values to DW_AT_byte_size.
There is a bug in gcc (GCC/35998) where dwarf reports
sizes of unsigned -1 (0xffffffff).
On NetBSD this generated a faulty CTF entry which then
caused a segfault in ctfmerge. The issue was worked
around in NetBSD's Dtrace but since the issue originated
in gcc, it seems reasonable to fix it here.
Thanks to Christoph Mallon for pointing out a correct fix.
wblock [Thu, 3 Jan 2013 21:35:25 +0000 (21:35 +0000)]
MFC r242697,r242704:
r242697:
Add devd.conf(5) and devd(8) to SEE ALSO xrefs. Give users a pointer to
seemingly mysterious actions that are not done by ifconfig itself, but
by devd triggering on events caused by ifconfig.
r242704:
Remove fifteen-year-old notes on media selection (suggested by simon@).
Add commas after "e.g." and "i.e.".