From c5a63d089e88c70d510234a320c07bc0c9774045 Mon Sep 17 00:00:00 2001
From: rwatson
Date: Fri, 17 Jul 2009 12:18:39 +0000
Subject: Vendor import of OpenBSM 1.1p1, which incorporates the following
changes since the last imported OpenBSM release:
OpenBSM 1.1p1
- Fixes to AUT_SOCKUNIX token parsing.
- IPv6 support for au_to_me(3).
- Improved robustness in the parsing of audit_control, especially long
flags/naflags strings and whitespace in all fields.
- Add missing conversion of a number of FreeBSD/Mac OS X errnos to/from BSM
error number space.
Obtained from: TrustedBSD Project
Sponsored by: Apple, Inc.
---
NEWS | 11 +++++-
VERSION | 2 +-
configure | 22 +++++------
configure.ac | 4 +-
etc/audit_event | 3 +-
libauditd/auditd_lib.c | 4 +-
libbsm/bsm_control.c | 10 +++--
libbsm/bsm_errno.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++-
libbsm/bsm_io.c | 14 +++++--
libbsm/bsm_token.c | 29 ++++++++++----
man/audit_control.5 | 18 +++++----
sys/bsm/audit.h | 7 ++--
sys/bsm/audit_kevents.h | 3 +-
13 files changed, 182 insertions(+), 45 deletions(-)
diff --git a/NEWS b/NEWS
index 09eb891..8e778da 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,14 @@
OpenBSM Version History
+OpenBSM 1.1p1
+
+- Fixes to AUT_SOCKUNIX token parsing.
+- IPv6 support for au_to_me(3).
+- Improved robustness in the parsing of audit_control, especially long
+ flags/naflags strings and whitespace in all fields.
+- Add missing conversion of a number of FreeBSD/Mac OS X errnos to/from BSM
+ error number space.
+
OpenBSM 1.1
- Change auditon(2) parameters and data structures to be 32/64-bit architecture
@@ -449,4 +458,4 @@ OpenBSM 1.0 alpha 1
to support reloading of kernel event table.
- Allow comments in /etc/security configuration files.
-$P4: //depot/projects/trustedbsd/openbsm/NEWS#40 $
+$P4: //depot/projects/trustedbsd/openbsm/NEWS#42 $
diff --git a/VERSION b/VERSION
index c99ffc3..42f7658 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-OPENBSM_1_1
+OPENBSM_1_1p1
diff --git a/configure b/configure
index 1883152..52b5518 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#! /bin/sh
-# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#51 .
+# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#52 .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.62 for OpenBSM 1.1.
+# Generated by GNU Autoconf 2.62 for OpenBSM 1.1p1.
#
# Report bugs to .
#
@@ -751,8 +751,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='OpenBSM'
PACKAGE_TARNAME='openbsm'
-PACKAGE_VERSION='1.1'
-PACKAGE_STRING='OpenBSM 1.1'
+PACKAGE_VERSION='1.1p1'
+PACKAGE_STRING='OpenBSM 1.1p1'
PACKAGE_BUGREPORT='trustedbsd-audit@TrustesdBSD.org'
ac_unique_file="bin/auditreduce/auditreduce.c"
@@ -1492,7 +1492,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures OpenBSM 1.1 to adapt to many kinds of systems.
+\`configure' configures OpenBSM 1.1p1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1562,7 +1562,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of OpenBSM 1.1:";;
+ short | recursive ) echo "Configuration of OpenBSM 1.1p1:";;
esac
cat <<\_ACEOF
@@ -1671,7 +1671,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-OpenBSM configure 1.1
+OpenBSM configure 1.1p1
generated by GNU Autoconf 2.62
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1685,7 +1685,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by OpenBSM $as_me 1.1, which was
+It was created by OpenBSM $as_me 1.1p1, which was
generated by GNU Autoconf 2.62. Invocation command line was
$ $0 $@
@@ -19662,7 +19662,7 @@ fi
# Define the identity of the package.
PACKAGE=OpenBSM
- VERSION=1.1
+ VERSION=1.1p1
cat >>confdefs.h <<_ACEOF
@@ -24400,7 +24400,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by OpenBSM $as_me 1.1, which was
+This file was extended by OpenBSM $as_me 1.1p1, which was
generated by GNU Autoconf 2.62. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -24453,7 +24453,7 @@ Report bugs to ."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-OpenBSM config.status 1.1
+OpenBSM config.status 1.1p1
configured by $0, generated by GNU Autoconf 2.62,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.ac b/configure.ac
index e838544..942d459 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,8 +2,8 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT([OpenBSM], [1.1], [trustedbsd-audit@TrustesdBSD.org],[openbsm])
-AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#52 $])
+AC_INIT([OpenBSM], [1.1p1], [trustedbsd-audit@TrustesdBSD.org],[openbsm])
+AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#53 $])
AC_CONFIG_SRCDIR([bin/auditreduce/auditreduce.c])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_HEADER([config/config.h])
diff --git a/etc/audit_event b/etc/audit_event
index de9db3f..6f13980 100644
--- a/etc/audit_event
+++ b/etc/audit_event
@@ -1,5 +1,5 @@
#
-# $P4: //depot/projects/trustedbsd/openbsm/etc/audit_event#39 $
+# $P4: //depot/projects/trustedbsd/openbsm/etc/audit_event#40 $
#
# The mapping between event identifiers and values is also hard-coded in
# audit_kevents.h and audit_uevents.h, so changes must occur in both places,
@@ -555,6 +555,7 @@
43193:AUE_PWRITE:pwrite(2):no
43194:AUE_FSCTL:fsctl():fm
43195:AUE_FFSCTL:ffsctl():fm
+43196:AUE_LPATHCONF:lpathconf(2):fa
#
# Solaris userspace events.
#
diff --git a/libauditd/auditd_lib.c b/libauditd/auditd_lib.c
index 08274b6..bf57155 100644
--- a/libauditd/auditd_lib.c
+++ b/libauditd/auditd_lib.c
@@ -26,7 +26,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $P4: //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#10 $
+ * $P4: //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#11 $
*/
#include
@@ -130,7 +130,7 @@ static char *auditd_errmsg[] = {
#define MAXERRCODE (sizeof(auditd_errmsg) / sizeof(auditd_errmsg[0]))
-#define NA_EVENT_STR_SIZE 25
+#define NA_EVENT_STR_SIZE 128
#define POL_STR_SIZE 128
diff --git a/libbsm/bsm_control.c b/libbsm/bsm_control.c
index a58db0e..378035d 100644
--- a/libbsm/bsm_control.c
+++ b/libbsm/bsm_control.c
@@ -27,7 +27,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#33 $
+ * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#34 $
*/
#include
@@ -121,9 +121,13 @@ getstrfromtype_locked(char *name, char **str)
if (linestr[0] == '#')
continue;
- /* Remove trailing new line character. */
- if ((nl = strrchr(linestr, '\n')) != NULL)
+ /* Remove trailing new line character and white space. */
+ nl = strchr(linestr, '\0') - 1;
+ while (nl >= linestr && ('\n' == *nl || ' ' == *nl ||
+ '\t' == *nl)) {
*nl = '\0';
+ nl--;
+ }
tokptr = linestr;
if ((type = strtok_r(tokptr, delim, &last)) != NULL) {
diff --git a/libbsm/bsm_errno.c b/libbsm/bsm_errno.c
index b750341..2ca7009 100644
--- a/libbsm/bsm_errno.c
+++ b/libbsm/bsm_errno.c
@@ -26,7 +26,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_errno.c#17 $
+ * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_errno.c#19 $
*/
#include
@@ -453,6 +453,104 @@ static const struct bsm_errno bsm_errnos[] = {
{ BSM_ERRNO_EINPROGRESS, EINPROGRESS,
ES("Operation now in progress") },
{ BSM_ERRNO_ESTALE, ESTALE, ES("Stale NFS file handle") },
+ { BSM_ERRNO_EPROCLIM,
+#ifdef EPROCLIM
+ EPROCLIM,
+#else
+ ERRNO_NO_LOCAL_MAPPING,
+#endif
+ ES("Too many processes") },
+ { BSM_ERRNO_EBADRPC,
+#ifdef EBADRPC
+ EBADRPC,
+#else
+ ERRNO_NO_LOCAL_MAPPING,
+#endif
+ ES("RPC struct is bad") },
+ { BSM_ERRNO_ERPCMISMATCH,
+#ifdef ERPCMISMATCH
+ ERPCMISMATCH,
+#else
+ ERRNO_NO_LOCAL_MAPPING,
+#endif
+ ES("RPC version wrong") },
+ { BSM_ERRNO_EPROGUNAVAIL,
+#ifdef EPROGUNAVAIL
+ EPROGUNAVAIL,
+#else
+ ERRNO_NO_LOCAL_MAPPING,
+#endif
+ ES("RPC prog. not avail") },
+ { BSM_ERRNO_EPROGMISMATCH,
+#ifdef EPROGMISMATCH
+ EPROGMISMATCH,
+#else
+ ERRNO_NO_LOCAL_MAPPING,
+#endif
+ ES("RPC version wrong") },
+ { BSM_ERRNO_EPROCUNAVAIL,
+#ifdef EPROCUNAVAIL
+ EPROCUNAVAIL,
+#else
+ ERRNO_NO_LOCAL_MAPPING,
+#endif
+ ES("Bad procedure for program") },
+ { BSM_ERRNO_EFTYPE,
+#ifdef EFTYPE
+ EFTYPE,
+#else
+ ERRNO_NO_LOCAL_MAPPING,
+#endif
+ ES("Inappropriate file type or format") },
+ { BSM_ERRNO_EAUTH,
+#ifdef EAUTH
+ EAUTH,
+#else
+ ERRNO_NO_LOCAL_MAPPING,
+#endif
+ ES("Authenticateion error") },
+ { BSM_ERRNO_ENEEDAUTH,
+#ifdef ENEEDAUTH
+ ENEEDAUTH,
+#else
+ ERRNO_NO_LOCAL_MAPPING,
+#endif
+ ES("Need authenticator") },
+ { BSM_ERRNO_ENOATTR,
+#ifdef ENOATTR
+ ENOATTR,
+#else
+ ERRNO_NO_LOCAL_MAPPING,
+#endif
+ ES("Attribute not found") },
+ { BSM_ERRNO_EDOOFUS,
+#ifdef EDOOFUS
+ EDOOFUS,
+#else
+ ERRNO_NO_LOCAL_MAPPING,
+#endif
+ ES("Programming error") },
+ { BSM_ERRNO_EJUSTRETURN,
+#ifdef EJUSTRETURN
+ EJUSTRETURN,
+#else
+ ERRNO_NO_LOCAL_MAPPING,
+#endif
+ ES("Just return") },
+ { BSM_ERRNO_ENOIOCTL,
+#ifdef ENOIOCTL
+ ENOIOCTL,
+#else
+ ERRNO_NO_LOCAL_MAPPING,
+#endif
+ ES("ioctl not handled by this layer") },
+ { BSM_ERRNO_EDIRIOCTL,
+#ifdef EDIRIOCTL
+ EDIRIOCTL,
+#else
+ ERRNO_NO_LOCAL_MAPPING,
+#endif
+ ES("do direct ioctl in GEOM") },
{ BSM_ERRNO_EPWROFF,
#ifdef EPWROFF
EPWROFF,
diff --git a/libbsm/bsm_io.c b/libbsm/bsm_io.c
index 103a95e..2dd1330 100644
--- a/libbsm/bsm_io.c
+++ b/libbsm/bsm_io.c
@@ -32,7 +32,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#62 $
+ * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#63 $
*/
#include
@@ -3176,19 +3176,25 @@ print_sock_inet128_tok(FILE *fp, tokenstr_t *tok, char *del, char raw,
/*
* socket family 2 bytes
- * path 104 bytes
+ * path (up to) 104 bytes + NULL (NULL terminated string).
*/
static int
fetch_sock_unix_tok(tokenstr_t *tok, u_char *buf, int len)
{
int err = 0;
+ u_char *p;
+ int slen;
+
READ_TOKEN_U_INT16(buf, len, tok->tt.sockunix.family, tok->len, err);
if (err)
return (-1);
- READ_TOKEN_BYTES(buf, len, tok->tt.sockunix.path, 104, tok->len,
- err);
+ /* slen = strnlen((buf + tok->len), 104) + 1; */
+ p = (u_char *)memchr((const void *)(buf + tok->len), '\0', 104);
+ slen = (p ? (int)(p - (buf + tok->len)) : 104) + 1;
+
+ READ_TOKEN_BYTES(buf, len, tok->tt.sockunix.path, slen, tok->len, err);
if (err)
return (-1);
diff --git a/libbsm/bsm_token.c b/libbsm/bsm_token.c
index bceab6c..a37dd63 100644
--- a/libbsm/bsm_token.c
+++ b/libbsm/bsm_token.c
@@ -30,7 +30,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#91 $
+ * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#93 $
*/
#include
@@ -996,7 +996,7 @@ au_to_socket_ex(u_short so_domain, u_short so_type,
/*
* token ID 1 byte
* socket family 2 bytes
- * path 104 bytes
+ * path (up to) 104 bytes + NULL (NULL terminated string)
*/
token_t *
au_to_sock_unix(struct sockaddr_un *so)
@@ -1270,12 +1270,27 @@ token_t *
au_to_me(void)
{
auditinfo_t auinfo;
+ auditinfo_addr_t aia;
- if (getaudit(&auinfo) != 0)
- return (NULL);
-
- return (au_to_subject32(auinfo.ai_auid, geteuid(), getegid(),
- getuid(), getgid(), getpid(), auinfo.ai_asid, &auinfo.ai_termid));
+ /*
+ * Try to use getaudit_addr(2) first. If this kernel does not support
+ * it, then fall back on to getaudit(2).
+ */
+ if (getaudit_addr(&aia, sizeof(aia)) != 0) {
+ if (errno == ENOSYS) {
+ if (getaudit(&auinfo) != 0)
+ return (NULL);
+ return (au_to_subject32(auinfo.ai_auid, geteuid(),
+ getegid(), getuid(), getgid(), getpid(),
+ auinfo.ai_asid, &auinfo.ai_termid));
+ } else {
+ /* getaudit_addr(2) failed for some other reason. */
+ return (NULL);
+ }
+ }
+
+ return (au_to_subject32_ex(aia.ai_auid, geteuid(), getegid(), getuid(),
+ getgid(), getpid(), aia.ai_asid, &aia.ai_termid));
}
#endif
diff --git a/man/audit_control.5 b/man/audit_control.5
index bed9cd8..801a66e 100644
--- a/man/audit_control.5
+++ b/man/audit_control.5
@@ -26,9 +26,9 @@
.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $P4: //depot/projects/trustedbsd/openbsm/man/audit_control.5#22 $
+.\" $P4: //depot/projects/trustedbsd/openbsm/man/audit_control.5#23 $
.\"
-.Dd January 29, 2009
+.Dd May 14, 2009
.Dt AUDIT_CONTROL 5
.Os
.Sh NAME
@@ -94,7 +94,7 @@ Specifies when audit log files will expire and be removed.
This may be after a time period has passed since the file was last
written to or when the aggregate of all the trail files have reached a
specified size or a combination of both.
-If no expire-after parameter is given then audit log files with not
+If no expire-after parameter is given then audit log files will not
expire and be removed by the audit control system.
See the information below for the format of the expiration
specification.
@@ -217,7 +217,7 @@ The suffixes on the values are case sensitive.
If both an age and disk space value are used they are seperated by
AND or OR and both values are used to determine when audit
log files expire.
-In the case of AND, both the age and disk space conditions must be meet
+In the case of AND, both the age and disk space conditions must be met
before the log file is removed.
In the case of OR, either condition may expire the log file.
For example:
@@ -233,17 +233,18 @@ The following settings appear in the default
file:
.Bd -literal -offset indent
dir:/var/audit
-flags:lo
+flags:lo,aa
minfree:5
-naflags:lo
+naflags:lo,aa
policy:cnt,argv
-filesz:2097152
+filesz:2M
+expire-after:10M
.Ed
.Pp
The
.Va flags
parameter above specifies the system-wide mask corresponding to login/logout
-events.
+as well as authentication and authorization events.
The
.Va policy
parameter specifies that the system should neither fail stop nor suspend
@@ -253,6 +254,7 @@ be audited for
events.
The trail file will be automatically rotated by the audit daemon when the
file size reaches approximately 2MB.
+Trail files will expire when their aggregate size exceeds 10MB.
.Sh FILES
.Bl -tag -width ".Pa /etc/security/audit_control" -compact
.It Pa /etc/security/audit_control
diff --git a/sys/bsm/audit.h b/sys/bsm/audit.h
index 2a1abe8..bb4a949 100644
--- a/sys/bsm/audit.h
+++ b/sys/bsm/audit.h
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit.h#9 $
+ * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit.h#10 $
*/
#ifndef _BSM_AUDIT_H
@@ -172,6 +172,7 @@ typedef pid_t au_asid_t;
typedef u_int16_t au_event_t;
typedef u_int16_t au_emod_t;
typedef u_int32_t au_class_t;
+typedef u_int64_t au_asflgs_t __attribute__ ((aligned (8)));
struct au_tid {
dev_t port;
@@ -205,7 +206,7 @@ struct auditinfo_addr {
au_mask_t ai_mask; /* Audit masks. */
au_tid_addr_t ai_termid; /* Terminal ID. */
au_asid_t ai_asid; /* Audit session ID. */
- u_int64_t ai_flags; /* Audit session flags. */
+ au_asflgs_t ai_flags; /* Audit session flags. */
};
typedef struct auditinfo_addr auditinfo_addr_t;
@@ -224,7 +225,7 @@ struct auditpinfo_addr {
au_mask_t ap_mask; /* Audit masks. */
au_tid_addr_t ap_termid; /* Terminal ID. */
au_asid_t ap_asid; /* Audit session ID. */
- u_int64_t ap_flags; /* Audit session flags. */
+ au_asflgs_t ap_flags; /* Audit session flags. */
};
typedef struct auditpinfo_addr auditpinfo_addr_t;
diff --git a/sys/bsm/audit_kevents.h b/sys/bsm/audit_kevents.h
index 268c456..9ef2553 100644
--- a/sys/bsm/audit_kevents.h
+++ b/sys/bsm/audit_kevents.h
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_kevents.h#6 $
+ * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_kevents.h#8 $
*/
#ifndef _BSM_AUDIT_KEVENTS_H_
@@ -596,6 +596,7 @@
#define AUE_PWRITE 43193 /* Darwin/FreeBSD. */
#define AUE_FSCTL 43194 /* Darwin. */
#define AUE_FFSCTL 43195 /* Darwin. */
+#define AUE_LPATHCONF 43196 /* FreeBSD. */
/*
* Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the
--
cgit v1.1
From 38884cb263e0fdc232617e021c671a77ff74514e Mon Sep 17 00:00:00 2001
From: rwatson
Date: Sun, 2 Aug 2009 00:19:36 +0000
Subject: Vendor import of OpenBSM 1.1p2, which incorporates the following
changes since the last imported OpenBSM release:
OpenBSM 1.1p2
- Fix audit_event definitions of AUE_OPENAT_RWT and AUE_OPENAT_RWTC.
- Fix build on Linux.
- Fix printing of class masks in the audump tool.
Obtained from: TrustedBSD Project
---
NEWS | 8 +++++++-
README | 4 ++--
VERSION | 2 +-
configure | 22 +++++++++++-----------
configure.ac | 4 ++--
etc/audit_event | 5 +++--
tools/audump.c | 10 +++++-----
7 files changed, 31 insertions(+), 24 deletions(-)
diff --git a/NEWS b/NEWS
index 8e778da..4223841 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,11 @@
OpenBSM Version History
+OpenBSM 1.1p2
+
+- Fix audit_event definitions of AUE_OPENAT_RWT and AUE_OPENAT_RWTC.
+- Fix build on Linux.
+- Fix printing of class masks in the audump tool.
+
OpenBSM 1.1p1
- Fixes to AUT_SOCKUNIX token parsing.
@@ -458,4 +464,4 @@ OpenBSM 1.0 alpha 1
to support reloading of kernel event table.
- Allow comments in /etc/security configuration files.
-$P4: //depot/projects/trustedbsd/openbsm/NEWS#42 $
+$P4: //depot/projects/trustedbsd/openbsm/NEWS#43 $
diff --git a/README b/README
index 5077693..b4e992b 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-OpenBSM 1.1
+OpenBSM 1.1p2
Introduction
@@ -64,4 +64,4 @@ Information on TrustedBSD may be found on the TrustedBSD home page:
http://www.TrustedBSD.org/
-$P4: //depot/projects/trustedbsd/openbsm/README#36 $
+$P4: //depot/projects/trustedbsd/openbsm/README#37 $
diff --git a/VERSION b/VERSION
index 42f7658..3ad27b7 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-OPENBSM_1_1p1
+OPENBSM_1_1p2
diff --git a/configure b/configure
index 52b5518..bd79932 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#! /bin/sh
-# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#52 .
+# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#53 .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.62 for OpenBSM 1.1p1.
+# Generated by GNU Autoconf 2.62 for OpenBSM 1.1p2.
#
# Report bugs to .
#
@@ -751,8 +751,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='OpenBSM'
PACKAGE_TARNAME='openbsm'
-PACKAGE_VERSION='1.1p1'
-PACKAGE_STRING='OpenBSM 1.1p1'
+PACKAGE_VERSION='1.1p2'
+PACKAGE_STRING='OpenBSM 1.1p2'
PACKAGE_BUGREPORT='trustedbsd-audit@TrustesdBSD.org'
ac_unique_file="bin/auditreduce/auditreduce.c"
@@ -1492,7 +1492,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures OpenBSM 1.1p1 to adapt to many kinds of systems.
+\`configure' configures OpenBSM 1.1p2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1562,7 +1562,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of OpenBSM 1.1p1:";;
+ short | recursive ) echo "Configuration of OpenBSM 1.1p2:";;
esac
cat <<\_ACEOF
@@ -1671,7 +1671,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-OpenBSM configure 1.1p1
+OpenBSM configure 1.1p2
generated by GNU Autoconf 2.62
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1685,7 +1685,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by OpenBSM $as_me 1.1p1, which was
+It was created by OpenBSM $as_me 1.1p2, which was
generated by GNU Autoconf 2.62. Invocation command line was
$ $0 $@
@@ -19662,7 +19662,7 @@ fi
# Define the identity of the package.
PACKAGE=OpenBSM
- VERSION=1.1p1
+ VERSION=1.1p2
cat >>confdefs.h <<_ACEOF
@@ -24400,7 +24400,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by OpenBSM $as_me 1.1p1, which was
+This file was extended by OpenBSM $as_me 1.1p2, which was
generated by GNU Autoconf 2.62. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -24453,7 +24453,7 @@ Report bugs to ."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-OpenBSM config.status 1.1p1
+OpenBSM config.status 1.1p2
configured by $0, generated by GNU Autoconf 2.62,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.ac b/configure.ac
index 942d459..b6bc270 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,8 +2,8 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT([OpenBSM], [1.1p1], [trustedbsd-audit@TrustesdBSD.org],[openbsm])
-AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#53 $])
+AC_INIT([OpenBSM], [1.1p2], [trustedbsd-audit@TrustesdBSD.org],[openbsm])
+AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#54 $])
AC_CONFIG_SRCDIR([bin/auditreduce/auditreduce.c])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_HEADER([config/config.h])
diff --git a/etc/audit_event b/etc/audit_event
index 6f13980..45b0db5 100644
--- a/etc/audit_event
+++ b/etc/audit_event
@@ -1,5 +1,5 @@
#
-# $P4: //depot/projects/trustedbsd/openbsm/etc/audit_event#40 $
+# $P4: //depot/projects/trustedbsd/openbsm/etc/audit_event#41 $
#
# The mapping between event identifiers and values is also hard-coded in
# audit_kevents.h and audit_uevents.h, so changes must occur in both places,
@@ -271,7 +271,8 @@
277:AUE_OPENAT_WTC:openat(2) - write,creat,trunc:fc,fd,fw,fa,fm
278:AUE_OPENAT_RW:openat(2) - read,write:fr,fw
279:AUE_OPENAT_RWC:openat(2) - read,write,create:fc,fw,fr,fa,fm
-280:AUE_OPENAT_RWTC:openat(2) - read,write,creat,trunc:fc,fd,fw,fr,fa,fm
+280:AUE_OPENAT_RWT:openat(2) - read,write,trunc:fd,fw,fr,fa,fm
+281:AUE_OPENAT_RWTC:openat(2) - read,write,creat,trunc:fc,fd,fw,fr,fa,fm
282:AUE_RENAMEAT:renameat(2):fc,fd
283:AUE_FSTATAT:fstatat(2):fa
284:AUE_FCHOWNAT:fchownat(2):fm
diff --git a/tools/audump.c b/tools/audump.c
index a5f4b6d..82d17ea 100644
--- a/tools/audump.c
+++ b/tools/audump.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2005-2006 Robert N. M. Watson
+ * Copyright (c) 2005-2009 Robert N. M. Watson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/trustedbsd/openbsm/tools/audump.c#8 $
+ * $P4: //depot/projects/trustedbsd/openbsm/tools/audump.c#9 $
*/
#include
@@ -165,16 +165,16 @@ printf_classmask(au_class_t classmask)
first = 1;
for (i = 0; i < 32; i++) {
- if (classmask & (2 << i)) {
+ if (classmask & (1 << i)) {
if (first)
first = 0;
else
printf(",");
- c = getauclassnum(2 << i);
+ c = getauclassnum(1 << i);
if (c != NULL)
printf("%s", c->ac_name);
else
- printf("0x%x", 2 << i);
+ printf("0x%x", 1 << i);
}
}
}
--
cgit v1.1
From cc73504950eb7b5dff2dded9bedd67bc36d64641 Mon Sep 17 00:00:00 2001
From: dim
Date: Sun, 19 Aug 2012 10:33:04 +0000
Subject: Vendor import of clang trunk r162107:
http://llvm.org/svn/llvm-project/cfe/trunk@162107
---
docs/LanguageExtensions.html | 162 ++++++++
docs/ReleaseNotes.html | 19 +
docs/analyzer/IPA.txt | 96 +++++
include/clang/AST/ASTContext.h | 20 +-
include/clang/AST/Attr.h | 3 +-
include/clang/AST/CommentCommandTraits.h | 6 +-
include/clang/AST/DeclBase.h | 4 +-
include/clang/AST/DeclCXX.h | 13 +-
include/clang/AST/DeclGroup.h | 6 +-
include/clang/AST/DeclLookups.h | 4 +-
include/clang/AST/PrettyPrinter.h | 26 +-
include/clang/AST/RawCommentList.h | 30 +-
include/clang/AST/Stmt.h | 32 +-
include/clang/AST/TemplateBase.h | 20 +-
include/clang/AST/TypeLoc.h | 9 -
include/clang/ASTMatchers/ASTMatchers.h | 148 ++++++++
include/clang/Basic/Attr.td | 21 ++
include/clang/Basic/Builtins.def | 6 +-
include/clang/Basic/DiagnosticGroups.td | 8 +-
include/clang/Basic/DiagnosticParseKinds.td | 4 +
include/clang/Basic/DiagnosticSemaKinds.td | 36 +-
include/clang/Lex/PTHManager.h | 2 +-
include/clang/Parse/Parser.h | 4 +
include/clang/Sema/AttributeList.h | 107 +++++-
include/clang/Sema/Sema.h | 43 ++-
.../StaticAnalyzer/Core/BugReporter/BugReporter.h | 51 ++-
.../Core/BugReporter/PathDiagnostic.h | 22 +-
.../StaticAnalyzer/Core/PathDiagnosticConsumers.h | 30 +-
.../Core/PathSensitive/AnalysisManager.h | 27 +-
.../StaticAnalyzer/Core/PathSensitive/CallEvent.h | 6 +-
.../StaticAnalyzer/Core/PathSensitive/MemRegion.h | 4 +-
.../Core/PathSensitive/ProgramState.h | 12 +-
lib/AST/APValue.cpp | 5 +-
lib/AST/ASTContext.cpp | 68 +++-
lib/AST/ASTDiagnostic.cpp | 2 +-
lib/AST/CommentCommandTraits.cpp | 10 +-
lib/AST/DeclCXX.cpp | 13 +-
lib/AST/DeclPrinter.cpp | 56 +--
lib/AST/DeclTemplate.cpp | 3 +-
lib/AST/DumpXML.cpp | 5 +
lib/AST/NestedNameSpecifier.cpp | 9 +-
lib/AST/RawCommentList.cpp | 21 +-
lib/AST/Stmt.cpp | 23 +-
lib/AST/StmtPrinter.cpp | 32 +-
lib/AST/TemplateBase.cpp | 6 +-
lib/Basic/Diagnostic.cpp | 6 +-
lib/Basic/Targets.cpp | 3 +-
lib/CodeGen/CGBuiltin.cpp | 69 +++-
lib/CodeGen/CGDebugInfo.cpp | 41 +-
lib/CodeGen/CGExpr.cpp | 80 ++++
lib/CodeGen/CGExprCXX.cpp | 9 +-
lib/CodeGen/CGStmt.cpp | 24 +-
lib/CodeGen/CGValue.h | 2 +-
lib/Driver/Tools.cpp | 3 +
lib/Frontend/ASTConsumers.cpp | 2 +-
lib/Frontend/CacheTokens.cpp | 2 +-
lib/Lex/PTHLexer.cpp | 6 +-
lib/Parse/ParseDecl.cpp | 73 +++-
lib/Parse/ParseStmt.cpp | 181 ++++-----
lib/Rewrite/RewriteModernObjC.cpp | 9 +-
lib/Rewrite/RewriteObjC.cpp | 10 +-
lib/Sema/AttributeList.cpp | 2 +
lib/Sema/SemaCast.cpp | 20 +-
lib/Sema/SemaChecking.cpp | 420 ++++++++++++++++++++-
lib/Sema/SemaCodeComplete.cpp | 1 -
lib/Sema/SemaDecl.cpp | 72 +++-
lib/Sema/SemaDeclAttr.cpp | 163 ++++++--
lib/Sema/SemaDeclCXX.cpp | 2 +-
lib/Sema/SemaExceptionSpec.cpp | 3 +-
lib/Sema/SemaExpr.cpp | 3 +-
lib/Sema/SemaExprMember.cpp | 2 +-
lib/Sema/SemaOverload.cpp | 2 +-
lib/Sema/SemaStmt.cpp | 329 ++++++++++------
lib/Sema/SemaTemplate.cpp | 7 +
lib/Sema/SemaTemplateInstantiate.cpp | 3 +-
lib/Sema/SemaType.cpp | 46 ++-
lib/Sema/TreeTransform.h | 19 +-
lib/Serialization/ASTReader.cpp | 1 -
lib/Serialization/ASTWriter.cpp | 1 -
.../Checkers/CallAndMessageChecker.cpp | 12 +-
.../Checkers/DynamicTypePropagation.cpp | 87 ++++-
lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | 151 +-------
lib/StaticAnalyzer/Core/AnalysisManager.cpp | 45 +--
lib/StaticAnalyzer/Core/BugReporter.cpp | 189 ++++------
lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | 2 +-
lib/StaticAnalyzer/Core/CallEvent.cpp | 86 +++--
.../Core/ExprEngineCallAndReturn.cpp | 42 ++-
lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp | 48 +--
lib/StaticAnalyzer/Core/PathDiagnostic.cpp | 18 +-
lib/StaticAnalyzer/Core/PlistDiagnostics.cpp | 92 +++--
lib/StaticAnalyzer/Core/ProgramState.cpp | 7 +-
lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp | 12 +-
lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp | 74 +++-
test/Analysis/CFNumber.c | 6 +-
test/Analysis/CheckNSError.m | 4 +-
test/Analysis/array-struct.c | 2 +-
test/Analysis/ctor-inlining.mm | 48 +++
test/Analysis/dtor.cpp | 54 +++
test/Analysis/func.c | 14 +-
test/Analysis/html-diags.c | 6 +-
test/Analysis/inline.cpp | 27 ++
test/Analysis/inlining/DynDispatchBifurcate.m | 10 +-
test/Analysis/inlining/InlineObjCClassMethod.m | 30 ++
test/Analysis/inlining/dyn-dispatch-bifurcate.cpp | 17 +
test/Analysis/keychainAPI.m | 6 +-
test/Analysis/malloc-annotations.c | 4 +-
test/Analysis/malloc.c | 6 +-
test/Analysis/method-call-path-notes.cpp | 85 +++++
test/Analysis/method-call.cpp | 20 +-
test/Analysis/misc-ps-region-store.m | 2 +-
...il-receiver-undefined-larger-than-voidptr-ret.m | 4 +-
test/Analysis/ptr-arith.c | 6 +-
test/Analysis/reinterpret-cast.cpp | 20 +
test/Analysis/security-syntax-checks.m | 8 +-
test/Analysis/sizeofpointer.c | 2 +-
test/Analysis/stack-addr-ps.cpp | 2 +-
test/Analysis/stream.c | 16 +-
test/Analysis/variadic-method-types.m | 2 +-
test/CodeCompletion/objc-expr.m | 2 +-
test/CodeGen/align-global-large.c | 18 +
test/CodeGen/alignment.c | 3 +-
test/CodeGen/arm-neon-misc.c | 34 ++
test/CodeGen/complex-builtints.c | 71 ++++
test/CodeGen/ms-inline-asm.c | 86 ++++-
.../devirtualize-virtual-function-calls.cpp | 17 +
test/CodeGenObjC/instance-method-metadata.m | 10 +-
test/CodeGenObjC/ns_consume_null_check.m | 8 +-
test/CodeGenOpenCL/vectorLoadStore.cl | 9 +
test/Driver/Xlinker-args.c | 11 +-
test/Index/complete-enums.cpp | 4 +-
test/Index/complete-exprs.m | 4 +-
test/Index/complete-preamble.cpp | 8 +
test/Index/complete-preamble.h | 6 +
test/Parser/ms-inline-asm.c | 6 +-
test/Sema/128bitint.c | 19 +
test/Sema/arm-asm.c | 7 +
test/Sema/builtins-decl.c | 5 +
test/Sema/callingconv.c | 8 +
test/Sema/static-array.c | 46 ++-
test/Sema/tentative-decls.c | 5 +-
test/Sema/warn-documentation.cpp | 60 ++-
test/Sema/warn-type-safety-mpi-hdf5.c | 307 +++++++++++++++
test/Sema/warn-type-safety.c | 152 ++++++++
test/Sema/warn-type-safety.cpp | 71 ++++
test/SemaCXX/convert-to-bool.cpp | 3 +-
test/SemaCXX/pragma-pack.cpp | 23 ++
test/SemaCXX/references.cpp | 2 +-
test/SemaCXX/uninitialized.cpp | 81 ++++
test/SemaCXX/warn-thread-safety-parsing.cpp | 10 +
test/SemaObjC/warn-cast-of-sel-expr.m | 21 ++
test/SemaObjCXX/abstract-class-type-ivar.mm | 29 ++
test/Tooling/clang-check-ast-dump.cpp | 5 +
unittests/ASTMatchers/ASTMatchersTest.cpp | 257 +++++++++++++
unittests/Tooling/RecursiveASTVisitorTest.cpp | 7 +
utils/TableGen/ClangAttrEmitter.cpp | 9 +-
utils/analyzer/CmpRuns.py | 4 +-
www/comparison.html | 6 +-
157 files changed, 4423 insertions(+), 1127 deletions(-)
create mode 100644 docs/analyzer/IPA.txt
create mode 100644 test/Analysis/inlining/dyn-dispatch-bifurcate.cpp
create mode 100644 test/Analysis/reinterpret-cast.cpp
create mode 100644 test/CodeGen/align-global-large.c
create mode 100644 test/CodeGen/arm-neon-misc.c
create mode 100644 test/CodeGen/complex-builtints.c
create mode 100644 test/CodeGenOpenCL/vectorLoadStore.cl
create mode 100644 test/Index/complete-preamble.cpp
create mode 100644 test/Index/complete-preamble.h
create mode 100644 test/Sema/arm-asm.c
create mode 100644 test/Sema/warn-type-safety-mpi-hdf5.c
create mode 100644 test/Sema/warn-type-safety.c
create mode 100644 test/Sema/warn-type-safety.cpp
create mode 100644 test/SemaObjC/warn-cast-of-sel-expr.m
create mode 100644 test/SemaObjCXX/abstract-class-type-ivar.mm
diff --git a/docs/LanguageExtensions.html b/docs/LanguageExtensions.html
index eac3c69..40477b8 100644
--- a/docs/LanguageExtensions.html
+++ b/docs/LanguageExtensions.html
@@ -142,6 +142,13 @@
shared_locks_required(...)
+Type Safety Checking
+
+
@@ -1913,6 +1920,161 @@ declaration to specify that the function must be called while holding the listed
shared locks. Arguments must be lockable type, and there must be at
least one argument.
+
+Type Safety Checking
+
+
+Clang supports additional attributes to enable checking type safety
+properties that can't be enforced by C type system. Usecases include:
+
+- MPI library implementations, where these attributes enable checking that
+ buffer type matches the passed MPI_Datatype;
+- for HDF5 library there is a similar usecase as MPI;
+- checking types of variadic functions' arguments for functions like
+ fcntl() and ioctl().
+
+
+You can detect support for these attributes with __has_attribute(). For
+example:
+
+
+
+#if defined(__has_attribute)
+# if __has_attribute(argument_with_type_tag) && \
+ __has_attribute(pointer_with_type_tag) && \
+ __has_attribute(type_tag_for_datatype)
+# define ATTR_MPI_PWT(buffer_idx, type_idx) __attribute__((pointer_with_type_tag(mpi,buffer_idx,type_idx)))
+/* ... other macros ... */
+# endif
+#endif
+
+#if !defined(ATTR_MPI_PWT)
+#define ATTR_MPI_PWT(buffer_idx, type_idx)
+#endif
+
+int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args omitted */)
+ ATTR_MPI_PWT(1,3);
+
+
+
+argument_with_type_tag(...)
+
+Use __attribute__((argument_with_type_tag(arg_kind, arg_idx,
+type_tag_idx))) on a function declaration to specify that the function
+accepts a type tag that determines the type of some other argument.
+arg_kind is an identifier that should be used when annotating all
+applicable type tags.
+
+This attribute is primarily useful for checking arguments of variadic
+functions (pointer_with_type_tag can be used in most of non-variadic
+cases).
+
+For example:
+
+
+int fcntl(int fd, int cmd, ...)
+ __attribute__(( argument_with_type_tag(fcntl,3,2) ));
+
+
+
+pointer_with_type_tag(...)
+
+Use __attribute__((pointer_with_type_tag(ptr_kind, ptr_idx,
+type_tag_idx))) on a function declaration to specify that the
+function a type tag that determines the pointee type of some other pointer
+argument.
+
+For example:
+
+
+int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args omitted */)
+ __attribute__(( pointer_with_type_tag(mpi,1,3) ));
+
+
+
+type_tag_for_datatype(...)
+
+Clang supports annotating type tags of two forms.
+
+
+- Type tag that is an expression containing a reference to some declared
+identifier. Use __attribute__((type_tag_for_datatype(kind, type)))
+on a declaration with that identifier:
+
+
+
+extern struct mpi_datatype mpi_datatype_int
+ __attribute__(( type_tag_for_datatype(mpi,int) ));
+#define MPI_INT ((MPI_Datatype) &mpi_datatype_int)
+
+
+
+- Type tag that is an integral literal. Introduce a static
+const variable with a corresponding initializer value and attach
+__attribute__((type_tag_for_datatype(kind, type))) on that
+declaration, for example:
+
+
+
+#define MPI_INT ((MPI_Datatype) 42)
+static const MPI_Datatype mpi_datatype_int
+ __attribute__(( type_tag_for_datatype(mpi,int) )) = 42
+
+
+
+
+The attribute also accepts an optional third argument that determines how
+the expression is compared to the type tag. There are two supported flags:
+
+- layout_compatible will cause types to be compared according to
+layout-compatibility rules (C++11 [class.mem] p 17, 18). This is
+implemented to support annotating types like MPI_DOUBLE_INT.
+
+
For example:
+
+
+/* In mpi.h */
+struct internal_mpi_double_int { double d; int i; };
+extern struct mpi_datatype mpi_datatype_double_int
+ __attribute__(( type_tag_for_datatype(mpi, struct internal_mpi_double_int,
+ layout_compatible) ));
+
+#define MPI_DOUBLE_INT ((MPI_Datatype) &mpi_datatype_double_int)
+
+/* In user code */
+struct my_pair { double a; int b; };
+struct my_pair *buffer;
+MPI_Send(buffer, 1, MPI_DOUBLE_INT /*, ... */); // no warning
+
+struct my_int_pair { int a; int b; }
+struct my_int_pair *buffer2;
+MPI_Send(buffer2, 1, MPI_DOUBLE_INT /*, ... */); // warning: actual buffer element
+ // type 'struct my_int_pair'
+ // doesn't match specified MPI_Datatype
+
+
+
+
+- must_be_null specifies that the expression should be a null
+pointer constant, for example:
+
+
+
+/* In mpi.h */
+extern struct mpi_datatype mpi_datatype_null
+ __attribute__(( type_tag_for_datatype(mpi, void, must_be_null) ));
+
+#define MPI_DATATYPE_NULL ((MPI_Datatype) &mpi_datatype_null)
+
+/* In user code */
+MPI_Send(buffer, 1, MPI_DATATYPE_NULL /*, ... */); // warning: MPI_DATATYPE_NULL
+ // was specified but buffer
+ // is not a null pointer
+
+
+
+
+