bsdiff: fix off-by-one errorThe program reads oldsize bytes from oldfile, and proceeds to initializea suffix array of oldsize elements using divsufsort(). As per thefunction's API [1], array indi
bsdiff: fix off-by-one errorThe program reads oldsize bytes from oldfile, and proceeds to initializea suffix array of oldsize elements using divsufsort(). As per thefunction's API [1], array indices 0 through n-1 are initialized.Later, search() is called, but with index bounds [0, n]. Depending onthe contents of the malloc'd buffer, accessing this uninitialized indexat the end of can result in a segmentation fault. Fix this by passingoldsize-1 to search(), limiting the search bounds to [0, n-1].This bug is a result of r303285, which introduced divsufsort() as analternate suffix sorting function to the existing qsufsort(). It seemsthat qsufsort() did initialize the final empty element, meaning it couldbe safely accessed. This difference in the implementations was missed atthe time.[1] https://github.com/y-256/libdivsufsortDiscussed with: cpercivaMFC after: 1 weekSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D26911
show more ...
bspatch: add integer overflow checksIntroduce a new add_off_t static function that exits with an errormessage if there's an overflow, otherwise returns their sum. Use thiswhen adding values obta
bspatch: add integer overflow checksIntroduce a new add_off_t static function that exits with an errormessage if there's an overflow, otherwise returns their sum. Use thiswhen adding values obtained from the input patch.Reviewed by: delphij, allanjude (earlier)MFC after: 1 weekSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D7897
errno.h is no longer needed as of r340239 so remove it.No MFC planned as that revision was not merged.
Remove support for FreeBSD 10.x.MFC after: 1 month
bspatch: simplify capsicumizationAssume that user wants to run with capsicum support if he builds the softwarewith HAVE_CAPSICUM. Treat running application without capsicum in the kernel asan err
bspatch: simplify capsicumizationAssume that user wants to run with capsicum support if he builds the softwarewith HAVE_CAPSICUM. Treat running application without capsicum in the kernel asan error.MFC after: 3 weeks
various: general adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - error
various: general adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.No functional change intended.
DIRDEPS_BUILD: Update dependencies.Sponsored by: Dell EMC Isilon
Revert debugging that was accidently committed in r316314
fix top(1) ZFS compressed ARC supporttop(1) read the wrong amount of data from sysctl, uint64_t instead ofboolean_t, resulting in the stats not showing in many cases.X-MFC-With: r315435Sponsore
fix top(1) ZFS compressed ARC supporttop(1) read the wrong amount of data from sysctl, uint64_t instead ofboolean_t, resulting in the stats not showing in many cases.X-MFC-With: r315435Sponsored by: ScaleEngine Inc.
Adopt SRCTOP in usr.binPrefer ${SRCTOP}/foo over ${.CURDIR}/../../foo and ${SRCTOP}/usr.bin/fooover ${.CURDIR}/../foo for paths in Makefiles.Differential Revision: https://reviews.freebsd.org/D9
Adopt SRCTOP in usr.binPrefer ${SRCTOP}/foo over ${.CURDIR}/../../foo and ${SRCTOP}/usr.bin/fooover ${.CURDIR}/../foo for paths in Makefiles.Differential Revision: https://reviews.freebsd.org/D9932Sponsored by: NetflixSilence on: arch@ (twice)
bspatch: Remove backwards-compatibility sys/capability.h supportbspatch previously included sys/capability.h or sys/capsicum.h basedon __FreeBSD_version, as FreeBSD is the upstream for bsdiff and
bspatch: Remove backwards-compatibility sys/capability.h supportbspatch previously included sys/capability.h or sys/capsicum.h basedon __FreeBSD_version, as FreeBSD is the upstream for bsdiff and we maysee this file incorporated into other third-party software.The Capsicum header is now installed as sys/capsicum.h in stable/10 andFreeBSD 10.3, so we can just use sys/capsicum.h and simplify the logic.Reviewed by: allanjudeDifferential Revision: https://reviews.freebsd.org/D7954
bspatch: use #define for header size instead of magic numberReviewed by: allanjude, kibSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D7861
bspatch: remove superfluous newlines from errx strings
bspatch: add sanity checks on sizes to avoid integer overflowNote that this introduces an explicit 2GB limit, but this was alreadyimplicit in variable and function argument types.This is based o
bspatch: add sanity checks on sizes to avoid integer overflowNote that this introduces an explicit 2GB limit, but this was alreadyimplicit in variable and function argument types.This is based on the "non-cryptanalytic attacks against freebsdupdate components" anonymous gist. Further refinement is planned.Reviewed by: allanjude, cem, kibObtained from: anonymous gistMFC after: 3 daysSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D7619
bspatch: remove output file in the case of errorReviewed by: oshogboSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D7644
Capsicumize bspatchMove all of the fopen() and open() calls to the top of main()Restrict each FD to least privilege (read/seek only, write only, etc)cap_enter(), and make all except the output
Capsicumize bspatchMove all of the fopen() and open() calls to the top of main()Restrict each FD to least privilege (read/seek only, write only, etc)cap_enter(), and make all except the output FD read/seek only.Reviewed by: emaste, ed, oshogbo, delphijApproved by: soMFC after: 3 daysRelnotes: yesSponsored by: ScaleEngine Inc.Differential Revision: https://reviews.freebsd.org/D7358
bspatch: apply style(9)Make style changes (and trivial refactoring of open calls) now in orderto reduce noise in diffs for future capsicum changes.Reviewed by: oshogboNo objection: cpercivaSpo
bspatch: apply style(9)Make style changes (and trivial refactoring of open calls) now in orderto reduce noise in diffs for future capsicum changes.Reviewed by: oshogboNo objection: cpercivaSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D7610
Fix bspatch heap overflow vulnerability.Obtained from: ChromiumReported by: Lu Tung-PinSecurity: FreeBSD-SA-16:25.bspatch
Change bsdiff to use divsufsort suffix sort library instead of qsufsort,which is more efficient.Note that for now we do not create a separate library for libdivsufsortbecause it's not used anywhe
Change bsdiff to use divsufsort suffix sort library instead of qsufsort,which is more efficient.Note that for now we do not create a separate library for libdivsufsortbecause it's not used anywhere else.Obtained from: ChromiumMFC after: 2 months
Cleanup unnecessary semicolons from utilities we all love.
Check for (old|new)size + 1 overflows off_t.PR: 204230MFC after: 1 week
Use meaningful errno for ssize_t overflow in read().Catch size_t overflow in malloc().PR: 204230MFC after: 1 week
Fix typo when deregistering the VLAN unconfig event handlerSubmitted by: Masao Uebayashi <[email protected]>MFC after: 3 days
dirdeps.mk now sets DEP_RELDIR
Fix a lock up where we enter swapper() with interrupts disabled.In smp_rendezvous_cpus we expect to wait for all cpus to entersmp_rendezvous_action. If we call this holding a proc lock swapper may
Fix a lock up where we enter swapper() with interrupts disabled.In smp_rendezvous_cpus we expect to wait for all cpus to entersmp_rendezvous_action. If we call this holding a proc lock swapper mayattempt to also lock it, however as interrupts are disabled the cpu neverhandles the ipi. Because smp_rendezvous_action waits for all signaledcpus before contining it may get caught waiting for the cpu running swapperas the proc mutex will be unlocked after smp_rendezvous_cpus finishes.The fix is to enable interrupts in the configure stage as we should bedoing.MFC after: 1 week
12