diff options
| author | Konstantin Andreev <andreev@swemel.ru> | 2026-05-25 01:37:49 +0300 |
|---|---|---|
| committer | Casey Schaufler <casey@schaufler-ca.com> | 2026-06-22 13:52:24 -0700 |
| commit | a7c44fd9f80e37763acf9cd3c87a58058d206427 (patch) | |
| tree | 50ad3420d94d5696b8670f4da507c7f06396f1ce /tools/perf/scripts/python/stackcollapse.py | |
| parent | 577dc3b6a8cf200e6e27b2d9967cac14a1fed2f3 (diff) | |
smack: restrict smackfs/{direct,mapped} values to 0-255
Both smackfs/direct and smackfs/mapped incorrectly accept
the full range of integer values. For example:
# cd /sys/fs/smackfs/
# cat direct ; echo
250
# cat cipso2
@ 250/2
_ 250/2,4,5,6,7,8
* 250/3,5,7
^ 250/2,4,5,6,7
? 250/3,4,5,6,7,8
# echo -1234 >direct ; cat direct ; echo
-1234
# cat cipso2
@ -1234/2
_ -1234/2,4,5,6,7,8
* -1234/3,5,7
^ -1234/2,4,5,6,7
? -1234/3,4,5,6,7,8
#
I noticed two things regarding this:
1) sensitivity levels are truncated to 8 bits when labeling
outgoing packets (0x2e = 46 for the -1234 example above)
2) the reverse process fails: incoming packets with sensitivity
level 46 do not match these smackfs/cipso2 entries.
Even observation (1) on its own warrants a fix.
This patch restricts smackfs/direct and smackfs/mapped
accepted values to the 0-255 range.
Fixes: e114e473771c ("Smack: Simplified Mandatory Access Control Kernel")
Signed-off-by: Konstantin Andreev <andreev@swemel.ru>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
