Update device-labeling logic for Biba, LOMAC, and MLS to recognize new-style
pts devices when various policy ptys_equal flags are enabled. Submitted by: Estella Mystagic <estella at mystagic.com> MFC after: 1 week
This commit is contained in:
parent
256796db58
commit
9663e34384
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=204581
@ -955,6 +955,7 @@ biba_devfs_create_device(struct ucred *cred, struct mount *mp,
|
||||
biba_type = MAC_BIBA_TYPE_EQUAL;
|
||||
else if (ptys_equal &&
|
||||
(strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 ||
|
||||
strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 ||
|
||||
strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0))
|
||||
biba_type = MAC_BIBA_TYPE_EQUAL;
|
||||
else
|
||||
|
@ -1043,6 +1043,7 @@ lomac_devfs_create_device(struct ucred *cred, struct mount *mp,
|
||||
lomac_type = MAC_LOMAC_TYPE_EQUAL;
|
||||
else if (ptys_equal &&
|
||||
(strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 ||
|
||||
strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 ||
|
||||
strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0))
|
||||
lomac_type = MAC_LOMAC_TYPE_EQUAL;
|
||||
else
|
||||
|
@ -918,6 +918,7 @@ mls_devfs_create_device(struct ucred *cred, struct mount *mp,
|
||||
mls_type = MAC_MLS_TYPE_HIGH;
|
||||
else if (ptys_equal &&
|
||||
(strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 ||
|
||||
strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 ||
|
||||
strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0))
|
||||
mls_type = MAC_MLS_TYPE_EQUAL;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user