Displaying 1 50 of 297,679 commits (0.026s)

FreeBSD — head/sys/dev/hyperv/vmbus hv_vmbus_drv_freebsd.c

hyperv/vmbus: Allocate/setup IDT vector after all ISR resources are ready

And release IDT vector before releasing ISR resources on interrupt
teardown path.  We still have some work to do on the interrupt tearing
down path.

MFC after:        1 week
Sponsored by:        Microsoft OSTC
Differential Revision:        https://reviews.freebsd.org/D6519

FreeBSD — head/sys/dev/hyperv/vmbus hv_vmbus_drv_freebsd.c

hyperv/vmbus: Check hyperv_dmamem_alloc return value

Though it is highly unlikely this function would fail w/ BUS_DMA_WAITOK,
we had better to check its return value; better safe then sorry here.

MFC after:        1 week
Sponsored by:        Microsoft OSTC
Differential Revision:        https://reviews.freebsd.org/D6518

FreeBSD — head/bin/mv mv.c

Close from_fd if malloc() fails to avoid a file descriptor leak.

Reported by:        Coverity
CID:                1007203
MFC after:        1 week
Delta File
+1 -0 head/bin/mv/mv.c
+1 -0 1 file

FreeBSD — head/bin/sh sh.1

Match the descriptions of the \H and \h prompt string sequences to reality.
They were swapped.

X-Confirmed by:        jilles
MFC after:        1 week
Delta File
+3 -3 head/bin/sh/sh.1
+3 -3 1 file

FreeBSD — stable/10/contrib/ipfilter/man ipf.5

MFC r300177 and r300179: fix two typos in man page.

FreeBSD — head/sys/cam/ata ata_da.c

Fix a few ada(4) driver issues:

 o Some Samsung drives do not support the ATA READ LOG EXT or READ
   LOG DMA EXT commands, despite indicating that they do in their
   IDENTIFY data.  So, fix this in two ways:
        1. Only start the log directory probe (ADA_STATE_LOGDIR) if
           the drive claims to be an SMR drive in the first place.
           We don't need to do the extra probing for other devices.
           This will also serve to prevent problems with other
           drives that have the same issue.
        2. Add quirks for the two Samsung drives that have been
           reported so far (thanks to Oleg Nauman and Alex Petrov).
           If there is a reason to do a Read Log later on, we will
           know that it doesn't work on these drives.

 o Add a quirk entry to mark Seagate Lamarr Drive Managed drives as
   drive managed.  They don't report this in their Identify data.

sys/cam/ata/ata_da.c:
        Add two new quirks:
        1. ADA_Q_LOG_BROKEN, for drives that claim to support Read
           Log but don't really.
        2. ADA_Q_SMR_DM, for drives that are Drive Managed SMR, but
           don't report it.  This can matter for software that
           wants to know when it should make an extra effort to

    [19 lines not shown]
Delta File
+45 -7 head/sys/cam/ata/ata_da.c
+45 -7 1 file

FreeBSD — head/usr.sbin/ypldap aldap.c ldapclient.c

Fix Coverity CIDs 1340544 Resource leak and 1340543 Use after free

At line 479 of ldapclient.c in client_build_req(), the error return
leaks ldap_attrs (CID 1340544).  It looks like this can happen if
the first utoa() call in aldap_get_stringset() fails.  It looks
like other leaks can happen if other utoa() calls fail since scanning
this array when it is freed stops when the first NULL is encountered.
Fix these problems by not storing NULL in the array when utoa()
fails, and by freeing ret and returning NULL if nothing is stored
in the array.  That way the caller will never see the
ldap_attrs[0] == NULL case, so delete that check.

The ber_printf_element() calls ber_free_elements() on its ber
argument and returns NULL on failure.  When each of its callers
detects failure, they do a goto fail, which then calls ber_free_elements()
with the same pointer (CID 1340543).  Fix is to delete the
ber_free_elements() from ber_printf_element()

Reported by:        Coverity
CID:                1340543, 1340544
Reviewed by:        araujo
Differential Revision:        https://reviews.freebsd.org/D6550

FreeBSD — head/etc/rc.d ntpd

Use the expiry date to determine whether to replace the DB copy of
leapfile instead of using the leapfile serial number (create
timestamp).

PR:                209577
MFC after:        3 days
Delta File
+2 -2 head/etc/rc.d/ntpd
+2 -2 1 file

FreeBSD — head/sys/dev/dpaa portals_common.c

Set the TLB caching properties for portals at attach time.

This was found while reworking the device tree nodes for dtsec to match the
Linux device tree.  Instead of waiting and expecting later code to call
dpaa_portal_map_registers(), do the equivalent immediately upon mapping.
Otherwise, it's possible to access the pages before that function is called, and
hang the CPU.

FreeBSD — head/usr.sbin/ypserv yp_dnslookup.c

Delay calling yp_malloc_dnsent() until after some additional sanity
checks to avoid leaking memory on error returns.

Reported by:        Coverity
CID:                1007416
MFC after:        1 week

FreeBSD — head/usr.sbin/ypserv yp_server.c

Call free(cur) if strdup(dirp->d_name) fails to avoid a memory leak.

Reported by:        Coverity
CID:                1007414
MFC after:        1 week
Delta File
+1 -0 head/usr.sbin/ypserv/yp_server.c
+1 -0 1 file

FreeBSD — head/sys/boot/efi/loader main.c

efi loader: Match format string to EFI_ERROR_CODE()

Silence a format specifier warning.

Sponsored by:        EMC / Isilon Storage Division
Delta File
+2 -2 head/sys/boot/efi/loader/main.c
+2 -2 1 file

FreeBSD — head/usr.sbin/acpi/acpidb acpidb.c

Fix acpidb CIDs 1011279 (Buffer not null terminated) and 978405 and
1199380 (Resource leak).

load_dsdt() calls strncpy() to copy a filename and Coverity warns
that the destination buffer may not be NUL terminated.  Fix this
by using strlcpy() instead.  If silent truncation occurs, then the
filename was not valid anyway.

load_dsdt() leaks an fd (CID 978405) and a memory region allocated
using mmap() (CID 1199380) when it returns.  Fix these by calling
close() and munmap() as appropriate.

Don't bother fixing the minor memory leak "list", allocated by
AcGetAllTablesFromFile() (CID 1355191).

Check for truncation when creating the temp file name.

Set a flag to indicate that the temp file should be unlinked.
Relying on a strcmp() test could delete the input file in contrived
cases.

Reported by:        Coverity
CID:                1011279, 978405, 1199380
Reviewed by:        jkim
MFC after:        1 week
Differential Revision:        https://reviews.freebsd.org/D6368
Delta File
+20 -10 head/usr.sbin/acpi/acpidb/acpidb.c
+20 -10 1 file

FreeBSD — head/usr.sbin/acpi/acpidump acpi.c

Fix acpidump CID 1011278 (Buffer not null terminated) and other issues

Coverity reports that a buffer used for temporary file generation
might not be NUL terminated by strncpy().  This is probably not
true because the input gets passed through realpath(), but if the
path name is sufficiently long the name could be truncated and cause
other problems.  The code for generating the temp file names is
also overly complex.  Instead of a bunch of calls to strncpy() and
and strncat(), simplify the code by using snprintf() and add checks
for unexpected truncation.

The output file created by iasl -d is predictable.  Fix this by
using  mkdtemp() to create a directory to hold the iasl input and
output files.

Check the return values of more syscalls.

Reported by:        Coverity
CID:                1011278
Reviewed by:        jkim
MFC after:        1 week
Differential Revision:        https://reviews.freebsd.org/D6360
Delta File
+43 -18 head/usr.sbin/acpi/acpidump/acpi.c
+43 -18 1 file

FreeBSD — head/share/man/man5 src.conf.5

Regenerate
Delta File
+5 -3 head/share/man/man5/src.conf.5
+5 -3 1 file

FreeBSD — head/tools/build/options WITH_META_MODE

WITH_META_MODE: Correct description of missing .meta file.

Sponsored by:        EMC / Isilon Storage Division

FreeBSD — stable/10/sys/conf kmod.mk, stable/8/sys/conf kmod.mk

MFC 299310:
Don't store generated firmware object files in the source directory.

Trim the leading directory of a firmware source file from the resulting
target object file name so the object file is stored in the object
directory. Previously, using 'FIRMWS= /path/to/fw.bin:fw.bin' would
store the generated 'fw.bin.fwo' file in the /path/to directory. Now
it stores it in the object directory of the kernel module being built.

FreeBSD — head/sys/dev/bhnd bhnd_match.h bhnd.h, head/sys/dev/bhnd/bhndb bhndb_pci_hwdata.c bhndb_hwdata.c

[bhnd] Normalize bhnd(4) device matching API

This unifies handling of core, chip, and board-level device
matching, and adds support for matching device drivers
against the bus attach type (e.g. SoC vs WiFi adapter).

Core-level quirks on Broadcom's chipsets generally are specific
to some combination of chip model, core revision, chip
package (e.g. 12x9 SMT package), SROM revision, etc.

Unifying the match APIs for all three attribute types (core, chip,
board/srom) allows defining a single device quirk table that
matches across all of those attributes.

Submitted by:        Landon Fuller <landonf at landonf.org>
Differential Revision:         https://reviews.freebsd.org/D6515

FreeBSD — head/sys/kern kern_event.c

Silence false LOR report due to the taskqueue mutex and kqueue lock
named the same.

Reported by:        Doug Luce <doug at freebsd.con.com>
Sponsored by:        The FreeBSD Foundation
Delta File
+2 -2 head/sys/kern/kern_event.c
+2 -2 1 file

FreeBSD — head/sys/kern sys_socket.c, head/tests/sys/aio aio_test.c

Return the correct status when a partially completed request is cancelled.

After the previous changes to fix requests on blocking sockets to complete
across multiple operations, an edge case exists where a request can be
cancelled after it has partially completed.  POSIX doesn't appear to
dictate exactly how to handle this case, but in general I feel that
aio_cancel() should arrange to cancel any request it can, but that any
partially completed requests should return a partial completion rather
than ECANCELED.  To that end, fix the socket AIO cancellation routine to
return a short read/write if a partially completed request is cancelled
rather than ECANCELED.

Sponsored by:        Chelsio Communications

FreeBSD — head/sys/rpc svc.c

Remove unnecessary memset(.., 0, ..)'s

The mem_alloc macro calls calloc (userspace) / malloc(.., M_WAITOK|M_ZERO)
under the covers, so zeroing out memory is already handled by the underlying
calls

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
Delta File
+0 -2 head/sys/rpc/svc.c
+0 -2 1 file

FreeBSD — head/lib/libc/rpc getnetconfig.c

Fix up r300385

I accidentally glossed over the fact that tmp is manipulated via strchr, so
if we tried to free `tmp` after r300385, it would have crashed.

Create a separate pointer (tmp2) to track the original allocation of `tmp`,
and free `tmp2` if `p->nc_lookups` can't be malloced

MFC after: 4 days
X-MFC with: r300385
Reported by: Coverity
CID: 1356026
Sponsored by: EMC / Isilon Storage Division
Delta File
+3 -2 head/lib/libc/rpc/getnetconfig.c
+3 -2 1 file

FreeBSD — projects/zfsd/head/cddl/usr.sbin/zfsd case_file.cc, projects/zfsd/head/etc/mtree BSD.root.dist BSD.var.dist

Move zfsd's case files to /var/db/zfsd/cases

It was never really appropriate to store these thing in /etc

cddl/usr.sbin/zfsd/case_file.cc
        Change the case file location

etc/mtree/BSD.root.dist
        Don't create /etc/zfs/cases

etc/mtree/BSD.var.dist
        Do create /var/db/zfsd/cases

Sponsored by:        Spectra Logic Corp

FreeBSD — head/sys/vm vm_page.c

In vm_page_cache(), only drop the vnode after radix insert failure
for empty page cache when the object type if OBJT_VNODE.

Reported and tested by:        pho
Reviewed by:        alc
Sponsored by:        The FreeBSD Foundation
MFC after:        1 week
Delta File
+2 -1 head/sys/vm/vm_page.c
+2 -1 1 file

FreeBSD — head/lib/libc/rpc clnt_bcast.c

Remove redundant NULLing of outbuf_pmap

If reallocf ever failed, outbuf_pmap would already be NULL

MFC after: 1 week
X-MFC with: r300620
Reported by: cem
Sponsored by: EMC / Isilon Storage Division
Delta File
+0 -1 head/lib/libc/rpc/clnt_bcast.c
+0 -1 1 file

FreeBSD — head/lib/libc/rpc clnt_bcast.c

Use reallocf instead of malloc to fix leak with outbuf_pmap

The previous code overwrote outbuf_pmap's memory with malloc once per
loop iteration, which leaked its memory; use reallocf instead to ensure
that memory is properly free'd each loop iteration.

Add a outbuf_pmap = NULL in the failure case to avoid a double-free
at the bottom of the function.

Differential Revision: https://reviews.freebsd.org/D6495
MFC after: 1 week
Reported by: Coverity
CID: 1038776
Reviewed by: markj, pfgj
Sponsored by: EMC / Isilon Storage Division
Delta File
+3 -1 head/lib/libc/rpc/clnt_bcast.c
+3 -1 1 file

FreeBSD — head/sys/cddl/dev/dtrace/aarch64 dtrace_subr.c

Try to unbreak the build after r300611 by including the header
defining VM_MIN_KERNEL_ADDRESS.

Sponsored by:        DARPA/AFRL

FreeBSD — head/cddl/contrib/opensolaris/lib/libdtrace riscv, head/cddl/contrib/opensolaris/lib/libdtrace/common dt_link.c dt_printf.c

Add initial DTrace support for RISC-V.

Sponsored by:        DARPA, AFRL
Sponsored by:        HEIF5

FreeBSD — head/sys/conf Makefile.riscv

Set dependencies for genassym.c.
This fixes non-parallel build.
Delta File
+3 -0 head/sys/conf/Makefile.riscv
+3 -0 1 file

FreeBSD — head/sys/dev/bhnd/soc bhnd_soc.c

[bhnd] fix compilation due to incompatible types

Submitted by:        Michael Zhilin <mizhka at gmail.com>
Differential Revision: https://reviews.freebsd.org/D6532
Delta File
+1 -1 head/sys/dev/bhnd/soc/bhnd_soc.c
+1 -1 1 file

FreeBSD — head/sys/dev/iscsi icl.c

Add kern.icl.iser_offloads sysctl.

MFC after:        1 month
Sponsored by:        The FreeBSD Foundation
Delta File
+8 -1 head/sys/dev/iscsi/icl.c
+8 -1 1 file

FreeBSD — head/sys/riscv/riscv exception.S

Store the original value of stack pointer to the exception frame
(the value we had before supervisor exception occurred).
This helps consumers (e.g. DTrace) to not proceed additional calculations.

Sponsored by:        DARPA, AFRL
Sponsored by:        HEIF5
Delta File
+3 -1 head/sys/riscv/riscv/exception.S
+3 -1 1 file

FreeBSD — head/release/doc/en_US.ISO8859-1/relnotes article.xml

Bump copyright year

Approved by:        gjb@ (implicit)

FreeBSD — head/sys/cddl/dev/dtrace/aarch64 dtrace_subr.c

Mark all memory before the kernel as toxic to DTrace.

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

FreeBSD — head/sys/dev/an if_an.c

Reject ioctl commands for FLSHGCHR and FLSHPCHR if the size is greater
than sc->areq.  This is a bounds check to ensure we're not just cramming
arbitrarily sized nonsense into the driver and overflowing the heap.

PR:                209545
Submitted by:        cturt at hardenedbsd.org
MFC after:        2 weeks
Delta File
+6 -0 head/sys/dev/an/if_an.c
+6 -0 1 file

FreeBSD — head/sys/dev/ntb/if_ntb if_ntb.c

Re-enable write combining, disabled by default at r295486.

if_ntb(4) strongly benefits from WC, improving throughput from 350Mbit/s
to 8-10Gbit/s on my tests.

MFC after:        1 week
Delta File
+4 -0 head/sys/dev/ntb/if_ntb/if_ntb.c
+4 -0 1 file

FreeBSD — head/sys/dev/sfxge sfxge.c, head/sys/dev/sfxge/common efsys.h

sfxge(4): enable Medford support

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6510

FreeBSD — head/sys/dev/sfxge sfxge_version.h

sfxge(4): bump driver version to the closest out-of-tree version

Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

FreeBSD — head/share/man/man4 sfxge.4, head/sys/dev/sfxge sfxge_version.h sfxge.c

sfxge(4): cleanup: update copyright to 2016

Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6509

FreeBSD — head/sys/dev/sfxge/common efx_check.h medford_nic.c

sfxge(4): provide option to disable not a local MAC address check

Option EFSYS_OPT_ALLOW_UNCONFIGURED_NIC disables check that the adapter
MAC address is not a local address (beginning 02).

Submitted by:   Laurence Evans <levans at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6508

FreeBSD — head/sys/dev/sfxge/common efx_ev.c ef10_ev.c

sfxge(4): be ready to receive events immediately after event queues are created

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6507

FreeBSD — head/sys/kern subr_intr.c

Limit calling pmc_hook to when the interrupt comes while running userspace.
We may enable interrupts from within the callback, e.g. in a data abort
during copyin. If we receive an interrupt at that time pmc_hook will be
called again and, as it is handling userspace stack tracing, will hit a
KASSERT as it checks if the trapframe is from userland.

With this I can run hwpmc with intrng on a ThunderX and have it trace all
CPUs.

Obtained from:        ABT Systems Ltd
Sponsored by:        The FreeBSD Foundation
Delta File
+2 -1 head/sys/kern/subr_intr.c
+2 -1 1 file

FreeBSD — head/sys/net if_tun.h

Allow an MTU of 65535 bytes to be set via TUN[SG]IFINFO. This requires
changing the type on the mtu field in struct tuninfo from short to
unsigned short.
This is used, for example, by packetdrill to test with MTUs up to the
maximum value.

Differential Revision:        6452
Delta File
+2 -2 head/sys/net/if_tun.h
+2 -2 1 file

FreeBSD — head/lib/libradius radlib.h

The NAS-Identifier attribute is a string, not an integer.

MFC after:        1 week
Delta File
+1 -1 head/lib/libradius/radlib.h
+1 -1 1 file

FreeBSD — stable/10/sys/ufs/ffs ffs_vfsops.c

MFC r300084:
Do enable io accounting for read-only mounts and mounts which are
remounted to writeable after initial read-only.  Assign to
dev->si_mountpt earlier to account the accesses done at the mount
time.

FreeBSD — stable/10/sys/ufs/ffs ffs_inode.c

MFC r300083:
If IO_SYNC was passed to ffs_truncate(), request synchronous inode
update from the final ffs_update().
Delta File
+1 -1 stable/10/sys/ufs/ffs/ffs_inode.c
+1 -1 1 file

FreeBSD — stable/10/sys/ufs/ufs ufs_lookup.c

MFC r300082:
For async UFS mounts, shrink the directory asynchronously, at least do
not pass IO_SYNC to ffs_truncate() unneccessary.

FreeBSD — stable/10/sys/ufs/ffs ffs_vfsops.c

MFC r300030:
Fix comments.

FreeBSD — stable/10/sys/ufs/ufs ufs_lookup.c

MFC r300027:
Fix typo in the message.

FreeBSD — head/sys/vm vm_page.c

In vm_page_alloc_contig(), on vm_page_insert() failure, mark each
freed page as VPO_UNMANAGED.  Otherwise vm_pge_free_toq() insists on
owning the page lock.

Previously, VPO_UNMANAGED was only set up to the last processed page.

Reviewed by:        alc
Sponsored by:        The FreeBSD Foundation
MFC after:        1 week
Delta File
+3 -1 head/sys/vm/vm_page.c
+3 -1 1 file