FIOQSIZE followup fixes
cover FIOQSIZE followup fixes
Two small fixes for the recently merged switch to FIOQSIZE. One was found when the testsuite was run on ppc64le and s390x arches, the other one when looking at the code.
Ondrej Mosnacek (2):
policy/test_ioctl_xperms.te: add ioctl numbers for other arches tests/ioctl: adjust size of variable passed to ioctl(2)
policy/test_ioctl_xperms.te | 3 ++- tests/ioctl/test_ioctl.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.35.1
PATCH 1/2 policy/test_ioctl_xperms.te: add ioctl numbers for other arches
The FIOQSIZE ioctl numbers differ across arches. Add missing numbers to cover all arches currently supported by the Linux kernel.
--- policy/test_ioctl_xperms.te | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
policy/test_ioctl_xperms.te +2 -1
@@ -1,4 +1,5 @@ -define(`FIOQSIZE', `{ 0x00005460 }') +# include FIOQSIZE ioctl numbers through all arches +define(`FIOQSIZE', `{ 0x545E 0x5460 0x667f 0x6680 }') # Domain for process that is allowed the required ioctl xperms. type test_ioctl_xperm_t;
Signature · 1 line
2.35.1
PATCH 2/2 tests/ioctl: adjust size of variable passed to ioctl(2)
In reply to Ondrej MosnacekFIOQSIZE returns a result of type loff_t, which maps to long long int, so make sure that the variable is large enough to not cause stack corruption.
--- tests/ioctl/test_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/ioctl/test_ioctl.c +1 -1
@@ -18,7 +18,7 @@ int main(int argc, char **argv)int fd;int rc; -int val =0 ; +long long int val =0 ; fd =open (argv[1 ],O_RDONLY ,0 );
Signature · 1 line
2.35.1
Quoted 8 lines · Ondrej Mosnacek
Two small fixes for the recently merged switch to FIOQSIZE. One was found when the testsuite was run on ppc64le and s390x arches, the other one when looking at the code.
Ondrej Mosnacek (2):
policy/test_ioctl_xperms.te: add ioctl numbers for other arches tests/ioctl: adjust size of variable passed to ioctl(2)
Quoted 6 lines
policy/test_ioctl_xperms.te | 3 ++- tests/ioctl/test_ioctl.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)--
2.35.1
Both patches merged (the first one with a minor uppercase vs. lowercase consistency correction).
Signature · 3 lines
Ondrej Mosnacek Software Engineer, Linux Security - SELinux kernel Red Hat, Inc.