diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-07-01 16:56:56 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-07-01 16:56:56 +0000 |
commit | 9f2c78b3f9e8fee455c43e6025959a41def8d05c (patch) | |
tree | 17df965f74c1db32b96f98787ed33d0f1a9ef39d /sys/kern/vfs_mount.c | |
parent | 53a5aa36f727a7601d32284c8e756c3469b6ccd7 (diff) | |
download | FreeBSD-src-9f2c78b3f9e8fee455c43e6025959a41def8d05c.zip FreeBSD-src-9f2c78b3f9e8fee455c43e6025959a41def8d05c.tar.gz |
When auditing unmount(2), capture FSID arguments as regular text strings
rather than as paths, which would lead to them being treated as relative
pathnames and hence confusingly converted into absolute pathnames.
Capture flags to unmount(2) via an argument token.
Approved by: re (audit argument blanket)
MFC after: 3 days
Diffstat (limited to 'sys/kern/vfs_mount.c')
-rw-r--r-- | sys/kern/vfs_mount.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 10691a4..7a13719 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1113,6 +1113,7 @@ unmount(td, uap) char *pathbuf; int error, id0, id1; + AUDIT_ARG_VALUE(uap->flags); if (jailed(td->td_ucred) || usermount == 0) { error = priv_check(td, PRIV_VFS_UNMOUNT); if (error) @@ -1125,9 +1126,9 @@ unmount(td, uap) free(pathbuf, M_TEMP); return (error); } - AUDIT_ARG_UPATH(td, pathbuf, ARG_UPATH1); mtx_lock(&Giant); if (uap->flags & MNT_BYFSID) { + AUDIT_ARG_TEXT(pathbuf); /* Decode the filesystem ID. */ if (sscanf(pathbuf, "FSID:%d:%d", &id0, &id1) != 2) { mtx_unlock(&Giant); @@ -1143,6 +1144,7 @@ unmount(td, uap) } mtx_unlock(&mountlist_mtx); } else { + AUDIT_ARG_UPATH(td, pathbuf, ARG_UPATH1); mtx_lock(&mountlist_mtx); TAILQ_FOREACH_REVERSE(mp, &mountlist, mntlist, mnt_list) { if (strcmp(mp->mnt_stat.f_mntonname, pathbuf) == 0) |