Added SAL annotatations to system calls.

Modify makesyscalls.sh to strip out SAL annotations.

No functional change.

This is based on work I started in CheriBSD and use to validate fat
pointers at the syscall boundary.  Tal Garfinkel reviewed the changes,
added annotations to COMPAT* syscalls and is using them in a record and
playback framework.  One can envision other uses such as a WITNESS-like
validator for copyin/out as speculated on in the review.

As this time we are only annotating sys/kern/syscalls.master as that is
sufficient for userspace work.  If kernel use cases materialize, we can
annotate other syscalls.master as needed.

Submitted by:	Tal Garfinkel <talg@cs.stanford.edu>
Sponsored by:	DARPA, AFRL (in part)
Differential Revision:	https://reviews.freebsd.org/D14285
This commit is contained in:
Brooks Davis 2018-04-05 20:31:45 +00:00
parent 48990fce8e
commit 89ea4a30d6
2 changed files with 828 additions and 495 deletions

View File

@ -400,6 +400,16 @@ sed -e '
}
if (argtype[argc] == "")
parserr($f, "argument definition")
# The parser adds space around parens.
# Remove it from annotations.
gsub(/ \( /, "(", argtype[argc]);
gsub(/ \)/, ")", argtype[argc]);
#remove annotations
gsub(/_In[^ ]*[_)] /, "", argtype[argc]);
gsub(/_Out[^ ]*[_)] /, "", argtype[argc]);
argname[argc]=$f;
f += 2; # skip name, and any comma
}

File diff suppressed because it is too large Load Diff