Skip to content

Commit

Permalink
Merge commit '048231d29e6843ad563329c738a6906a7d823af0' into caprevoke
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksdavis committed Jul 6, 2023
2 parents e01f485 + 048231d commit 17f197f
Show file tree
Hide file tree
Showing 201 changed files with 5,318 additions and 1,846 deletions.
2 changes: 1 addition & 1 deletion .last_merge
Original file line number Diff line number Diff line change
@@ -1 +1 @@
freebsd-main-20230407
freebsd-main-20230414
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ _UNIVERSE_TARGETS= ${TARGETS}
TARGET_ARCHES_arm?= armv6 armv7
TARGET_ARCHES_arm64?= aarch64
TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpc64le ${EXTRA_ARCHES_powerpc}
TARGET_ARCHES_riscv?= riscv64 riscv64sf
TARGET_ARCHES_riscv?= riscv64
.for target in ${TARGETS}
TARGET_ARCHES_${target}?= ${target}
.endfor
Expand Down
8 changes: 3 additions & 5 deletions Makefile.inc1
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ TARGET_TRIPLE_ABI= gnueabi
.endif
.endif
MACHINE_TRIPLE_ABI?= unknown
MACHINE_TRIPLE_MACHINE=${MACHINE_ARCH:S/aarch64c/aarch64/:S/amd64/x86_64/:C/sf$//:S/riscv64c/riscv64/}
MACHINE_TRIPLE_MACHINE=${MACHINE_ARCH:S/aarch64c/aarch64/:S/amd64/x86_64/:S/riscv64c/riscv64/}
MACHINE_TRIPLE?=${MACHINE_TRIPLE_MACHINE}-${MACHINE_TRIPLE_ABI}-freebsd${OS_REVISION}
TARGET_TRIPLE_ABI?= unknown
TARGET_TRIPLE_MACHINE= ${TARGET_ARCH:S/aarch64c/aarch64/:S/amd64/x86_64/:C/sf$//:S/riscv64c/riscv64/}
TARGET_TRIPLE_MACHINE= ${TARGET_ARCH:S/aarch64c/aarch64/:S/amd64/x86_64/:S/riscv64c/riscv64/}
TARGET_TRIPLE?= ${TARGET_TRIPLE_MACHINE}-${TARGET_TRIPLE_ABI}-freebsd${OS_REVISION}
KNOWN_ARCHES?= aarch64/arm64 \
aarch64c/arm64 \
Expand All @@ -177,9 +177,7 @@ KNOWN_ARCHES?= aarch64/arm64 \
powerpc64le/powerpc \
powerpcspe/powerpc \
riscv64/riscv \
riscv64sf/riscv \
riscv64c/riscv \
riscv64sfc/riscv
riscv64c/riscv

.if ${TARGET} == ${TARGET_ARCH}
_t= ${TARGET}
Expand Down
38 changes: 27 additions & 11 deletions bin/cheribsdtest/cheribsdtest_fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@
*/

#if CHERI_SEAL_VIOLATION_EXCEPTION
#define CT_SEAL_VIOLATION_EXCEPTION \
.ct_flags = CT_FLAG_SIGNAL | CT_FLAG_SI_CODE | CT_FLAG_SI_TRAPNO, \
.ct_signum = SIGPROT, \
.ct_si_code = PROT_CHERI_PERM, \
.ct_si_trapno = TRAPNO_CHERI
#define CT_SEAL_VIOLATION_EXCEPTION \
.ct_flags = CT_FLAG_SIGNAL, \
.ct_signum = SIGPROT,
#else
#define CT_SEAL_VIOLATION_EXCEPTION
#endif
Expand Down Expand Up @@ -131,10 +129,19 @@ CHERIBSDTEST(illegal_perm_seal,
cheribsdtest_failure_err("sysctlbyname(security.cheri.sealcap)");
sealcap = cheri_andperm(sealcap, ~CHERI_PERM_SEAL);
sealed = cheri_seal(ip, sealcap);
#if !CHERI_SEAL_VIOLATION_EXCEPTION
if (!cheri_gettag(sealed))
cheribsdtest_success();
/* cheri_seal() should tag-clear on failure on all architectures. */
if (!cheri_gettag(sealed)) {
#if CHERI_SEAL_VIOLATION_EXCEPTION
/*
* For the transition period from trapping to tag-clearing
* semantics for CHERI-RISC-V, we report a SIGPROT here for CI.
* TODO: remove this once we require tag-clearing.
*/
if (csr_read(uccsr) & SCCSR_TAG_CLEARING)
raise(SIGPROT);
#endif
cheribsdtest_success();
}
cheribsdtest_failure_errx("cheri_seal() performed successfully "
"%#lp with bad sealcap %#lp", sealed, sealcap);
}
Expand Down Expand Up @@ -181,10 +188,19 @@ CHERIBSDTEST(illegal_perm_unseal,
sealed = cheri_seal(ip, sealcap);
sealcap = cheri_andperm(sealcap, ~CHERI_PERM_UNSEAL);
unsealed = cheri_unseal(sealed, sealcap);
#if !CHERI_SEAL_VIOLATION_EXCEPTION
if (!cheri_gettag(unsealed))
cheribsdtest_success();
/* cheri_unseal() should tag-clear on failure on all architectures. */
if (!cheri_gettag(unsealed)) {
#if CHERI_SEAL_VIOLATION_EXCEPTION
/*
* For the transition period from trapping to tag-clearing
* semantics for CHERI-RISC-V, we report a SIGPROT here for CI.
* TODO: remove this once we require tag-clearing.
*/
if (csr_read(uccsr) & SCCSR_TAG_CLEARING)
raise(SIGPROT);
#endif
cheribsdtest_success();
}
cheribsdtest_failure_errx("cheri_unseal() performed successfully "
"%#lp with bad unsealcap %#lp", unsealed, sealcap);
}
Expand Down
4 changes: 2 additions & 2 deletions bin/date/date.1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
.\" @(#)date.1 8.3 (Berkeley) 4/28/95
.\" $FreeBSD$
.\"
.Dd February 27, 2023
.Dd April 13, 2023
.Dt DATE 1
.Os
.Sh NAME
Expand Down Expand Up @@ -516,7 +516,7 @@ will display
.Pp
Finally the command:
.Pp
.Dl "date -j -f ""%a %b %d %T %Z %Y"" ""`env LC_ALL=C date`"" ""+%s"""
.Dl "env LC_ALL=C date -j -f ""%a %b %d %T %Z %Y"" ""`env LC_ALL=C date`"" ""+%s"""
.Pp
can be used to parse the output from
.Nm
Expand Down
21 changes: 12 additions & 9 deletions contrib/bsnmp/snmpd/FOKUS-MIB.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
-- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-- SUCH DAMAGE.
--
-- $Begemot: bsnmp/snmpd/FOKUS-MIB.txt,v 1.5 2004/08/06 08:47:08 brandt Exp $
--
-- Begemot private definitions and fokus root.
-- Fokus PEN root module.
--
FOKUS-MIB DEFINITIONS ::= BEGIN

Expand All @@ -37,24 +35,29 @@ IMPORTS
FROM SNMPv2-SMI;

fokus MODULE-IDENTITY
LAST-UPDATED "200202050000Z"
ORGANIZATION "Fraunhofer FOKUS, CATS"
LAST-UPDATED "202304140000Z"
ORGANIZATION "Fraunhofer FOKUS"
CONTACT-INFO
" Hartmut Brandt
" Bjoern Riemer

Postal: Fraunhofer Institute for Open Communication Systems
Kaiserin-Augusta-Allee 31
10589 Berlin
Germany

Fax: +49 30 3463 7352

E-mail: [email protected]"
E-mail: [email protected]"
DESCRIPTION
"The root of the Fokus enterprises tree."
REVISION "202304140000Z"
DESCRIPTION
"Contact info updated."
REVISION "200202050000Z"
DESCRIPTION
"Initial revision."
::= { enterprises 12325 }

--
-- begemot ::= fokus.1
-- contact: [email protected]
--
END
3 changes: 3 additions & 0 deletions contrib/one-true-awk/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,9 @@ int format(char **pbuf, int *pbufsize, const char *s, Node *a) /* printf-like co
case 'c':
flag = 'c';
break;
case '\0':
FATAL("missing printf conversion specifier");
break;
default:
WARNING("weird printf conversion %s", fmt);
flag = '?';
Expand Down
2 changes: 1 addition & 1 deletion contrib/telnet/telnet/telnet.1
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ The host specification may be either a host name (see
.Xr hosts 5 ) ,
an Internet address specified in the \*(Lqdot notation\*(Rq (see
.Xr inet 3 ) ,
or IPv6 host name or IPv6 coloned-hexadecimal addreess.
or IPv6 host name or IPv6 coloned-hexadecimal address.
The
.Fl l
option may be used to specify the user name
Expand Down
4 changes: 2 additions & 2 deletions lib/clang/llvm.build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ TARGET_TRIPLE_ABI=
.endif
VENDOR= unknown

LLVM_TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/sf$//}-${VENDOR}-freebsd${OS_REVISION}${TARGET_TRIPLE_ABI}
LLVM_BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/sf$//}-${VENDOR}-freebsd${OS_REVISION}
LLVM_TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${VENDOR}-freebsd${OS_REVISION}${TARGET_TRIPLE_ABI}
LLVM_BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-${VENDOR}-freebsd${OS_REVISION}

CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${LLVM_TARGET_TRIPLE}\"
CFLAGS+= -DLLVM_HOST_TRIPLE=\"${LLVM_BUILD_TRIPLE}\"
Expand Down
1 change: 0 additions & 1 deletion lib/libbearssl/Makefile.depend
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Autogenerated - do NOT edit!

DIRDEPS = \
gnu/lib/csu \
include \
include/xlocale \
lib/${CSU_DIR} \
Expand Down
4 changes: 0 additions & 4 deletions lib/libc/csu/libc_start1.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ process_irelocs(void)
#error "Define platform reloc type"
#endif

#ifndef CRT_ATEXIT_SUPPRESS
static void
finalizer(void)
{
Expand All @@ -127,7 +126,6 @@ finalizer(void)
_fini();
#endif
}
#endif

static void
handle_static_init(int argc, char **argv, char **env)
Expand All @@ -139,9 +137,7 @@ handle_static_init(int argc, char **argv, char **env)
if (&_DYNAMIC != NULL)
return;

#ifndef CRT_ATEXIT_SUPPRESS
atexit(finalizer);
#endif

array_size = __preinit_array_end - __preinit_array_start;
for (n = 0; n < array_size; n++) {
Expand Down
4 changes: 2 additions & 2 deletions lib/libc/x86/sys/pkru.3
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ flag.
The
.Fn x86_pkru_get_perm
function returns access rights for the key specified by the
.Fn keyidx
.Fa keyidx
argument.
If the value pointed to by
.Fa access
is zero after the call, no read or write permissions is granted for
mappings which are assigned the key
.Fn keyidx .
.Fa keyidx .
If
.Fa access
is not zero, read access is permitted.
Expand Down
2 changes: 1 addition & 1 deletion lib/libclang_rt/compiler-rt-vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SANITIZER_SHAREDIR= ${CLANGDIR}/share
(!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "")
CRTARCH?= armhf
.else
CRTARCH?= ${MACHINE_ARCH:S/amd64/x86_64/:C/sf$//}
CRTARCH?= ${MACHINE_ARCH:S/amd64/x86_64/}
.endif

.if ${COMPILER_TYPE} == "clang"
Expand Down
6 changes: 6 additions & 0 deletions lib/libgcc_eh/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@ STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC
.if ${MK_DIRDEPS_BUILD} == "yes"
# Avoid dependency on lib/libc++
CFLAGS+= -isystem ${SRCTOP}/contrib/subrepo-cheri-libc++/include -nostdinc++

# we need this for __config_site
CFLAGS+= -I${SRCTOP}/lib/cheri-libc++
.if ${.MAKE.LEVEL} > 0
GENDIRDEPS_FILTER+= Nlib/cheri-libc++
.endif
.endif
1 change: 1 addition & 0 deletions lib/libpfctl/libpfctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ pfctl_get_status(int dev)
status->states = nvlist_get_number(nvl, "states");
status->src_nodes = nvlist_get_number(nvl, "src_nodes");
status->syncookies_active = nvlist_get_bool(nvl, "syncookies_active");
status->reass = nvlist_get_number(nvl, "reass");

strlcpy(status->ifname, nvlist_get_string(nvl, "ifname"),
IFNAMSIZ);
Expand Down
3 changes: 2 additions & 1 deletion lib/libpfctl/libpfctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct pfctl_status {
char ifname[IFNAMSIZ];
uint8_t pf_chksum[PF_MD5_DIGEST_LENGTH];
bool syncookies_active;
uint32_t reass;

struct pfctl_status_counters counters;
struct pfctl_status_counters lcounters;
Expand Down Expand Up @@ -347,7 +348,7 @@ struct pfctl_state {
uint32_t creation;
uint32_t expire;
uint32_t pfsync_time;
uint8_t state_flags;
uint16_t state_flags;
uint32_t sync_flags;
};

Expand Down
5 changes: 4 additions & 1 deletion lib/libsecureboot/local.trust.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ VE_SIGNATURE_EXT_LIST+= \
VE_SIGNATURE_LIST+= OPENPGP
VE_SIGNATURE_EXT_LIST+= asc

# allow site override of all the above
.-include "site.trust.mk"

SIGNER ?= ${SB_TOOLS_PATH:U/volume/buildtools/bin}/sign.py

.if exists(${SIGNER})
Expand Down Expand Up @@ -109,7 +112,7 @@ ta.h: vc_rsa.pem
TRUST_ANCHORS!= cd ${.CURDIR} && 'ls' -1 *.pem t*.asc 2> /dev/null
.endif
.if empty(TRUST_ANCHORS) && ${MK_LOADER_EFI_SECUREBOOT} != "yes"
.error Need TRUST_ANCHORS see ${.CURDIR}/README.rst
.error Need TRUST_ANCHORS see ${.PARSEDIR}/README.rst
.endif
.if ${TRUST_ANCHORS:T:Mt*.pem} != ""
ta.h: ${TRUST_ANCHORS:M*.pem}
Expand Down
12 changes: 12 additions & 0 deletions lib/libssp_nonshared/Makefile.depend
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# $FreeBSD$
# Autogenerated - do NOT edit!

DIRDEPS = \
include \


.include <dirdeps.mk>

.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
.endif
4 changes: 2 additions & 2 deletions lib/libsysdecode/sysdecode.3
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ Native FreeBSD binaries.
Supported on all platforms.
.It Li SYSDECODE_ABI_FREEBSD32
32-bit FreeBSD binaries.
Supported on amd64 and powerpc64.
Supported on aarch64, amd64 and powerpc64.
.It Li SYSDECODE_ABI_FREEBSD64
64-bit FreeBSD binaries.
Supported on aarch64c and riscv64c.
.It Li SYSDECODE_ABI_LINUX
Linux binaries of the same platform.
Supported on amd64, i386, and arm64.
Supported on amd64, i386, and aarch64.
.It Li SYSDECODE_ABI_LINUX32
32-bit Linux binaries.
Supported on amd64.
Expand Down
31 changes: 16 additions & 15 deletions libexec/rtld-elf/rtld.c
Original file line number Diff line number Diff line change
Expand Up @@ -2018,23 +2018,20 @@ donelist_check(DoneList *dlp, const Obj_Entry *obj)
}

/*
* Hash function for symbol table lookup. Don't even think about changing
* this. It is specified by the System V ABI.
* SysV hash function for symbol table lookup. It is a slightly optimized
* version of the hash specified by the System V ABI.
*/
unsigned long
Elf32_Word
elf_hash(const char *name)
{
const unsigned char *p = (const unsigned char *) name;
unsigned long h = 0;
unsigned long g;
const unsigned char *p = (const unsigned char *)name;
Elf32_Word h = 0;

while (*p != '\0') {
h = (h << 4) + *p++;
if ((g = h & 0xf0000000) != 0)
h ^= g >> 24;
h &= ~g;
}
return (h);
while (*p != '\0') {
h = (h << 4) + *p++;
h ^= (h >> 24) & 0xf0;
}
return (h & 0x0fffffff);
}

/*
Expand Down Expand Up @@ -6386,13 +6383,16 @@ parse_args(char* argv[], int argc, bool *use_pathp, int *fdp,
_rtld_error("Both -b and -f specified");
rtld_die();
}
if (j != arglen - 1) {
_rtld_error("Invalid options: %s", arg);
rtld_die();
}
i++;
*argv0 = argv[i];
seen_b = true;
break;
} else if (opt == 'd') {
*dir_ignore = true;
break;
} else if (opt == 'f') {
if (seen_b) {
_rtld_error("Both -b and -f specified");
Expand All @@ -6407,7 +6407,8 @@ parse_args(char* argv[], int argc, bool *use_pathp, int *fdp,
* name but the descriptor is what
* will actually be executed).
*
* -f must be the last option in, e.g., -abcf.
* -f must be the last option in the
* group, e.g., -abcf <fd>.
*/
if (j != arglen - 1) {
rtld_fatal("Invalid options: %s", arg);
Expand Down
Loading

0 comments on commit 17f197f

Please sign in to comment.