apparmor/parser/tst/simple_tests/file
John Johansen e2d55844a2 parser: fix integer overflow bug in rule priority comparisons
There is an integer overflow when comparing priorities when cmp is
used because it uses subtraction to find lessthan, equal, and greater
than in one operation.

But INT_MAX and INT_MIN are being used by priorities and this results
in INT_MAX - INT_MIN and INT_MIN - INT_MAX which are both overflows
causing an incorrect comparison result and selection of the wrong
rule permission.

Closes: https://gitlab.com/apparmor/apparmor/-/issues/452
Fixes: e3fca60d1 ("parser: add the ability to specify a priority prefix to rules")
Signed-off-by: John Johansen <john.johansen@canonical.com>
2024-10-28 04:03:53 -07:00
..
allow treewide: spelling/typo fixes in comments and docs 2020-12-01 12:47:11 -08:00
file treewide: spelling/typo fixes in comments and docs 2020-12-01 12:47:11 -08:00
owner parser: add basic alternation tests, along with their file and owner 2013-12-03 16:34:17 -08:00
priority parser: fix integer overflow bug in rule priority comparisons 2024-10-28 04:03:53 -07:00
bad_append_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
bad_append_2.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
bad_bare_file_outside.sd Add tests for various rules outside of a profile 2015-10-19 21:13:48 +02:00
bad_comma_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
bad_embedded_0_1.sd And the related patch to fix globbing for af_unix abstract names 2015-02-12 10:19:16 -08:00
bad_embedded_0_2.sd And the related patch to fix globbing for af_unix abstract names 2015-02-12 10:19:16 -08:00
bad_embedded_0_3.sd And the related patch to fix globbing for af_unix abstract names 2015-02-12 10:19:16 -08:00
bad_embedded_spaces_1.sd Parser: fix error when using regex profile names in IPC rules 2014-10-01 15:54:30 -07:00
bad_link_outside.sd Add tests for various rules outside of a profile 2015-10-19 21:13:48 +02:00
bad_lock_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
bad_re_brace_1.sd parser: add test case for empty character class regex 2013-12-03 15:55:54 -08:00
bad_re_brace_2.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
bad_re_brace_3.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
dos_line_endings.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
front_perms_ok_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_2.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_3.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_4.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_5.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_alternations_1.sd parser: add basic alternation tests, along with their file and owner 2013-12-03 16:34:17 -08:00
ok_alternations_2.sd parser: add basic alternation tests, along with their file and owner 2013-12-03 16:34:17 -08:00
ok_alternations_3.sd parser: remove length restriction in convert_aaregex_to_pcre usage 2013-12-16 01:15:17 -08:00
ok_append_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_audit_deny_link.sd parser: fix compilation failure of deny link rules 2015-03-23 11:25:48 -07:00
ok_bare_1.sd parser: Move failing test to TODO 2016-02-11 16:01:13 -06:00
ok_carat_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_carat_2.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_comma_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_comma_2.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_deny_1.sd parser - add simple file deny rule tests 2013-10-11 22:33:05 -07:00
ok_deny_2.sd parser - add simple file deny rule tests 2013-10-11 22:33:05 -07:00
ok_deny_3.sd parser - add simple file deny rule tests 2013-10-11 22:33:05 -07:00
ok_deny_4.sd parser - add simple file deny rule tests 2013-10-11 22:33:05 -07:00
ok_deny_link.sd parser: fix compilation failure of deny link rules 2015-03-23 11:25:48 -07:00
ok_embedded_spaces_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_embedded_spaces_2.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_embedded_spaces_3.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_embedded_spaces_4.sd Parser: fix error when using regex profile names in IPC rules 2014-10-01 15:54:30 -07:00
ok_inv_char_class.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_link_1.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_link_2.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_link_3.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_link_audit_deny_owner_subset.sd Add testcases for 'owner link' rules 2019-04-22 13:36:33 +02:00
ok_link_owner.sd Add testcases for 'owner link' rules 2019-04-22 13:36:33 +02:00
ok_lock_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_mmap_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_mmap_2.sd treewide: spelling/typo fixes in comments and docs 2020-12-01 12:47:11 -08:00
ok_octal_1.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_octal_2.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_other_1.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_other_2.sd add keyword 'other' vim syntax support, plus language parsing tests 2014-01-24 11:17:23 -08:00
ok_other_3.sd add keyword 'other' vim syntax support, plus language parsing tests 2014-01-24 11:17:23 -08:00
ok_quoted_1.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_quoted_2.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_quoted_3.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_quoted_4.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_quoted_5.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_slashquote_1.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
stacking_ok_1.sd parser: Support stacking in exec and change_profile rules 2016-03-18 17:28:51 -05:00
var1_ok_audit_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_ok_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_ok_link_1.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_ok_link_2.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_ok_link_3.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_src_ok_audit_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_src_ok_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_src_ok_link_1.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_src_ok_link_2.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_src_ok_link_3.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_target_ok_audit_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_target_ok_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_target_ok_link_1.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_target_ok_link_2.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_target_ok_link_3.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_ok_audit_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_ok_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_ok_link_1.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_ok_link_2.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_ok_link_3.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_src_ok_audit_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_src_ok_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_src_ok_link_1.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_src_ok_link_2.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_src_ok_link_3.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_target_ok_audit_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_target_ok_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_target_ok_link_1.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_target_ok_link_2.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_target_ok_link_3.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00