Displaying 1 50 of 256,246 commits (0.022s)

HardenedBSD — release Makefile

- Akin r302691 in head, synchronize the build stripping for the disc1
  image with that of the bootonly image (but similarly modulo games
  and groff(1)) as the amd64 disc1 image is overflowing. This also
  removes the defunct WITHOUT_ATF.
- Remove the misspelled WITHOUT_INSTALLIB (also in place with correct
  spelling, i. e. WITHOUT_INSTALLLIB) from the bootonly image build
  stripping.

This is a direct commit to stable/10 as the corresponding knobs have
different names in head and counterparts to e. g. MK_DEBUG_FILES and
MK_TESTS default to off in stable/10 in the first place.
Delta File
+6 -3 release/Makefile
+6 -3 1 file

HardenedBSD — sys/boot/efi/include efilib.h

efilib.h: typo in structure member description

The link should be replaced by list.
Delta File
+1 -1 sys/boot/efi/include/efilib.h
+1 -1 1 file

HardenedBSD — sys/boot/efi/include efilib.h

r323885 did miss efilib.h update

The efilib.h update was left out from r323885 by mistake.
Delta File
+2 -1 sys/boot/efi/include/efilib.h
+2 -1 1 file

HardenedBSD — sys/boot/efi/libefi devpath.c

libefi: efi_devpath_match local len should be unsigned

DevicePathNodeLength() will always return unsigned value.
Delta File
+2 -2 sys/boot/efi/libefi/devpath.c
+2 -2 1 file

HardenedBSD — sys/cam cam_iosched.c

cam iosched: Bettar account IOPS for smoother performance

Prevent cam_iosched_iops_tick() from discarding 'unspent' ios unless
it's a new accounting interval.

Previously ios that weren't used between ticks were lost, as a result
the iops limiter could enforce a limit below the configured maximum.

Obtained from: ElectroBSD
Submitted by: Fabian Keil
PR: 221974
Delta File
+17 -6 sys/cam/cam_iosched.c
+17 -6 1 file

HardenedBSD — sys/cam cam_iosched.c

cam iosched: Enforce iop limits below the quanta value

Previously the iops limiter would always allow at least
quanta ios per second as cam_iosched_iops_tick() never set
ios->l_value1 below 1.

Submitted by: Fabian Keil <fk at fabiankeil.de>
Obtained from: ElectroBSD
PR: 221974
Delta File
+11 -1 sys/cam/cam_iosched.c
+11 -1 1 file

HardenedBSD — sys/opencrypto cryptodev.c

Support AEAD requests with non-GCM algorithms.

In particular, support chaining an AES cipher with an HMAC for a request
including AAD.  This permits submitting requests from userland to encrypt
objects like IPSec packets using these algorithms.

In the non-GCM case, the authentication crypto descriptor covers both the
AAD and the ciphertext.  The GCM case remains unchanged.  This matches
the requests created internally in IPSec.  For the non-GCM case, the
COP_F_CIPHER_FIRST is also supported since the ordering matters.

Note that while this can be used to simulate IPSec requests from userland,
this ioctl cannot currently be used to perform TLS requests using AES-CBC
and MAC-before-encrypt.

Reviewed by:        cem
Sponsored by:        Chelsio Communications
Differential Revision:        https://reviews.freebsd.org/D11759
Delta File
+16 -3 sys/opencrypto/cryptodev.c
+16 -3 1 file

HardenedBSD — share/man/man4 crypto.4, sys/opencrypto cryptodev.c cryptodev.h

Add a new COP_F_CIPHER_FIRST flag for struct crypt_op.

This requests that the cipher be performed before rather than after
the HMAC when both are specified for a single operation.

Reviewed by:        cem
Sponsored by:        Chelsio Communications
Differential Revision:        https://reviews.freebsd.org/D11757

HardenedBSD — sys/opencrypto cryptodev.c

Place the AAD before the plaintext/ciphertext for CIOCRYPTAEAD.

Software crypto implementations don't care how the buffer is laid out,
but hardware implementations may assume that the AAD is always before
the plain/cipher text and that the hash/tag is immediately after the end
of the plain/cipher text.

In particular, this arrangement matches the layout of both IPSec packets
and TLS frames.  Linux's crypto framework also assumes this layout for
AEAD requests.

Reviewed by:        cem
Sponsored by:        Chelsio Communications
Differential Revision:        https://reviews.freebsd.org/D11758
Delta File
+15 -15 sys/opencrypto/cryptodev.c
+15 -15 1 file

HardenedBSD — sys/kern subr_gtaskqueue.c

Fix undeclared identifier error introduced in r323879

It doesn't appear to be safe to use gtask->gt_name.

Reported by:        Mark Johnston, Jenkins
Reviewed by:        sbruno
Approved by:        sbruno (mentor)
Sponsored by:        Limelight Networks
Differential Revision:        https://reviews.freebsd.org/D12448
Delta File
+1 -1 sys/kern/subr_gtaskqueue.c
+1 -1 1 file

HardenedBSD — sys/boot/efi/libefi efipart.c

libefi: efipart.c should use calloc()

The device specific *_add functions are using malloc() + memset,
should use calloc instead.
Delta File
+5 -10 sys/boot/efi/libefi/efipart.c
+5 -10 1 file

HardenedBSD — sys/boot/efi/libefi devpath.c efipart.c

libefi: efi_devpath_match() should return bool

The current implementation of efi_devpath_match() is returning values 0 or 1,
so it should be updated to return bool.

HardenedBSD — sys/dev/cxgbe/tom t4_ddp.c t4_tom.h

MFC 323630: Avoid reusing the wrong buffer for a DDP AIO request.

To optimize the case of ping-ponging between two buffers, the DDP code
caches the last two buffers used keeping the pages wired and page pods
stored in the NIC's RAM.  If a new aio_read() request uses one of the
same buffers, then the work of holding pages, etc. can be avoided.
However, the starting virtual address of an aio buffer was not saved,
only the page count, length, and initial page offset.  Thus, an
aio_read() request could match a different buffer in the address
space.  (Earlier during development vm_fault_hold_quick_pages() was
always called and the vm_page_t values were compared, but that was
eventually removed without being adequately replaced.)  Fix by storing
the starting virtual address and comparing that (along with other
fields) to determine if a buffer can be reused.

Sponsored by:        Chelsio Communications

HardenedBSD — tools/tools/nanobsd defaults.sh

Always create usr/local/etc -> /etc/local symlink

/usr/local/etc gets created and populated by packages. However, if no
packages are installed when setup_nanobsd is run, this symlink won't
get created, causing problems if packages are installed later (say on
first boot). Therefore, always create the symlink and etc/local. It
does no harm and may help.

Inspired by crochet issue #183 (consuingly says NanoBSD, means crochet)
Sponsored by: Netflix
Delta File
+10 -2 tools/tools/nanobsd/defaults.sh
+10 -2 1 file

HardenedBSD — sys/fs/devfs devfs_vnops.c, sys/kern vfs_default.c

Only handle _PC_MAX_CANON, _PC_MAX_INPUT, and _PC_VDISABLE for TTY devices.

Move handling of these three pathconf() variables out of vop_stdpathconf()
and into devfs_pathconf() as TTY devices can only be devfs files.  In
addition, only return settings for these three variables for devfs devices
whose device switch has the D_TTY flag set.

Discussed with:        bde, kib
Sponsored by:        Chelsio Communications

HardenedBSD — sbin/fsck_ffs suj.c

Use UFS_LINK_MAX instead of LINK_MAX.

Submitted by:        bde
Sponsored by:        Chelsio Communications
Delta File
+1 -1 sbin/fsck_ffs/suj.c
+1 -1 1 file

HardenedBSD — sys/dev/drm2/i915 i915_gem.c

Simplify i915_gem_wire_page() and avoid unneeded page-busying.

Reviewed by:        alc, kib
MFC after:        1 week
Delta File
+6 -7 sys/dev/drm2/i915/i915_gem.c
+6 -7 1 file

HardenedBSD — sys/kern subr_gtaskqueue.c

Improved logging of gtaskqueue failues

Check the return code of intr_setaffinity() and log any errors
it returns. When a qid is not located, log an error before returning
failure.  Also, use __func__ rather than hardcoding the function name

Reviewed by:        sbruno
Approved by:        sbruno (mentor)
Sponsored by:        Limelight Networks
Differential Revision:        https://reviews.freebsd.org/D12436
Delta File
+25 -13 sys/kern/subr_gtaskqueue.c
+25 -13 1 file

HardenedBSD — tests/sys/opencrypto cryptotest.py

cryptotest.py: Actually use NIST-KAT HMAC test vectors and test the right hashes

Previously, this test was entirely a no-op as no vector in the NIST-KAT file
has a precisely 20-byte key.

Additionally, not every vector in the file is SHA1.  The length field
determines the hash under test, and is now decoded correctly.

Finally, due to a limitation I didn't feel like fixing in cryptodev.py, MACs
are truncated to 16 bytes in this test.

With this change and the uncommitted D12437 (to allow key sizes other than
those used in IPSec), the SHA tests in cryptotest.py actually test something
and e.g. at least cryptosoft passes the test.

Sponsored by:        Dell EMC Isilon
Delta File
+43 -7 tests/sys/opencrypto/cryptotest.py
+43 -7 1 file

HardenedBSD — libexec/rtld-elf rtld.c

MFC 323025: Read max_stack_flags from correct object.

'obj' is not initialized here.

Sponsored by:        DARPA / AFRL
Delta File
+1 -1 libexec/rtld-elf/rtld.c
+1 -1 1 file

HardenedBSD — sys/crypto/aesni aesni.c aesni.h

MFC: r285215

remove _NORMAL flag which isn't suppose to be used w/ _alloc_ctx...

MFC: r285289

address an issue where consumers, like IPsec, can reuse the same
session in multiple threads w/o locking..  There was a single fpu
context shared per session, if multiple threads were using the session,
and both migrated away, they could corrupt each other's fpu context...

MFC: r285297

upon further examination, it turns out that _unregister_all already
provides the guarantee that no threads will be in the _newsession code..

MFC: r298332

aesni(4): Initialize error before use [1]

Reported by:        Coverity [1]
CID:                1331554 [1]
Delta File
+100 -27 sys/crypto/aesni/aesni.c
+0 -1 sys/crypto/aesni/aesni.h
+100 -28 2 files

HardenedBSD — share/man/man9 mutex.9 rwlock.9, sys/kern kern_rmlock.c kern_sx.c

MFC: r275751

Add _NEW flag to mtx(9), sx(9), rmlock(9) and rwlock(9).
A _NEW flag passed to _init_flags() to avoid check for double-init.
Delta File
+12 -6 share/man/man9/mutex.9
+9 -3 sys/kern/kern_rmlock.c
+10 -1 share/man/man9/rwlock.9
+10 -1 share/man/man9/rmlock.9
+9 -0 share/man/man9/sx.9
+3 -1 sys/kern/kern_sx.c
+13 -4 8 files not shown
+66 -16 14 files

HardenedBSD — sys/dev/drm2/i915 i915_gem_gtt.c i915_gem.c

Modernize calls to vm_page_unwire().  As of r288122, vm_page_unwire()
accepts PQ_NONE as the specified queue and returns a Boolean indicating
whether the page's wire count transitioned to zero.  Use these features
in dev/drm2.

Reviewed by:        kib, markj
MFC after:        1 week

HardenedBSD — sys/boot/efi/libefi devicename.c

libefi: devicename.c cleanups

Remove duplicated free()+return statements, default unit to 0
and improve strtol error processing.
Delta File
+20 -16 sys/boot/efi/libefi/devicename.c
+20 -16 1 file

HardenedBSD — contrib/tcpdump tcpdump.c addrtoname.c, contrib/traceroute traceroute.c

We use a few different ifdef's names to check if we are using Casper or not,
let's standardize this. Now we are always use WITH_CASPER name.

Discussed with:        emaste@
MFC after:        1 month

HardenedBSD — bin/cat cat.c, bin/cat/tests Makefile

Ammend bin/cat/cat.c so the output is the same aside
from blank lines being numbered or unnumbered, depending on whether cat
was invoked with -ne or -be.

At present, when cat is invoked with -be, there is an aditional
difference that the '$' on blank lines is placed on the far left of the
output.

Discussed in bug 210607.

While here, revert the workaround from r304035 which skipped the unit test for
this issue previously.

PR:                210607
Submitted by:        myself
Reviewed by:        bdrewery
Obtained from:        NetBSD
Relnotes:        yes
Differential Revision:        https://reviews.freebsd.org/D12432
Delta File
+10 -4 bin/cat/cat.c
+0 -6 bin/cat/tests/Makefile
+10 -10 2 files

HardenedBSD — sys/net if_bridge.c

bridge: Set module version

This ensures that the loader will not load the module if it's also built in to
the kernel.

PR:                220860
Submitted by:        Eugene Grosbein <eugen at freebsd.org>
Reported by:        Marie Helene Kvello-Aune <marieheleneka at gmail.com>
Delta File
+1 -0 sys/net/if_bridge.c
+1 -0 1 file

HardenedBSD — usr.bin/ktrdump ktrdump.c

MFC r323439:
Provide an error message if KTR symbols in a vmcore cannot be resolved.
Delta File
+7 -2 usr.bin/ktrdump/ktrdump.c
+7 -2 1 file

HardenedBSD — sys/contrib/octeon-sdk cvmx-l2c.c

MFC r323587: octeon sdk: initialize variable to quiet Clang warning

Clang complains "variable 'dummy' is uninitialized when used here".

Sponsored by:        The FreeBSD Foundation
Delta File
+1 -1 sys/contrib/octeon-sdk/cvmx-l2c.c
+1 -1 1 file

HardenedBSD — lib/libc/net getaddrinfo.3 getaddrinfo.c

MFC r323597:
Handle freeaddrinfo(NULL).

HardenedBSD — tools/tools/nanobsd defaults.sh

Fix up style for consistency.
Delta File
+3 -14 tools/tools/nanobsd/defaults.sh
+3 -14 1 file

HardenedBSD — tools/tools/nanobsd/embedded common

Speling mistakes.

HardenedBSD — sys/netinet sctp_indata.c

No need to wakeup, since sctp_add_to_readq() does it.

MFC after:        1 week
Delta File
+0 -1 sys/netinet/sctp_indata.c
+0 -1 1 file

HardenedBSD — sys/arm64/arm64 pmap.c

MFC r322800:

Remove an unneeded call to pmap_invalidate_all. This was never called as
the anyvalid variable is never set.

Sponsored by:        DARPA, AFRL
Delta File
+0 -4 sys/arm64/arm64/pmap.c
+0 -4 1 file

HardenedBSD — sys/arm64/arm64 pmap.c

MFC r322797:

Fix a bug in pmap_protect where we invalidate the wrong page. With this we
can now remove an unneeded call to invalidate all entries.

Sponsored by:        DARPA, AFRL
Delta File
+1 -4 sys/arm64/arm64/pmap.c
+1 -4 1 file

HardenedBSD — sys/dev/ntb/ntb_hw ntb_hw_plx.c

MFC r323575: Add second entry to LUT on a link side in B2B mode.

Each of two entries on a virtual side should have its counterpart on a
peer's link side.
Delta File
+3 -4 sys/dev/ntb/ntb_hw/ntb_hw_plx.c
+3 -4 1 file

HardenedBSD — sys/contrib/ipfilter/netinet ip_state.c

MFC r323715:

Don't use an apostrophe in a possesive pronoun.

HardenedBSD — sys/contrib/ipfilter/netinet ip_state.c

MFC r323715:

Don't use an apostrophe in a possesive pronoun.

HardenedBSD — sys/modules Makefile

MFC r323539: qlnx: exclude if WITHOUT_SOURCELESS_UCODE set

PR:                222277
Submitted by:        Fabian Keil
Obtained from:        ElectroBSD
Delta File
+1 -1 sys/modules/Makefile
+1 -1 1 file

HardenedBSD — sys/dev/ixgbe if_ix.c

MFC: r320916

Reset unsupported SFP tuneable back to original entry name.
Delta File
+1 -1 sys/dev/ixgbe/if_ix.c
+1 -1 1 file

HardenedBSD — sys/netinet sctputil.c sctp_pcb.c

Protect the address workqueue timer by a mutex.

MFC after:        1 week
Delta File
+13 -9 sys/netinet/sctputil.c
+2 -4 sys/netinet/sctp_pcb.c
+15 -13 2 files

HardenedBSD — sys/cam cam_iosched.c

cam iosched: Call cam_iosched_limiter_init() after ios->current is set to the default

Previously ios->current was set to 0 until the first
cam_iosched_cl_maybe_steer() call.

PR: 221954
Obtained from: ElectroBSD
Submitted by: Fabian Keil
Differential Revision: https://reviews.freebsd.org/D12349
Delta File
+2 -2 sys/cam/cam_iosched.c
+2 -2 1 file

HardenedBSD — sys/cam cam_iosched.c

cam iosched: Schedule cam_iosched_ticker() quanta times per second

Previously callout_reset() was called with a "ticks" value that was
off by one.  As a result cam_iosched_ticker() was called a bit too
frequently: On systems with hz=1000 a quanta value of 200 resulted in
~250 calls and a value of 100 in ~111 calls.

For the "queue_depth" and "bandwidth" limiters the difference doesn't
matter but the "iops" limiter depends on the scheduling to enforce the
correct maximum.

PR: 221956
Obtained from: ElectroBSD
Submitted by: Fabian Keil
Differential Revision: https://reviews.freebsd.org/D12350
Delta File
+3 -3 sys/cam/cam_iosched.c
+3 -3 1 file

HardenedBSD — sys/cam cam_iosched.c

cam iosched: Add a handler for the quanta sysctl to enforce valid values

Invalid values can result in devision-by-zero panics or other
undefined behaviour so lets not allow them.

PR: 221957
Obtained from: ElectroBSD
Submitted by: Fabian Keil
Differential Revision: https://reviews.freebsd.org/D12351
Delta File
+24 -3 sys/cam/cam_iosched.c
+24 -3 1 file

HardenedBSD — sys/cam cam_iosched.c

cam iosched: Use the write queue for BIO_ZONE commands

Use the write queue for BIO_ZONE commands so they can't get executed
ahead of writes that were sent after them. More generally, since they
introduce strong ordering into the list, they need to go to the write
queue (which is the only queue that BIO_ORDERED is honored for at the
moment). In fact, fix mismatch between queueing and dequeueing code by
changing this to queue all non-reads (and non-trims) to the write
queue.

As a side effect this prevents the kernel message:
kernel: Found bio_cmd = 0x9
which cam_iosched_next_bio() emits when finding commands
other than BIO_READ in the read queue.

PR: 221973
Obtained from: ElectroBSD
Submitted by: Fabian Keil
Differential Revision: https://reviews.freebsd.org/D12353
Delta File
+1 -2 sys/cam/cam_iosched.c
+1 -2 1 file

HardenedBSD — contrib/compiler-rt/lib/builtins int_lib.h

MFC 322915: Extend the workaround for LLVM bug 11663 to MIPS N32.

This fixes infinite recursion in /sbin/init for MIPS N32.

Sponsored by:        DARPA / AFRL

HardenedBSD — sys/dev/mly mly.c

MFC 322270: Fix a NULL pointer dereference in mly_user_command().

If mly_user_command fails to allocate a command slot it jumps to an 'out'
label used for error handling.  The error handling code checks for a data
buffer in 'mc->mc_data' to free before checking if 'mc' is NULL.  Fix by
just returning directly if we fail to allocate a command and only using
the 'out' label for subsequent errors when there is actual cleanup to
perform.

PR:                217747
Reported by:        PVS-Studio
Delta File
+2 -4 sys/dev/mly/mly.c
+2 -4 1 file

HardenedBSD — release/tools arm.subr vmimage.subr

MFC r323812:
 Bootstrap etcupdate(8) and mergemaster(8) databases when creating
 virtual machine images and embedded images, similar to what is
 done when extracting base.txz to the target root filesystem in
 a new installation.

Approved by:        re (marius, insta-MFC)
Sponsored by:        The FreeBSD Foundation

HardenedBSD — etc/devd usb.conf

Regenerate usb.conf .

MFC after:        1 week
Delta File
+19 -3 etc/devd/usb.conf
+19 -3 1 file

HardenedBSD — sys/dev/usb usbdevs, sys/dev/usb/quirk usb_quirk.c

MFC r322530 and r323220:
Add new USB quirk(s).

PR:                        221775
PR:                        221328
Sponsored by:                Mellanox Technologies