Displaying 1 50 of 262,875 commits (0.020s)

HardenedBSD — sys/dev/atkbdc psm.c

MFC r328864:

psm(4): Fix panic occuring soon after PS/2 packet has been rejected by
synaptics or elantech sanity checker.

After packet has been rejected contents of packet buffer is not cleared
with setting of inputbytes counter to 0. So when this packet buffer is
filled again being an element of circular queue, new data appends to old
data rather than overwrites it. This leads to packet buffer overflow
after 10 rounds.

Fix it with setting of packet's inputbytes counter to 0 after rejection.

While here add extra logging of rejected packets.

PR:                222667 (for reference)
Reported by:        Neel Chauhan <neel at neelc.org>
Tested by:        Neel Chauhan <neel at neelc.org>
Delta File
+9 -3 sys/dev/atkbdc/psm.c
+9 -3 1 file

HardenedBSD — bin/df df.c

MFC r329092:

Add a deprecation warning when using the feature which mounts devices
to see how much space it on them.

Adjust MOUNT_CHAR_DEVS to allow the free space of already mounted
devices to be displayed and report an appropriate error if the
device isn't mounted.

Reviewed by:        cem
Sponsored by:        DARPA, AFRL
Differential Revision:        https://reviews.freebsd.org/D8801
Delta File
+8 -2 bin/df/df.c
+8 -2 1 file

HardenedBSD — sys/dev/agp agp_i810.c agp_i810.h, sys/modules/agp Makefile

MFC r320851:
Add a helper function to agp(4) which installs a single GTT entry.

HardenedBSD — sys/dev/mpr mpr_sas.c mprvar.h, sys/dev/mps mps_sas.c mps.c

Improve command lifecycle debugging and detection of problems.

Sponsored by:        Netflix

HardenedBSD — sys/x86/iommu intel_gas.c

Don't include DMAR map entry zone items in kernel dumps.

Such items may be allocated in the I/O path used by the dumper,
potentially causing the dump to fail. Since there is some precedent
in the DMAR driver for avoiding this problem using _NODUMP, apply
this workaround to the zone as well.

Reported and tested by:        mmacy
Reviewed by:        kib
MFC after:        1 week
Differential Revision:        https://reviews.freebsd.org/D14422
Delta File
+1 -1 sys/x86/iommu/intel_gas.c
+1 -1 1 file

HardenedBSD — sys/kern sys_capability.c

Use the fdeget_locked function instead of the fget_locked in the
sys_capability.

Reviewed by:        pjd@ (earlier version)
Discussed with:        mjg@
Delta File
+38 -26 sys/kern/sys_capability.c
+38 -26 1 file

HardenedBSD — sys/compat/linuxkpi/common/include/linux radix-tree.h, sys/compat/linuxkpi/common/src linux_radix.c

Implement support for radix_tree_for_each_slot() and radix_tree_exception()
in the LinuxKPI and use unsigned long type for the radix tree index.

MFC after:        1 week
Sponsored by:        Mellanox Technologies

HardenedBSD — sys/netinet tcp_input.c

MFC r329101:
  Reinitialize IP header length after checksum calculation. It is used
  later by TCP-MD5 code.

  This fixes the problem with broken TCP-MD5 over IPv4 when NIC has
  disabled TCP checksum offloading.

  PR:                223835
Delta File
+1 -0 sys/netinet/tcp_input.c
+1 -0 1 file

HardenedBSD — sys/compat/linuxkpi/common/include/linux slab.h

Implement the KMEM_CACHE() function macro in the LinuxKPI.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies
Sponsored by:        Limelight Networks

HardenedBSD — sys/compat/linuxkpi/common/include/linux mm.h, sys/compat/linuxkpi/common/src linux_compat.c

Make the vm_fault structure in the LinuxKPI compatible with
newer versions of the Linux kernel. No functional change.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies
Sponsored by:        Limelight Networks

HardenedBSD — sys/compat/linuxkpi/common/include/linux rcupdate.h

Implement the rcu_dereference_raw() function macro.
Make sure all RCU dereferencing use the READ_ONCE() function macro.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies
Sponsored by:        Limelight Networks

HardenedBSD — sys/compat/linuxkpi/common/include/linux gfp.h

Implement __GFP_BITS_SHIFT and __GFP_BITS_MASK macros in the LinuxKPI.
Add compile time asserts to catch conflicts with native defines.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies
Sponsored by:        Limelight Networks

HardenedBSD — sys/compat/linuxkpi/common/include/linux list.h

Implement __list_del_entry() helper functions in the LinuxKPI.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies
Sponsored by:        Limelight Networks

HardenedBSD — sys/compat/linuxkpi/common/include/linux fs.h

Implement file_inode() and call_mmap() helper functions in the LinuxKPI.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies
Sponsored by:        Limelight Networks

HardenedBSD — sys/compat/linuxkpi/common/include/linux dcache.h fs.h

Refactor dentry structure into its own header file in the LinuxKPI similary
to Linux. No functional change. Implement d_inode() helper function.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies
Sponsored by:        Limelight Networks

HardenedBSD — sys/compat/linuxkpi/common/include/linux ktime.h, sys/compat/linuxkpi/common/src linux_hrtimer.c

Update the ktime type in the LinuxKPI to be a signed 64-bit integer similarly
to Linux, to avoid compilation issues. Implement ktime_get_real_seconds().

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies
Sponsored by:        Limelight Networks

HardenedBSD — sys/arm/conf IMX53 IMX6, sys/modules Makefile

Build modules specific to imx5/imx6 only when building those kernels.

This adds sys/modules/imx with a SUBDIR makefile to make the whole
collection of modules that are specific to these SoCs.  Initially, that
"whole collection" consists of the if_ffec and imx_i2c drivers.

The if_ffec driver is referenced in its existing home in ../ffec rather
than moving it into the imx directory, because it's used by powerpc too,
but it is no longer built for all armv6/7 systems.

The imx_i2c driver is newly added as a module.

HardenedBSD — share/man/man9 pmap_qenter.9

HBSD MFC r329330: pmap_qenter.9: Clarify that not all arch can map NX

The goal is to use security features when architectures provide them.

Reported by:        kib
Sponsored by:        Dell EMC Isilon

(cherry picked from commit a5bf3460927a2827f40102cc53dada6d62ffd3b8)

Author: cem <cem at FreeBSD.org>
Original-commit-date: Thu Feb 15 18:19:25 2018 +0000
svn-commit-id: /head/ r329330
Signed-off-by: Oliver Pinter <oliver.pinter at hardenedbsd.org>
Delta File
+3 -2 share/man/man9/pmap_qenter.9
+3 -2 1 file

HardenedBSD — share/man/man9 pmap_qenter.9

HBSD MFC r329282: pmap_qenter.9: Document API NX mapping

A follow-up to r329281.

Sponsored by:        Dell EMC Isilon

(cherry picked from commit 8840fda67c8c279c16c90fe501a5599034744446)

Author: cem <cem at FreeBSD.org>
Original-commit-date: Wed Feb 14 23:47:04 2018 +0000
svn-commit-id: /head/ r329282
Signed-off-by: Oliver Pinter <oliver.pinter at hardenedbsd.org>
Delta File
+2 -1 share/man/man9/pmap_qenter.9
+2 -1 1 file

HardenedBSD — sys/amd64/amd64 pmap.c, sys/i386/i386 pmap.c

HBSD MFC r329281: x86 pmap: Make memory mapped via pmap_qenter() non-executable

The idea is, the pmap_qenter() API is now defined to not produce executable
mappings.  If you need executable mappings, use another API.

Add pg_nx flag in pmap_qenter on x86 to make kernel pages non-executable.

Other architectures that support execute-specific permissons on page table
entries should subsequently be updated to match.

Submitted by:        Darrick Lew <darrick.freebsd AT gmail.com>
Reviewed by:        markj
Discussed with:        alc, jhb, kib
Sponsored by:        Dell EMC Isilon
Differential Revision:        https://reviews.freebsd.org/D14062

(cherry picked from commit 47a3cad5ce7bdae97264a815baeb2fcd38093e4b)

Author: cem <cem at FreeBSD.org>
Original-commit-date: Wed Feb 14 23:35:47 2018 +0000
svn-commit-id: /head/ r329281
Signed-off-by: Oliver Pinter <oliver.pinter at hardenedbsd.org>
Delta File
+4 -0 sys/i386/i386/pmap.c
+1 -1 sys/amd64/amd64/pmap.c
+5 -1 2 files

HardenedBSD — sys/amd64/amd64 pmap.c

HBSD: Resolve merge conflict

Signed-off-by:        Shawn Webb <shawn.webb at hardenedbsd.org>
Sponsored-by:        SoldierX
Delta File
+2 -12 sys/amd64/amd64/pmap.c
+2 -12 1 file

HardenedBSD — sys/compat/linuxkpi/common/include/linux spinlock.h

Implement spin_trylock_irq() function macro in the LinuxKPI.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies

HardenedBSD — sys/compat/linuxkpi/common/include/linux lockdep.h

Stub more lockdep function macros in the LinuxKPI.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies

HardenedBSD — sys/compat/linuxkpi/common/include/linux pid.h

Implement get_task_pid() function macro in the LinuxKPI.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies

HardenedBSD — stand/liblua lstd.c lstd.h

liblua: Emulate DIR, opendir, fdopendir, closedir

In a similar fashion to FILE, provide thin shims for the standard directory
manipulation functions.

Reviewed by:        imp
Sponsored by:        Dell EMC Isilon
Differential Revision:        https://reviews.freebsd.org/D14417
Delta File
+36 -0 stand/liblua/lstd.c
+8 -0 stand/liblua/lstd.h
+44 -0 2 files

HardenedBSD — stand/liblua lutils.c lutils.h

liblua: Clean up io/loader C module registration

Utilize registration APIs Lua provides to make module definition a little
cleaner.

Discussed with:        imp
Sponsored by:        Dell EMC Isilon
Delta File
+26 -51 stand/liblua/lutils.c
+0 -1 stand/liblua/lutils.h
+26 -52 2 files

HardenedBSD — sys/compat/linuxkpi/common/include/linux uaccess.h

Allow the put_user() function macro to put constant values by using the
existing __put_user() macro.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies

HardenedBSD — sys/compat/linuxkpi/common/include/linux kernel.h

Implement BUILD_BUG_ON_INVALID() function macro in the LinuxKPI.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies

HardenedBSD — sys/compat/linuxkpi/common/include/linux printk.h

Add support for printk_ratelimit() function macro and improve the existing
printk_ratelimited() function macro to return a boolean stating if there
was a printout, true, or not, false.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies

HardenedBSD — sys/powerpc/aim mmu_oea64.c aim_machdep.c, sys/powerpc/booke pmap.c booke_machdep.c

Merge AIM and Book-E PCPU fields

This is part of a long-term goal of merging Book-E and AIM into a single GENERIC
kernel.  As more work is done, the struct may be optimized further.

Reviewed by:        nwhitehorn

HardenedBSD — sys/compat/linuxkpi/common/include/linux kref.h

Add support for kref_read() function in the LinuxKPI.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies

HardenedBSD — sys/compat/linuxkpi/common/include/linux mm_types.h

Add support for mmgrab() function in the LinuxKPI.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies

HardenedBSD — sys/compat/linuxkpi/common/include/linux compiler.h

Add support for __percpu and __weak macros in the LinuxKPI.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies

HardenedBSD — sys/compat/linuxkpi/common/include/linux irqreturn.h device.h

Move the IRQ_RETVAL() and irqreturn definitions to irqreturn.h in the
LinuxKPI to be compatible with Linux. No functional change.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies

HardenedBSD — sys/compat/linuxkpi/common/include/linux interrupt.h

Add checks for valid IRQ tag before setting up or tearing down an interrupt
handler in the LinuxKPI. This is needed when the interrupt handler is disabled
before freeing the interrupt.

MFC after:        1 week
Submitted by:        Johannes Lundberg <johalun0 at gmail.com>
Sponsored by:        Mellanox Technologies

HardenedBSD — sys/arm/allwinner aw_mmc.c

aw_mmc: Only change the clock if it has really changed

This also seems to fix problem when booting Pine64 from the mmc.

Tested On:        Pine64
Tested On:        Pine64-LTS
Delta File
+3 -2 sys/arm/allwinner/aw_mmc.c
+3 -2 1 file

HardenedBSD — sys/amd64/amd64 pmap.c exception.S, sys/amd64/ia32 ia32_exception.S ia32_syscall.c

MFC r328083,328096,328116,328119,328120,328128,328135,328153,328157,
328166,328177,328199,328202,328205,328468,328470,328624,328625,328627,
328628,329214,329297,329365:

Meltdown mitigation by PTI, PCID optimization of PTI, and kernel use of IBRS
for some mitigations of Spectre.

Tested by:      emaste, Arshan Khanifar <arshankhanifar at gmail.com>
Discussed with:        jkim
Sponsored by:        The FreeBSD Foundation
Delta File
+545 -29 sys/amd64/amd64/pmap.c
+376 -173 sys/amd64/amd64/exception.S
+204 -17 sys/amd64/amd64/mp_machdep.c
+131 -63 sys/amd64/include/asmacros.h
+74 -98 sys/amd64/amd64/apic_vector.S
+80 -35 sys/amd64/amd64/machdep.c
+503 -99 41 files not shown
+1,913 -514 47 files

HardenedBSD — sys/dev/usb usb_lookup.c

Remove unused bus_autoconf section from usb.ko.

Sponsored by:        Mellanox Technologies
Delta File
+0 -67 sys/dev/usb/usb_lookup.c
+0 -67 1 file

HardenedBSD — tools/tools/bus_autoconf bus_usb.c bus_sections.c

Remove obsolete tool, bus_autoconf, which is replaced by devmatch(8).

HardenedBSD — sbin/devmatch devmatch.c

Fix USB driver matching in devmatch(8).

Multiple drivers can match on the same USB device and the order of loading
decides which driver gets the device. Use the supplied mask value as an
indication of priority, so that vendor specific device drivers are loaded
before more generic ones.

Sponsored by:        Mellanox Technologies
Delta File
+63 -2 sbin/devmatch/devmatch.c
+63 -2 1 file

HardenedBSD — stand/lua config.lua

stand/lua: dumpModules => lsModules

rgrimes@ notes that this behavior is more befitting of the latter name than
the former, and I'm inclined to agree.

Reported by:        rgrimes
Delta File
+1 -1 stand/lua/config.lua
+1 -1 1 file

HardenedBSD — etc/rc.d devmatch

Fix handling of "one_nomatch" shell variable to preserve its contents
appearing as a single argument passed to devmatch(8).

Don't depend on "sort" utility from usr/bin which might not be
available when devd is started.

Sponsored by:        Mellanox Technologies
Delta File
+7 -3 etc/rc.d/devmatch
+7 -3 1 file

HardenedBSD — etc/devd devmatch.conf

Invoke devmatch rc.d script directly instead of depending on "service"
which is installed in usr/sbin and might not be available at the time
devd is started.

Sponsored by:        Mellanox Technologies
Delta File
+1 -1 etc/devd/devmatch.conf
+1 -1 1 file

HardenedBSD — sys/dev/usb usb_hub.c

Revert redundant parts of r329440 after recent devmatch(8) changes.

Sponsored by:        Mellanox Technologies
Delta File
+1 -9 sys/dev/usb/usb_hub.c
+1 -9 1 file

HardenedBSD — bin/uuidgen uuidgen.c

Capsicumize uuidgen.
Delta File
+9 -0 bin/uuidgen/uuidgen.c
+9 -0 1 file

HardenedBSD — lib/libcasper/libcasper libcasper.c libcasper.h, lib/libcasper/services/cap_dns cap_dns.c Makefile

Introduce channel flags in libcasper.

Instead of passing flags (which describe a type of nvlist)
every send/recv we remember them in channel.
It's enough for use to extract them only during unwrap.
This simplify use of Casper.

Reviewed by:        bruffer@, bcr@ (both man page)
Differential Revision:        https://reviews.freebsd.org/D14196 (man page)

HardenedBSD — sys/kern kern_rwlock.c kern_sx.c, sys/sys lockstat.h

Undo LOCK_PROFILING pessimisation after r313454 and r313455

With the option used to compile the kernel both sx and rw shared ops would
always go to the slow path which added avoidable overhead even when the
facility is disabled.

Furthermore the increased time spent doing uncontested shared lock acquire
would be bogusly added to total wait time, somewhat skewing the results.

Restore old behaviour of going there only when profiling is enabled.

This change is a no-op for kernels without LOCK_PROFILING (which is the
default).

HardenedBSD — sys/sys param.h

Bump the FreeBSD version after r329383 to indicate that the
cmpxchg() macro is now fully functional in the LinuxKPI.

This is a direct commit.

Sponsored by:   Mellanox Technologies
Delta File
+1 -1 sys/sys/param.h
+1 -1 1 file

HardenedBSD — stand/lua config.lua

stand/lua: Correct test sense, this should have been 'not nil'
Delta File
+1 -1 stand/lua/config.lua
+1 -1 1 file

HardenedBSD — stand/lua config.lua

stand/lua: Address some nits

1.) Instead of string.function(s, ...), use s:function(...)
2.) Don't try to concatenate `res`, it was just tested to be nil
3.) Note that "Loading configuration" is configured modules, and be a little
more precise in mentioning what failed ("loading of one or more modules")
Delta File
+12 -12 stand/lua/config.lua
+12 -12 1 file