From owner-svn-src-stable-12@freebsd.org Thu Jan 30 16:11:22 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABFBC23D668; Thu, 30 Jan 2020 16:11:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487lhp4hxyz4HrN; Thu, 30 Jan 2020 16:11:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BF4727794; Thu, 30 Jan 2020 16:11:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00UGBMj6067598; Thu, 30 Jan 2020 16:11:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UGBJWp067583; Thu, 30 Jan 2020 16:11:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001301611.00UGBJWp067583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 30 Jan 2020 16:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357296 - in stable/12: cddl/lib/libdtrace contrib/libxo/tests/gettext contrib/libxo/tests/gettext/po/pig_latin contrib/llvm-project/libcxx/include contrib/openbsm/libbsm contrib/openbs... X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12: cddl/lib/libdtrace contrib/libxo/tests/gettext contrib/libxo/tests/gettext/po/pig_latin contrib/llvm-project/libcxx/include contrib/openbsm/libbsm contrib/openbsm/sys/bsm lib/libc/gen li... X-SVN-Commit-Revision: 357296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 16:11:22 -0000 Author: mav Date: Thu Jan 30 16:11:19 2020 New Revision: 357296 URL: https://svnweb.freebsd.org/changeset/base/357296 Log: MFC r343111,343113-343115 (by mckusick): Create new EINTEGRITY error with message "Integrity check failed". An integrity check such as a check-hash or a cross-correlation failed. The integrity error falls between EINVAL that identifies errors in parameters to a system call and EIO that identifies errors with the underlying storage media. EINTEGRITY is typically raised by intermediate kernel layers such as a filesystem or an in-kernel GEOM subsystem when they detect inconsistencies. Uses include allowing the mount(8) command to return a different exit value to automate the running of fsck(8) during a system boot. These changes make no use of the new error, they just add it. Later commits will be made for the use of the new error number and it will be added to additional manual pages as appropriate. Approved by: mckusick Modified: stable/12/cddl/lib/libdtrace/errno.d stable/12/contrib/libxo/tests/gettext/po/pig_latin/strerror.po stable/12/contrib/libxo/tests/gettext/strerror.pot stable/12/contrib/llvm-project/libcxx/include/__errc stable/12/contrib/llvm-project/libcxx/include/errno.h stable/12/contrib/openbsm/libbsm/bsm_errno.c stable/12/contrib/openbsm/sys/bsm/audit_errno.h stable/12/lib/libc/gen/errlst.c stable/12/lib/libc/nls/C.msg stable/12/lib/libc/sys/intro.2 stable/12/stand/liblua/lerrno.c stable/12/sys/bsm/audit_errno.h stable/12/sys/compat/cloudabi/cloudabi_errno.c stable/12/sys/compat/linux/linux_errno.inc stable/12/sys/security/audit/bsm_errno.c stable/12/sys/sys/errno.h Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/lib/libdtrace/errno.d ============================================================================== --- stable/12/cddl/lib/libdtrace/errno.d Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/cddl/lib/libdtrace/errno.d Thu Jan 30 16:11:19 2020 (r357296) @@ -225,7 +225,9 @@ inline int ENOTRECOVERABLE = 95; #pragma D binding "1.13" ENOTRECOVERABLE inline int EOWNERDEAD = 96; #pragma D binding "1.13" EOWNERDEAD -inline int ELAST = 96; +inline int EINTEGRITY = 96; +#pragma D binding "1.13" EINTEGRITY +inline int ELAST = 97; #pragma D binding "1.0" ELAST inline int ERESTART = -1; #pragma D binding "1.0" ERESTART @@ -340,6 +342,7 @@ inline string strerror[int errno] = errno == ECAPMODE ? "Not permitted in capability mode" : errno == ENOTRECOVERABLE ? "State not recoverable" : errno == EOWNERDEAD ? "Previous owner died" : + errno == EINTEGRITY ? "Integrity check failed" : errno == ERESTART ? "restart syscall" : errno == EJUSTRETURN ? "don't modify regs, just return" : errno == ENOIOCTL ? "ioctl not handled by this layer" : Modified: stable/12/contrib/libxo/tests/gettext/po/pig_latin/strerror.po ============================================================================== --- stable/12/contrib/libxo/tests/gettext/po/pig_latin/strerror.po Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/contrib/libxo/tests/gettext/po/pig_latin/strerror.po Thu Jan 30 16:11:19 2020 (r357296) @@ -457,3 +457,7 @@ msgstr "Atestay otnay ecoverableray" # 96 - EOWNERDEAD msgid "Previous owner died" msgstr "Eviouspray ownerway iedday" + +# 97 - EINTEGRITY +msgid "Integrity check failed" +msgstr "integrityyay eckchay ailedfay" Modified: stable/12/contrib/libxo/tests/gettext/strerror.pot ============================================================================== --- stable/12/contrib/libxo/tests/gettext/strerror.pot Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/contrib/libxo/tests/gettext/strerror.pot Thu Jan 30 16:11:19 2020 (r357296) @@ -466,3 +466,7 @@ msgstr "" # 96 - EOWNERDEAD msgid "Previous owner died" msgstr "" + +# 97 - EINTEGRITY +msgid "Integrity check failed" +msgstr "" Modified: stable/12/contrib/llvm-project/libcxx/include/__errc ============================================================================== --- stable/12/contrib/llvm-project/libcxx/include/__errc Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/contrib/llvm-project/libcxx/include/__errc Thu Jan 30 16:11:19 2020 (r357296) @@ -45,6 +45,7 @@ enum class errc identifier_removed, // EIDRM illegal_byte_sequence, // EILSEQ inappropriate_io_control_operation, // ENOTTY + integrity_check_failed, // EINTEGRITY interrupted, // EINTR invalid_argument, // EINVAL invalid_seek, // ESPIPE @@ -142,6 +143,7 @@ _LIBCPP_DECLARE_STRONG_ENUM(errc) identifier_removed = EIDRM, illegal_byte_sequence = EILSEQ, inappropriate_io_control_operation = ENOTTY, + integrity_check_failed = EINTEGRITY, interrupted = EINTR, invalid_argument = EINVAL, invalid_seek = ESPIPE, Modified: stable/12/contrib/llvm-project/libcxx/include/errno.h ============================================================================== --- stable/12/contrib/llvm-project/libcxx/include/errno.h Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/contrib/llvm-project/libcxx/include/errno.h Thu Jan 30 16:11:19 2020 (r357296) @@ -32,49 +32,79 @@ Macros: #ifdef __cplusplus -#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) +#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) || !defined(EINTEGRITY) -#ifdef ELAST +#if defined(ELAST) static const int __elast1 = ELAST+1; static const int __elast2 = ELAST+2; +static const int __elast3 = ELAST+3; #else static const int __elast1 = 104; static const int __elast2 = 105; +static const int __elast3 = 106; #endif -#ifdef ENOTRECOVERABLE +#if !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) +#define ENOTRECOVERABLE __elast1 +#define EOWNERDEAD __elast2 +#define EINTEGRITY __elast3 +#if defined(ELAST) +#undef ELAST +#define ELAST EINTEGRITY +#endif +#elif !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY) +#define ENOTRECOVERABLE __elast1 +#define EOWNERDEAD __elast2 +#if defined(ELAST) +#undef ELAST +#define ELAST EOWNERDEAD +#endif + +#elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) #define EOWNERDEAD __elast1 +#define EINTEGRITY __elast2 +#if defined(ELAST) +#undef ELAST +#define ELAST EINTEGRITY +#endif -#ifdef ELAST +#elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && defined(EINTEGRITY) +#define EOWNERDEAD __elast1 +#if defined(ELAST) #undef ELAST #define ELAST EOWNERDEAD #endif -#elif defined(EOWNERDEAD) +#elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) +#define ENOTRECOVERABLE __elast1 +#define EINTEGRITY __elast2 +#if defined(ELAST) +#undef ELAST +#define ELAST EINTEGRITY +#endif +#elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY) #define ENOTRECOVERABLE __elast1 -#ifdef ELAST +#if defined(ELAST) #undef ELAST #define ELAST ENOTRECOVERABLE #endif -#else // defined(EOWNERDEAD) - -#define EOWNERDEAD __elast1 -#define ENOTRECOVERABLE __elast2 -#ifdef ELAST +#elif defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) +#define EINTEGRITY __elast1 +#if defined(ELAST) #undef ELAST -#define ELAST ENOTRECOVERABLE +#define ELAST EINTEGRITY #endif -#endif // defined(EOWNERDEAD) +#endif // !defined(OWNERDEAD) && !defined(NOTRECOVERABLE) && !defined(INTEGRITY) -#endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) +#endif // !defined(OWNERDEAD) || !defined(NOTRECOVERABLE) || !defined(INTEGRITY) // supply errno values likely to be missing, particularly on Windows @@ -390,6 +420,10 @@ static const int __elast2 = 105; #ifndef EMLINK #define EMLINK 9979 +#endif + +#ifndef EINTEGRITY +#define EINTEGRITY 9980 #endif #endif // __cplusplus Modified: stable/12/contrib/openbsm/libbsm/bsm_errno.c ============================================================================== --- stable/12/contrib/openbsm/libbsm/bsm_errno.c Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/contrib/openbsm/libbsm/bsm_errno.c Thu Jan 30 16:11:19 2020 (r357296) @@ -239,6 +239,13 @@ static const struct bsm_errno bsm_errnos[] = { ERRNO_NO_LOCAL_MAPPING, #endif ES("Process died with the lock") }, + { BSM_ERRNO_EINTEGRITY, +#ifdef EINTEGRITY + EINTEGRITY, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Integrity check failed") }, { BSM_ERRNO_ENOTRECOVERABLE, #ifdef ENOTRECOVERABLE ENOTRECOVERABLE, Modified: stable/12/contrib/openbsm/sys/bsm/audit_errno.h ============================================================================== --- stable/12/contrib/openbsm/sys/bsm/audit_errno.h Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/contrib/openbsm/sys/bsm/audit_errno.h Thu Jan 30 16:11:19 2020 (r357296) @@ -204,6 +204,7 @@ #define BSM_ERRNO_EKEYREJECTED 222 /* Linux-specific. */ #define BSM_ERRNO_ENOTCAPABLE 223 /* FreeBSD-specific. */ #define BSM_ERRNO_ECAPMODE 224 /* FreeBSD-specific. */ +#define BSM_ERRNO_EINTEGRITY 225 /* FreeBSD-specific. */ /* * In the event that OpenBSM doesn't have a file representation of a local Modified: stable/12/lib/libc/gen/errlst.c ============================================================================== --- stable/12/lib/libc/gen/errlst.c Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/lib/libc/gen/errlst.c Thu Jan 30 16:11:19 2020 (r357296) @@ -158,12 +158,12 @@ const char *const sys_errlist[] = { "Not permitted in capability mode", /* 94 - ECAPMODE */ "State not recoverable", /* 95 - ENOTRECOVERABLE */ "Previous owner died", /* 96 - EOWNERDEAD */ + "Integrity check failed", /* 97 - EINTEGRITY */ /* * Reserved space in sys_errlist, take the next slot for a next error code. * Reserve prevents the array size from changing for some time. */ - __uprefix, /* 97 */ __uprefix, /* 98 */ __uprefix, /* 99 */ __uprefix, /* 100 */ Modified: stable/12/lib/libc/nls/C.msg ============================================================================== --- stable/12/lib/libc/nls/C.msg Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/lib/libc/nls/C.msg Thu Jan 30 16:11:19 2020 (r357296) @@ -197,6 +197,8 @@ $ ENOTRECOVERABLE 95 State not recoverable $ EOWNERDEAD 96 Previous owner died +$ EINTEGRITY +97 Integrity check failed $ $ strsignal() support catalog $ Modified: stable/12/lib/libc/sys/intro.2 ============================================================================== --- stable/12/lib/libc/sys/intro.2 Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/lib/libc/sys/intro.2 Thu Jan 30 16:11:19 2020 (r357296) @@ -472,6 +472,20 @@ The system call or operation is not permitted for capa The state protected by a robust mutex is not recoverable. .It Er 96 EOWNERDEAD Em "Previous owner died" . The owner of a robust mutex terminated while holding the mutex lock. +.It Er 97 EINTEGRITY Em "Integrity check failed" . +An integrity check such as a check-hash or a cross-correlation failed. +The integrity error falls between +.Er EINVAL +that identifies errors in parameters to a system call and +.Er EIO +that identifies errors with the underlying storage media. +It is typically raised by intermediate kernel layers such as a +filesystem or an in-kernel GEOM subsystem when they detect inconsistencies. +Uses include allowing the +.Xr mount 8 +command to return a different exit value to automate the running of +.Xr fsck 8 +during a system boot. .El .Sh DEFINITIONS .Bl -tag -width Ds Modified: stable/12/stand/liblua/lerrno.c ============================================================================== --- stable/12/stand/liblua/lerrno.c Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/stand/liblua/lerrno.c Thu Jan 30 16:11:19 2020 (r357296) @@ -146,6 +146,7 @@ static const struct err_name_number { ENTRY(ECAPMODE), ENTRY(ENOTRECOVERABLE), ENTRY(EOWNERDEAD), + ENTRY(EINTEGRITY), ENTRY(ELAST), ENTRY(ERESTART), ENTRY(EJUSTRETURN), Modified: stable/12/sys/bsm/audit_errno.h ============================================================================== --- stable/12/sys/bsm/audit_errno.h Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/sys/bsm/audit_errno.h Thu Jan 30 16:11:19 2020 (r357296) @@ -208,6 +208,7 @@ #define BSM_ERRNO_EKEYREJECTED 222 /* Linux-specific. */ #define BSM_ERRNO_ENOTCAPABLE 223 /* FreeBSD-specific. */ #define BSM_ERRNO_ECAPMODE 224 /* FreeBSD-specific. */ +#define BSM_ERRNO_EINTEGRITY 225 /* FreeBSD-specific. */ /* * In the event that OpenBSM doesn't have a file representation of a local Modified: stable/12/sys/compat/cloudabi/cloudabi_errno.c ============================================================================== --- stable/12/sys/compat/cloudabi/cloudabi_errno.c Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/sys/compat/cloudabi/cloudabi_errno.c Thu Jan 30 16:11:19 2020 (r357296) @@ -63,6 +63,7 @@ cloudabi_convert_errno(int error) [EIDRM] = CLOUDABI_EIDRM, [EILSEQ] = CLOUDABI_EILSEQ, [EINPROGRESS] = CLOUDABI_EINPROGRESS, + [EINTEGRITY] = CLOUDABI_EINVAL, [EINTR] = CLOUDABI_EINTR, [EINVAL] = CLOUDABI_EINVAL, [EIO] = CLOUDABI_EIO, Modified: stable/12/sys/compat/linux/linux_errno.inc ============================================================================== --- stable/12/sys/compat/linux/linux_errno.inc Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/sys/compat/linux/linux_errno.inc Thu Jan 30 16:11:19 2020 (r357296) @@ -142,7 +142,8 @@ const int linux_errtbl[ELAST + 1] = { -1, /* ECAPMODE -> EPERM */ -131, /* ENOTRECOVERABLE */ -130, /* EOWNERDEAD */ + -22, /* EINTEGRITY -> EINVAL */ }; -_Static_assert(ELAST == 96, +_Static_assert(ELAST == 97, "missing errno entries in linux_errtbl"); Modified: stable/12/sys/security/audit/bsm_errno.c ============================================================================== --- stable/12/sys/security/audit/bsm_errno.c Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/sys/security/audit/bsm_errno.c Thu Jan 30 16:11:19 2020 (r357296) @@ -243,6 +243,13 @@ static const struct bsm_errno bsm_errnos[] = { ERRNO_NO_LOCAL_MAPPING, #endif ES("Process died with the lock") }, + { BSM_ERRNO_EINTEGRITY, +#ifdef EINTEGRITY + EINTEGRITY, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Integrity check failed") }, { BSM_ERRNO_ENOTRECOVERABLE, #ifdef ENOTRECOVERABLE ENOTRECOVERABLE, Modified: stable/12/sys/sys/errno.h ============================================================================== --- stable/12/sys/sys/errno.h Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/sys/sys/errno.h Thu Jan 30 16:11:19 2020 (r357296) @@ -180,10 +180,11 @@ __END_DECLS #define ECAPMODE 94 /* Not permitted in capability mode */ #define ENOTRECOVERABLE 95 /* State not recoverable */ #define EOWNERDEAD 96 /* Previous owner died */ +#define EINTEGRITY 97 /* Integrity check failed */ #endif /* _POSIX_SOURCE */ #ifndef _POSIX_SOURCE -#define ELAST 96 /* Must be equal largest errno */ +#define ELAST 97 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ #if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO)