]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agoOn-the-fly changes to the interrupt coalescing timer should apply to the
np [Thu, 4 Jul 2013 20:17:39 +0000 (20:17 +0000)]
On-the-fly changes to the interrupt coalescing timer should apply to the
TOE rx queues too.

MFC after: 1 day

10 years agoAdd support for ePWM submodule of PWMSS
gonzo [Thu, 4 Jul 2013 20:13:22 +0000 (20:13 +0000)]
Add support for ePWM submodule of PWMSS

ePWM is controlled by sysctl nodes dev.am335x_pwm.N.period,
dev.am335x_pwm.N.dutyA and dev.am335x_pwm.N.dutyB that controls
PWM period and duty cycles for channels A and B respectively.

Period and duty cycle are measured in clock ticks. Default
clock frequency for AM335x PWM subsystem is 100MHz

10 years agoImplement $probe_only for the media access modules. sysinstall(8) was
dteske [Thu, 4 Jul 2013 20:12:12 +0000 (20:12 +0000)]
Implement $probe_only for the media access modules. sysinstall(8) was
allowed to ignore the probe_only argument of its member functions solely
because in the C language, the file accessor methods open and return a file
descriptor and reading of the data is optional. In shell, the file accessor
methods return data on stdout and that data should not be ignored (large
files could block execution).

So, we must adhere to the probe_only flags and in some cases (in the case of
FTP, for example) change the `get' strategy to simply test existence and
return an appropriate status.

This was required because the up-coming package management stuff makes heavy
use of the probe_only argument to try different package suffixes. Every
media access module must implement $probe_only for the `get' accessor.

10 years agoPull in r185594 from llvm trunk:
dim [Thu, 4 Jul 2013 20:10:33 +0000 (20:10 +0000)]
Pull in r185594 from llvm trunk:

  Add MachineBasicBlock::addLiveIn().

  This function adds a live-in physical register to an MBB and ensures
  that it is copied to a virtual register immediately.

Pull in r185615 from llvm trunk:

  Live-in copies go *after* EH_LABELs.

  This will soon be tested by exception handling working at all.

Pull in r185617 from llvm trunk:

  Simplify landing pad lowering.

  Stop using the ISD::EXCEPTIONADDR and ISD::EHSELECTION when lowering
  landing pad arguments. These nodes were previously legalized into
  CopyFromReg nodes, but that never worked properly because the
  CopyFromReg node weren't guaranteed to be  scheduled at the top of the
  basic block.

  This meant the exception pointer and selector registers could be
  clobbered before being copied to a virtual register.

  This patch copies the two physical registers to virtual registers at
  the beginning of the basic block, and lowers the landingpad instruction
  directly to two CopyFromReg nodes reading the *virtual* registers. This
  is safe because virtual registers don't get clobbered.

  A future patch will remove the ISD::EXCEPTIONADDR and ISD::EHSELECTION
  nodes.

Together, these changes fix llvm PR 16038 ('qt4 webcore file results in
"Bad machine code: Using an undefined physical register"'), and should
make it possible again to compile the www/qt4-webkit port again on the
i386 arch, without using a CPUTYPE=i686 or higher setting.

10 years agoAdd nodes for PWMSS1 and PWMSS2
gonzo [Thu, 4 Jul 2013 20:08:42 +0000 (20:08 +0000)]
Add nodes for PWMSS1 and PWMSS2

10 years agoWhen processing an incoming ABORT, SHUTDOWN_COMPLETE or ERROR (NAT related)
tuexen [Thu, 4 Jul 2013 19:47:46 +0000 (19:47 +0000)]
When processing an incoming ABORT, SHUTDOWN_COMPLETE or ERROR (NAT related)
chunk, take always the T-bit into account, when checking the verification
tag.

MFC after: 3 days

10 years agoEnable the station-side power management flag.
adrian [Thu, 4 Jul 2013 19:45:34 +0000 (19:45 +0000)]
Enable the station-side power management flag.

It's not enabled by default in net80211 so this is a no-op unless
if you enable it (ifconfig wlan0 powersave).

Tested:

* iwn0: <Intel WiFi Link 5100> mem 0xf4300000-0xf4301fff irq 17 at device 0.0 on pci3

TODO:

* .. test on all the other NICs
* See if I have to disable it during scan and such
* Make it configurable live, rather than only after it's done its initial
  receive calibration.

10 years agoPay attention to TCP_NODELAY when it's set/unset after the connection
np [Thu, 4 Jul 2013 19:44:30 +0000 (19:44 +0000)]
Pay attention to TCP_NODELAY when it's set/unset after the connection
is established.

MFC after: 1 day

10 years agoRing the egress queue's doorbell as soon as there are 8 or more
np [Thu, 4 Jul 2013 19:15:41 +0000 (19:15 +0000)]
Ring the egress queue's doorbell as soon as there are 8 or more
descriptors ready to be processed.

MFC after: 1 day

10 years agoThe tvp vnode on rename is usually unlinked. Drop the cached null
kib [Thu, 4 Jul 2013 19:01:18 +0000 (19:01 +0000)]
The tvp vnode on rename is usually unlinked.  Drop the cached null
vnode for tvp to allow the free of the lower vnode, if needed.

PR: kern/180236
Tested by: smh
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoWhitespace fixes: remove tabs on blank links, spaces following content,
wblock [Thu, 4 Jul 2013 18:59:58 +0000 (18:59 +0000)]
Whitespace fixes: remove tabs on blank links, spaces following content,
tabs after spaces.

Reviewed by: gjb
MFC after: 1 week

11 years agoThe T5 allows the driver to specify the ISS. Do so; use the ISS picked
np [Thu, 4 Jul 2013 18:41:21 +0000 (18:41 +0000)]
The T5 allows the driver to specify the ISS.  Do so; use the ISS picked
by the kernel.

MFC after: 1 day

11 years agoIn r227207, to fix the issue with possible NULL inp_socket pointer
trociny [Thu, 4 Jul 2013 18:38:00 +0000 (18:38 +0000)]
In r227207, to fix the issue with possible NULL inp_socket pointer
dereferencing, when checking for SO_REUSEPORT option (and SO_REUSEADDR
for multicast), INP_REUSEPORT flag was introduced to cache the socket
option.  It was decided then that one flag would be enough to cache
both SO_REUSEPORT and SO_REUSEADDR: when processing SO_REUSEADDR
setsockopt(2), it was checked if it was called for a multicast address
and INP_REUSEPORT was set accordingly.

Unfortunately that approach does not work when setsockopt(2) is called
before binding to a multicast address: the multicast check fails and
INP_REUSEPORT is not set.

Fix this by adding INP_REUSEADDR flag to unconditionally cache
SO_REUSEADDR.

PR: 179901
Submitted by: Michael Gmelin freebsd grem.de (initial version)
Reviewed by: rwatson
MFC after: 1 week

11 years agoMerge virtio_scsi change from projects/virtio
bryanv [Thu, 4 Jul 2013 18:00:27 +0000 (18:00 +0000)]
Merge virtio_scsi change from projects/virtio

r252680:
    Fix SIM lock not owned panic

    The CAM locking requirements of registering an async
    callback has changed so the SIM lock must be held. Remove
    code that explicitly dropped the lock around the register.

    Also return CAM_SEL_TIMEOUT instead of CAM_TID_INVALID
    for bad targets to avoid a lot console spam during bus
    scans.

MFC after: 1 month

11 years agoMerge virtio_pci changes from projects/virtio
bryanv [Thu, 4 Jul 2013 17:59:09 +0000 (17:59 +0000)]
Merge virtio_pci changes from projects/virtio

This commit is primarily a significant cleanup to the interrupt
allocation code that had gotten a bit jumbled from having to
support per-vq MSIX, shared MSIX, MSI, and legacy style interrupts.

Contains projects/virtio commits:

r246064:
    virtio_pci: Rewrite allocation of interrupts
r246065:
    virtio_pci: Remove spaces before a tab
r246066:
    virtio_pci: Dynamically allocate the virtqueue array
r246304:
    virtio_pci: Clean up after failed virtqueue alloc attempt
r246305:
    virtio_pci: Move no interrupt check into the PCI interrupt handlers
r246308:
    virtio_pci: Remove unused variable

MFC after: 1 month

11 years agoMerge virtio changes from projects/virtio
bryanv [Thu, 4 Jul 2013 17:57:26 +0000 (17:57 +0000)]
Merge virtio changes from projects/virtio

Contains projects/virtio commits:

r245738:
    virtio: Minor man page tweaks
r246060:
    virtio: Cleanup feature description printing
r246306:
    virtio: Remove old debugging flag
r247238:
    virtio: Remove PRIx64 macros from format strings
r247239:
    virtio: Constify some fields
r247240:
    virtio: Minor code simplifications
r249962:
    virtio: Update to my freebsd.org email address

MFC after: 1 month

11 years agoMerge vtnet changes from projects/virtio
bryanv [Thu, 4 Jul 2013 17:55:58 +0000 (17:55 +0000)]
Merge vtnet changes from projects/virtio

Minor changes to the network driver. A multiqueue driver that is
a significant rewrite will be in merged shortly.

Contains projects/virtio commits:

r246058:
    vtnet: Move an mbuf ASSERT to the calling function
r246059:
    vtnet: Tweak ASSERT message

MFC after: 1 month

11 years ago- Read all TP parameters in one place.
np [Thu, 4 Jul 2013 17:55:52 +0000 (17:55 +0000)]
- Read all TP parameters in one place.
- Read the filter mode, calculate various shifts, and use them
  properly during active open (in select_ntuple).

MFC after: 1 day

11 years agoMerge virtio_balloon changes from projects/virtio
bryanv [Thu, 4 Jul 2013 17:54:46 +0000 (17:54 +0000)]
Merge virtio_balloon changes from projects/virtio

Contains projects/virtio commits:

r245717:
    virtio_balloon: Make the softc lock a regular mutex
r245718:
    virtio_balloon: Remove two unuseful ASSERTs
r245719:
    virtio_balloon: More verbose ASSERT messages
r245720:
    virtio_balloon: Simplify lowmem handling in vtballoon_inflate()
r252530:
    virtio_balloon: Use just a kthread instead of dedciated kproc
r252568:
    virtio_balloon: Need to use kthread_exit() after r252530

MFC after: 1 month

11 years agoMerge several virtio_blk changes from projects/virtio
bryanv [Thu, 4 Jul 2013 17:53:02 +0000 (17:53 +0000)]
Merge several virtio_blk changes from projects/virtio

The notable changes of this commit are support for disk resizing
and chases updates to the spec regarding write caching.

Contains projects/virtio commits:

r245713:
    virtio_blk: Replace __FUNCTION__ with __func__
r245714:
    virtio_blk: Use more consistent mutex name
r245715:
    virtio_blk: Print device name too if failed to reinit during dump
r245716:
    virtio_blk: Remove an unuseful ASSERT
r245723:
    virtio_blk: Record the vendor and device information
r245724:
    virtio_blk: Add resize support
r245726:
    virtio_blk: More verbose ASSERT messages
r245730:
    virtio_blk: Tweak resize announcement message
r246061:
    virtio_blk: Do not always read entire config
r246062:
    virtio_blk: Use topology to set the stripe size/offset
r246307:
    virtio_blk: Correct stripe offset calculation
r246063:
    virtio_blk: Add support for write cache enable feature
r246303:
    virtio_blk: Expand a comment
r252529:
    virtio_blk: Improve write cache handling
r252681:
    virtio_blk: Remove unneeded curly braces

MFC after: 1 month

11 years agoConvert VirtIO to use ithreads instead of taskqueues
bryanv [Thu, 4 Jul 2013 17:50:11 +0000 (17:50 +0000)]
Convert VirtIO to use ithreads instead of taskqueues

Contains projects/virtio commits:

r245709:
    Each VirtIO device was scheduling its own taskqueue(9) to do the
    off-level interrupt handling. ithreads(9) is the more nature way
    to do this. The primary motivation for this work to better support
    network multiqueue.
r245710:
    virtio: Change virtqueue intr handlers to return void
r245711:
    virtio_blk: Remove interrupt taskqueue
r245721:
    vtnet: Remove interrupt taskqueue
r245722:
    virtio_scsi: Remove interrupt taskqueue
r245747:
    vtnet: Remove taskqueue fields missed in r245721

MFC after: 1 month

11 years agoStyle fix noted by bde@
ache [Thu, 4 Jul 2013 12:35:39 +0000 (12:35 +0000)]
Style fix noted by bde@

11 years agoFix dhclient for interfaces that are down. The discover_interfaces() function
pjd [Thu, 4 Jul 2013 12:27:10 +0000 (12:27 +0000)]
Fix dhclient for interfaces that are down. The discover_interfaces() function
that looks for interface skips interfaces that are not UP. We need to call
dhclient-script PREINIT before we call discover_interfaces(), so the script has
a chance to bring the interface UP.

Reported by: alfred

11 years agoPut the power modes in a list to make them easier to find.
wblock [Thu, 4 Jul 2013 12:24:39 +0000 (12:24 +0000)]
Put the power modes in a list to make them easier to find.

Reviewed by: joel
MFC after: 1 week

11 years agoRemove redundant clearing of the PGA_WRITEABLE flag in
gber [Thu, 4 Jul 2013 10:40:24 +0000 (10:40 +0000)]
Remove redundant clearing of the PGA_WRITEABLE flag in
pmap_remove_all()

This flag should already be cleared by pmap_nuke_pv()

Submitted by:   Zbigniew Bodek <zbb@semihalf.com>
Sponsored by:   The FreeBSD Foundation, Semihalf

11 years agoFix modified bit emulation for ARMv6/v7
gber [Thu, 4 Jul 2013 10:38:14 +0000 (10:38 +0000)]
Fix modified bit emulation for ARMv6/v7

When doing pmap_enter_locked(), enable write permission only when access
type indicates attempt to write. Otherwise, leave the page read only but
mark it writable in pv_flags.

This will result in:
1. Marking page writable during pmap_enter() but only when ensured that it
   will be written right away so that we will not get redundant permissions
   fault on write attempt.
2. Keeping page read only when it is permitted to be written but there was
   no actual write attempt. Hence, we will get permissions fault on write
   access and mark page writable in pmap_fault_fixup() what will indicate
   modification status.

Submitted by:   Zbigniew Bodek <zbb@semihalf.com>
Sponsored by:   The FreeBSD Foundation, Semihalf

11 years agoOops - fix bad hint numbering for the ART section.
adrian [Thu, 4 Jul 2013 08:42:20 +0000 (08:42 +0000)]
Oops - fix bad hint numbering for the ART section.

11 years agoAdd in a configuration file and hints for the Engenius ENH-200.
adrian [Thu, 4 Jul 2013 08:13:14 +0000 (08:13 +0000)]
Add in a configuration file and hints for the Engenius ENH-200.

This is an AR7240 based device with an AR9285 on-board.

I've tested the initial boot and wifi support; however at the moment
the ethernet switch driver doesn't seem to be picking up carrier on the
active ethernet port. Basic flood pinging works however, so I think
we're on the right track.

Thank you to Adrian Woodley <adrian@diskworld.com.au> for purchasing me
one of these devices to bootstrap FreeBSD-HEAD on.

11 years agoAdd the missing link back to the EEPROM firmware name.
adrian [Thu, 4 Jul 2013 08:09:54 +0000 (08:09 +0000)]
Add the missing link back to the EEPROM firmware name.

11 years agoFall back to sha512 if passwd_format is not set.
des [Thu, 4 Jul 2013 07:59:11 +0000 (07:59 +0000)]
Fall back to sha512 if passwd_format is not set.

MFC after: 3 days

11 years agowpa_supplicant should be able to reassociate when resuming, so remove a
rpaulo [Thu, 4 Jul 2013 07:32:40 +0000 (07:32 +0000)]
wpa_supplicant should be able to reassociate when resuming, so remove a
comment saying it can't.

11 years agoMake it little bit more C++ friendly. This explicit casting fixes some
jkim [Thu, 4 Jul 2013 05:58:53 +0000 (05:58 +0000)]
Make it little bit more C++ friendly.  This explicit casting fixes some
ports, emulators/virtualbox-ose and sysutils/smartmontools for example.

11 years agoThe change in r236456 (atomic_store_rel not locked) exposed a bug
alfred [Thu, 4 Jul 2013 05:53:05 +0000 (05:53 +0000)]
The change in r236456 (atomic_store_rel not locked) exposed a bug
in the ithread code where we could lose ithread interrupts if
intr_event_schedule_thread() is called while the ithread is already
running.  Effectively memory writes could be ordered incorrectly
such that the unatomic write of 0 to ithd->it_need (in ithread_loop)
could be delayed until after it was set to be triggered again by
intr_event_schedule_thread().

This was particularly a big problem for CAM because CAM optimizes
scheduling of ithreads such that it only signals camisr() when it
queues to an empty queue.  This means that additional completion
events would not unstick CAM and quickly lead to a complete lockup
of the CAM stack.

To fix this use atomics in all places where ithd->it_need is accessed.

Submitted by: delphij, mav
Obtained from: TrueOS, iXsystems
MFC After: 1 week

11 years agoSupport an optional "mac=" parameter to virtio-net config, to allow
grehan [Thu, 4 Jul 2013 05:35:56 +0000 (05:35 +0000)]
Support an optional "mac=" parameter to virtio-net config, to allow
users to set the MAC address for a device.

Clean up some obsolete code in pci_virtio_net.c

Allow an error return from a PCI device emulation's init routine
to be propagated all the way back to the top-level and result in
the process exiting.

Submitted by: Dinakar Medavaram    dinnu sun at gmail (original version)

11 years agoRemove unnecessary cast to pid_t.
kevlo [Thu, 4 Jul 2013 03:24:58 +0000 (03:24 +0000)]
Remove unnecessary cast to pid_t.

11 years ago- add myself to the committers list and add adrian as my mentor
loos [Thu, 4 Jul 2013 01:48:55 +0000 (01:48 +0000)]
- add myself to the committers list and add adrian as my mentor

Approved by: adrian (mentor)

11 years agoA problem with the old NFS client where large writes to large files
rmacklem [Thu, 4 Jul 2013 00:54:23 +0000 (00:54 +0000)]
A problem with the old NFS client where large writes to large files
would sometimes result in a corrupted file was reported via email.
This problem appears to have been caused by r251719 (reverting
r251719 fixed the problem). Although I have not been able to
reproduce this problem, I suspect it is caused by another thread
increasing np->n_size after the mtx_unlock(&np->n_mtx) but before
the vnode_pager_setsize() call. Since the np->n_mtx mutex serializes
updates to np->n_size, doing the vnode_pager_setsize() with the
mutex locked appears to avoid the problem.
Unfortunately, vnode_pager_setsize() where the new size is smaller,
cannot be called with a mutex held.
This patch returns the semantics to be close to pre-r251719 such that the
call to the vnode_pager_setsize() is only delayed until after the mutex is
unlocked when np->n_size is shrinking. Since the file is growing
when being written, I believe this will fix the corruption.

Reported by: David G. Lawrence (dg@dglawrence.com)
Tested by: David G. Lawrence (pending, to happen soon)
Reviewed by: kib
MFC after: 1 week

11 years agoFix printf argument mismatch reported by gcc on i386.
jimharris [Thu, 4 Jul 2013 00:26:24 +0000 (00:26 +0000)]
Fix printf argument mismatch reported by gcc on i386.

Reported by: kargl

11 years agoAfter fixing ranges restore POSIX requirement: rand() call without
ache [Thu, 4 Jul 2013 00:02:10 +0000 (00:02 +0000)]
After fixing ranges restore POSIX requirement: rand() call without
srand() must be the same as srand(1); rand();
(yet one increment)

11 years ago- Include the T5 firmware with the driver.
np [Wed, 3 Jul 2013 23:52:15 +0000 (23:52 +0000)]
- Include the T5 firmware with the driver.
- Update the T4 firmware to the latest.
- Minor reorganization and updates to the version macros, etc.

Obtained from: Chelsio
MFC after: 1 day

11 years agoBump disk(9) ABI version to signify the addition of d_delmaxsize by r249940.
smh [Wed, 3 Jul 2013 23:46:30 +0000 (23:46 +0000)]
Bump disk(9) ABI version to signify the addition of d_delmaxsize by r249940.

Ensure that d_delmaxsize is always set, removing init to 0 which could cause
future issues if use cases change.

Allow kern.cam.da.X.delete_max (which maps to d_delmaxsize) to be increased
up to the calculated max after being reduced.

MFC after: 1 day
X-MFC-With: r249940

11 years agovm_phys_fictitious_reg_range() was losing the 'memattr' because it would be
neel [Wed, 3 Jul 2013 23:38:37 +0000 (23:38 +0000)]
vm_phys_fictitious_reg_range() was losing the 'memattr' because it would be
reset by pmap_page_init() right after being initialized in vm_page_initfake().

The statement above is with reference to the amd64 implementation of
pmap_page_init().

Fix this by calling 'pmap_page_init()' in 'vm_page_initfake()' before changing
the 'memattr'.

Reviewed by: kib
MFC after: 2 weeks

11 years agoFix one of INVARIANTS-related UMA panics on ARM
gonzo [Wed, 3 Jul 2013 23:38:02 +0000 (23:38 +0000)]
Fix one of INVARIANTS-related UMA panics on ARM

Force UMA zone to allocate service structures like slabs using own
allocator.  uma_debug code performs atomic ops on uma_slab_t fields
and safety of this operation is not guaranteed for write-back caches

11 years agoIn addition to prev. commit, for repeated rand_r(3) calls don't forget
ache [Wed, 3 Jul 2013 23:27:04 +0000 (23:27 +0000)]
In addition to prev. commit, for repeated rand_r(3) calls don't forget
to compensate back at the end incremented at the start internal
state.

MFC after:      2 weeks

11 years agoIf a superpage mapping is being removed then we need to ignore the PG_PDE_PAT
neel [Wed, 3 Jul 2013 23:21:25 +0000 (23:21 +0000)]
If a superpage mapping is being removed then we need to ignore the PG_PDE_PAT
bit when looking up the vm_page associated with the superpage's physical
address.

If the caching attribute for the mapping is write combining or write protected
then the PG_PDE_PAT bit will be set and thus cause an 'off-by-one' error
when looking up the vm_page.

Fix this by using the PG_PS_FRAME mask to compute the physical address for
a superpage mapping instead of PG_FRAME.

This is a theoretical issue at this point since non-writeback attributes are
currently used only for fictitious mappings and fictitious mappings are not
subject to promotion.

Discussed with: alc, kib
MFC after: 2 weeks

11 years agoVerify that all bytes in the instruction buffer are consumed during decoding.
neel [Wed, 3 Jul 2013 23:05:17 +0000 (23:05 +0000)]
Verify that all bytes in the instruction buffer are consumed during decoding.

Suggested by: grehan

11 years agoMerge r252513 from src/gnu/usr.bin/patch into src/usr.bin/patch:
obrien [Wed, 3 Jul 2013 22:46:30 +0000 (22:46 +0000)]
Merge r252513 from src/gnu/usr.bin/patch into src/usr.bin/patch:

Properly handle input lines containing NUL characters such that pgets()
accurately fills the read buffer.

Callers of pgets() still mis-process the buffer contents if the read line
contains NUL characters, but this at least makes pgets() accurate.

11 years agoMerge r252512 from src/gnu/usr.bin/patch into src/usr.bin/patch:
obrien [Wed, 3 Jul 2013 22:44:26 +0000 (22:44 +0000)]
Merge r252512 from src/gnu/usr.bin/patch into src/usr.bin/patch:

Make it so that 'patch < FUBAR' and 'patch -i FUBAR' operate the same.

The former makes a copy of stdin, but was not accurately putting the
content of stdin into a temp file.  This lead to the undercounting
the number of lines in hunks containing NUL characters when reading
from stdin.  Thus resulting in "unexpected end of file in patch" errors.

11 years agoMFp4 @229488:
pjd [Wed, 3 Jul 2013 22:23:25 +0000 (22:23 +0000)]
MFp4 @229488:

Sandbox unprivileged process using capability mode.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoMFp4 @229487:
pjd [Wed, 3 Jul 2013 22:22:29 +0000 (22:22 +0000)]
MFp4 @229487:

Revoke all capability rights from STDIN and allow only for write to STDOUT and
STDERR. All those descriptors are redirected to /dev/null.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoMFp4 @229486:
pjd [Wed, 3 Jul 2013 22:21:11 +0000 (22:21 +0000)]
MFp4 @229486:

Once PID is written to the pidfile, revoke all capability rights.
We just want to keep the pidfile open.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoMFp4 @229485:
pjd [Wed, 3 Jul 2013 22:19:43 +0000 (22:19 +0000)]
MFp4 @229485:

Only allow to overwrite lease file.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoMFp4 @229484:
pjd [Wed, 3 Jul 2013 22:18:40 +0000 (22:18 +0000)]
MFp4 @229484:

Limit routing socket so only poll(2) and read(2) are allowed (CAP_POLL_EVENT
and CAP_READ). This prevents unprivileged process from adding, removing or
modifying system routes.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoMFp4 @229483:
pjd [Wed, 3 Jul 2013 22:17:29 +0000 (22:17 +0000)]
MFp4 @229483:

Limit communication pipe with privileged process to CAP_READ and CAP_WRITE.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoMFp4 @229482:
pjd [Wed, 3 Jul 2013 22:16:02 +0000 (22:16 +0000)]
MFp4 @229482:

- Limit bpf descriptor in unprivileged process to CAP_POLL_EVENT, CAP_READ and
  allow for SIOCGIFFLAGS, SIOCGIFMEDIA ioctls.
- While here limit bpf descriptor in privileged process to only CAP_WRITE.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoMFp4 @229481:
pjd [Wed, 3 Jul 2013 22:12:54 +0000 (22:12 +0000)]
MFp4 @229481:

Currently it was allowed to send any UDP packets from unprivileged process and
possibly any packets because /dev/bpf was open for writing.

Move sending packets to privileged process. Unprivileged process has no longer
access to not connected UDP socket and has only access to /dev/bpf in read-only
mode.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoMFp4 @229480:
pjd [Wed, 3 Jul 2013 22:09:02 +0000 (22:09 +0000)]
MFp4 @229480:

Shutdown write direction of the routing socket. We only need to read from it.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoMFp4 @229479:
pjd [Wed, 3 Jul 2013 22:07:55 +0000 (22:07 +0000)]
MFp4 @229479:

- Add new request (IMSG_SEND_PACKET) that will be handled by privileged process.
- Add $FreeBSD$.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoMFp4 @229477:
pjd [Wed, 3 Jul 2013 22:05:36 +0000 (22:05 +0000)]
MFp4 @229477:

The gethostname(3) function won't work in capability mode, because reading
kern.hostname sysctl is not permitted there.  Cache hostname early and use
cached value later.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoRemove redundant white-spaces.
pjd [Wed, 3 Jul 2013 22:03:19 +0000 (22:03 +0000)]
Remove redundant white-spaces.

11 years agoMFp4 @229476,229478:
pjd [Wed, 3 Jul 2013 22:01:52 +0000 (22:01 +0000)]
MFp4 @229476,229478:

Make use of two fields: rfdesc and wfdesc to keep bpf descriptor open for
reading only in rfdesc and bpf descriptor open for writing only in wfdesc.
In the end they will be used by two different processes.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoMFp4 @229474:
pjd [Wed, 3 Jul 2013 21:58:26 +0000 (21:58 +0000)]
MFp4 @229474:

iov_base field is 'void *' in FreeBSD, no need to cast.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoMFp4 @229473:
pjd [Wed, 3 Jul 2013 21:57:24 +0000 (21:57 +0000)]
MFp4 @229473:

No caller checks send_packet() return value, so make it void.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoMFp4 @229472:
pjd [Wed, 3 Jul 2013 21:53:54 +0000 (21:53 +0000)]
MFp4 @229472:

Use the same type for 'from' and 'to' argument in send_packet().

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoMFp4 @229471:
pjd [Wed, 3 Jul 2013 21:49:10 +0000 (21:49 +0000)]
MFp4 @229471:

Remove unused argument from assemble_hw_header().

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoMFp4 @229470:
pjd [Wed, 3 Jul 2013 21:45:29 +0000 (21:45 +0000)]
MFp4 @229470:

Remove unused argument from send_packet().

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years agoMFp4: @229469:
pjd [Wed, 3 Jul 2013 21:41:35 +0000 (21:41 +0000)]
MFp4: @229469:

Garbage-collect dead prototypes.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation

11 years ago1) POSIX requires rand(3) return values to be in the [0, RAND_MAX] range,
ache [Wed, 3 Jul 2013 21:21:54 +0000 (21:21 +0000)]
1) POSIX requires rand(3) return values to be in the [0, RAND_MAX] range,
but ACM formula we use have internal state (and return value) in the
[1, 0x7ffffffe] range, so our RAND_MAX (0x7fffffff) is never reached
because it is off by one, zero is not reached too.

Correct both RAND_MAX and rand(3) return value, shifting last one
to the 0 by 1 subtracted, resulting POSIXed [0, 0x7ffffffd(=new RAND_MAX)]
range.

2) Add a checks for not overflowing on too big seeds. It may happens on
the machines, where sizeof(unsigned int) > 32 bits.

Reviewed by:    bde [1]
MFC after:      2 weeks

11 years agoSandbox rwhod(8) receiver process using capability mode and Capsicum
pjd [Wed, 3 Jul 2013 21:07:02 +0000 (21:07 +0000)]
Sandbox rwhod(8) receiver process using capability mode and Capsicum
capabilities.

rwhod(8) receiver can now only receive packages, write to /var/rwho/ directory
and log to syslog.

Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
Sponsored by: Google Summer of Code 2013
Reviewed by: pjd
MFC after: 1 month

11 years agoThe whole sending functionality was implemented within signal handler,
pjd [Wed, 3 Jul 2013 21:04:20 +0000 (21:04 +0000)]
The whole sending functionality was implemented within signal handler,
which is very bad idea. Split sending and receiving in two processes,
which fixes this problem and will help to sandbox rwhod.

Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
Sponsored by: Google Summer of Code 2013
Reviewed by: pjd
MFC after: 1 month

11 years agoStyle cleanups.
pjd [Wed, 3 Jul 2013 20:58:58 +0000 (20:58 +0000)]
Style cleanups.

Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
Sponsored by: Google Summer of Code 2013
Reviewed by: pjd
MFC after: 1 month

11 years agoFew more style nits.
pjd [Wed, 3 Jul 2013 20:44:47 +0000 (20:44 +0000)]
Few more style nits.

MFC after: 1 month

11 years agoSandbox rwho(1) using capability mode and Capsicum capabilities.
pjd [Wed, 3 Jul 2013 20:42:10 +0000 (20:42 +0000)]
Sandbox rwho(1) using capability mode and Capsicum capabilities.
rwho(1) gets only read-only access to /var/rwho/ directory.

Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
Sponsored by: Google Summer of Code 2013
Reviewed by: pjd
MFC after: 1 month

11 years agoIncrease the microcode max size to 16K to accomodate more recent Intel
rpaulo [Wed, 3 Jul 2013 20:29:15 +0000 (20:29 +0000)]
Increase the microcode max size to 16K to accomodate more recent Intel
firmware.

11 years agoStyle cleanups.
pjd [Wed, 3 Jul 2013 20:28:33 +0000 (20:28 +0000)]
Style cleanups.

Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
Sponsored by: Google Summer of Code 2013
Reviewed by: pjd
MFC after: 1 month

11 years agoAdd an entry for filemon.
peter [Wed, 3 Jul 2013 20:22:12 +0000 (20:22 +0000)]
Add an entry for filemon.

11 years agoMove static ZFS compile option to the other static file system options.
peter [Wed, 3 Jul 2013 20:21:39 +0000 (20:21 +0000)]
Move static ZFS compile option to the other static file system options.

11 years agoTypos in comments.
rpaulo [Wed, 3 Jul 2013 20:19:23 +0000 (20:19 +0000)]
Typos in comments.

11 years agoPull in r185446 from clang trunk:
dim [Wed, 3 Jul 2013 19:08:10 +0000 (19:08 +0000)]
Pull in r185446 from clang trunk:

  Fix to PR15826 - clang hits assert in clang::ASTContext::getASTRecordLayout.

Reported by: glebius

11 years agoAdd descriptions to the FILES list, fix some mdoc complaints, move the
wblock [Wed, 3 Jul 2013 18:53:36 +0000 (18:53 +0000)]
Add descriptions to the FILES list, fix some mdoc complaints, move the
"neither" entry out of the table in BOOTING.

Submitted by: joeld
Reviewed by: joeld
MFC after: 1 week

11 years agoCode cleanups.
tuexen [Wed, 3 Jul 2013 18:48:43 +0000 (18:48 +0000)]
Code cleanups.

MFC after: 3 days

11 years agoMake it clear that there are three separate internal locks.
peter [Wed, 3 Jul 2013 18:35:21 +0000 (18:35 +0000)]
Make it clear that there are three separate internal locks.

11 years agoAs a followup to r252547, propate const down the call stack.
peter [Wed, 3 Jul 2013 18:27:45 +0000 (18:27 +0000)]
As a followup to r252547, propate const down the call stack.

11 years agoAttempt to deal with a compile failure that shows up with gcc, which
peter [Wed, 3 Jul 2013 18:25:27 +0000 (18:25 +0000)]
Attempt to deal with a compile failure that shows up with gcc, which
has -Werror on.  Without this, yylex() is inconsistently or redundantly
defined.

11 years agoPort 0 needs to wait for ACK only if it issued the RESET.
davidcs [Wed, 3 Jul 2013 17:57:35 +0000 (17:57 +0000)]
Port 0 needs to wait for ACK only if it issued the RESET.

11 years agoCatch up with r238990. LLE_DELETED does not clobber everything else in
np [Wed, 3 Jul 2013 17:27:32 +0000 (17:27 +0000)]
Catch up with r238990.  LLE_DELETED does not clobber everything else in
la_flags since said revision.

11 years agoDon't perform the acpi_DeviceIsPresent() check for PCI-PCI bridges. If
jhb [Wed, 3 Jul 2013 17:26:05 +0000 (17:26 +0000)]
Don't perform the acpi_DeviceIsPresent() check for PCI-PCI bridges.  If
we are probing a PCI-PCI bridge it is because we found one by enumerating
the devices on a PCI bus, so the bridge is definitely present.  A few
BIOSes report incorrect status (_STA) for some bridges that claimed they
were not present when in fact they were.

While here, move this check earlier for Host-PCI bridges so attach fails
before doing any work that needs to be torn down.

PR: kern/91594
Tested by: Jack Vogel @ Intel
MFC after: 1 week

11 years agoFix NULL-deference kernel panic on attempt of destroying non-existing
mav [Wed, 3 Jul 2013 14:58:11 +0000 (14:58 +0000)]
Fix NULL-deference kernel panic on attempt of destroying non-existing
ramdisk-backed CTL LUN.

11 years agoRevert previous revision, local change that accidentally snuck in.
zeising [Wed, 3 Jul 2013 12:58:53 +0000 (12:58 +0000)]
Revert previous revision, local change that accidentally snuck in.

11 years agoRegenerate after r252561
zeising [Wed, 3 Jul 2013 12:53:06 +0000 (12:53 +0000)]
Regenerate after r252561

PR: docs/180025
Submitted by: Garrett Cooper <yaneurabeya@gmail.com>

11 years agoDocument WITHOUT_SVNLITE and WITH_SVN.
zeising [Wed, 3 Jul 2013 12:36:47 +0000 (12:36 +0000)]
Document WITHOUT_SVNLITE and WITH_SVN.

PR: docs/180025
Submitted by: Garrett Cooper <yaneurabeya@gmail.com>

11 years ago- Fix double frees/user after free.
davide [Wed, 3 Jul 2013 10:31:45 +0000 (10:31 +0000)]
- Fix double frees/user after free.
- Allocate using smb_rq_alloc() instead of inlining it.

Reported by: uqs
Found with: Coverity Scan

11 years agoFix a typo (s/error/errno/).
hrs [Wed, 3 Jul 2013 09:50:59 +0000 (09:50 +0000)]
Fix a typo (s/error/errno/).

11 years agoThere is no reason to disallow setting the password or account expiry
des [Wed, 3 Jul 2013 09:48:24 +0000 (09:48 +0000)]
There is no reason to disallow setting the password or account expiry
date to the current date.

MFC after: 3 days

11 years agoFix a compiler warning.
hrs [Wed, 3 Jul 2013 07:31:07 +0000 (07:31 +0000)]
Fix a compiler warning.

MFC after: 1 week

11 years agoReplace the #define for "iconv" so it is for the function name instead of
peter [Wed, 3 Jul 2013 07:03:19 +0000 (07:03 +0000)]
Replace the #define for "iconv" so it is for the function name instead of
a macro with parameters.  Remove a __DECONST hack and add consts instead
for gnu libiconv API compatability.  This makes it work with things like
devel/boost-libs that expects to use "iconv" as though it were a pointer.

11 years agohastResourceWorkerPid is read-only.
trociny [Wed, 3 Jul 2013 05:54:23 +0000 (05:54 +0000)]
hastResourceWorkerPid is read-only.

Submitted by: jilles
MFC after: 3 days

11 years agoA problem with the old NFS client where large writes to large files
rmacklem [Wed, 3 Jul 2013 00:19:03 +0000 (00:19 +0000)]
A problem with the old NFS client where large writes to large files
would sometimes result in a corrupted file was reported via email.
This problem appears to have been caused by r251719 (reverting
r251719 fixed the problem). Although I have not been able to
reproduce this problem, I suspect it is caused by another thread
increasing np->n_size after the mtx_unlock(&np->n_mtx) but before
the vnode_pager_setsize() call. Since the np->n_mtx mutex serializes
updates to np->n_size, doing the vnode_pager_setsize() with the
mutex locked appears to avoid the problem.
Unfortunately, vnode_pager_setsize() where the new size is smaller,
cannot be called with a mutex held.
This patch returns the semantics to be close to pre-r251719 (actually
pre-r248567, r248581, r248567 for the new client) such that the call to
vnode_pager_setsize() is only delayed until after the mutex is
unlocked when np->n_size is shrinking. Since the file is growing
when being written, I believe this will fix the corruption.
A better solution might be to replace the mutex with a sleep lock,
but that is a non-trivial conversion, so this fix is hoped to be
sufficient in the meantime.

Reported by: David G. Lawrence (dg@dglawrence.com)
Tested by: David G. Lawrence (to be done soon)
Reviewed by: kib
MFC after: 1 week

11 years agoMake better use of metadata area by avoiding using it for data blocks
mckusick [Tue, 2 Jul 2013 21:07:08 +0000 (21:07 +0000)]
Make better use of metadata area by avoiding using it for data blocks
that no should no longer immediately follow their indirect blocks.

MFC after: 2 weeks

11 years agoRemove extranious '.'
eadler [Tue, 2 Jul 2013 20:25:58 +0000 (20:25 +0000)]
Remove extranious '.'

Submitted by: swildner@DragonflyBSD.org