mac_veriexec supports adding a label (i.e. a bounded string) for each file it has in its metastore. Curiously enough, the functions to add a label to a verified file are there (from manifest parsing to syscall). However, it seems there are no function to read that label back.
This change adds to the existing ioctl on /dev/veriexec so we can retrieve the label of a given file. I further added an option to the veriexec binary so it can return the label.
We plan to use the label to further guarantee that the sensitive program we intend to execute is indeed the right one (and not a hard link to a verified /bin/true).