All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH testsuite 0/2] FIOQSIZE followup fixes
@ 2022-04-21  8:17 Ondrej Mosnacek
  2022-04-21  8:17 ` [PATCH testsuite 1/2] policy/test_ioctl_xperms.te: add ioctl numbers for other arches Ondrej Mosnacek
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ondrej Mosnacek @ 2022-04-21  8:17 UTC (permalink / raw)
  To: selinux; +Cc: Richard Haines

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(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH testsuite 1/2] policy/test_ioctl_xperms.te: add ioctl numbers for other arches
  2022-04-21  8:17 [PATCH testsuite 0/2] FIOQSIZE followup fixes Ondrej Mosnacek
@ 2022-04-21  8:17 ` Ondrej Mosnacek
  2022-04-21  8:17 ` [PATCH testsuite 2/2] tests/ioctl: adjust size of variable passed to ioctl(2) Ondrej Mosnacek
  2022-04-22  7:48 ` [PATCH testsuite 0/2] FIOQSIZE followup fixes Ondrej Mosnacek
  2 siblings, 0 replies; 4+ messages in thread
From: Ondrej Mosnacek @ 2022-04-21  8:17 UTC (permalink / raw)
  To: selinux; +Cc: Richard Haines

The FIOQSIZE ioctl numbers differ across arches. Add missing numbers to
cover all arches currently supported by the Linux kernel.

Fixes: b11701a55614 ("tests/ioctl: switch to FIOQSIZE")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
 policy/test_ioctl_xperms.te | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/policy/test_ioctl_xperms.te b/policy/test_ioctl_xperms.te
index 5f570c3..1071bb9 100644
--- a/policy/test_ioctl_xperms.te
+++ b/policy/test_ioctl_xperms.te
@@ -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;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH testsuite 2/2] tests/ioctl: adjust size of variable passed to ioctl(2)
  2022-04-21  8:17 [PATCH testsuite 0/2] FIOQSIZE followup fixes Ondrej Mosnacek
  2022-04-21  8:17 ` [PATCH testsuite 1/2] policy/test_ioctl_xperms.te: add ioctl numbers for other arches Ondrej Mosnacek
@ 2022-04-21  8:17 ` Ondrej Mosnacek
  2022-04-22  7:48 ` [PATCH testsuite 0/2] FIOQSIZE followup fixes Ondrej Mosnacek
  2 siblings, 0 replies; 4+ messages in thread
From: Ondrej Mosnacek @ 2022-04-21  8:17 UTC (permalink / raw)
  To: selinux; +Cc: Richard Haines

FIOQSIZE 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.

Fixes: b11701a55614 ("tests/ioctl: switch to FIOQSIZE")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
 tests/ioctl/test_ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/ioctl/test_ioctl.c b/tests/ioctl/test_ioctl.c
index 6fff2d0..9bf732d 100644
--- a/tests/ioctl/test_ioctl.c
+++ b/tests/ioctl/test_ioctl.c
@@ -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);
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH testsuite 0/2] FIOQSIZE followup fixes
  2022-04-21  8:17 [PATCH testsuite 0/2] FIOQSIZE followup fixes Ondrej Mosnacek
  2022-04-21  8:17 ` [PATCH testsuite 1/2] policy/test_ioctl_xperms.te: add ioctl numbers for other arches Ondrej Mosnacek
  2022-04-21  8:17 ` [PATCH testsuite 2/2] tests/ioctl: adjust size of variable passed to ioctl(2) Ondrej Mosnacek
@ 2022-04-22  7:48 ` Ondrej Mosnacek
  2 siblings, 0 replies; 4+ messages in thread
From: Ondrej Mosnacek @ 2022-04-22  7:48 UTC (permalink / raw)
  To: SElinux list; +Cc: Richard Haines

On Thu, Apr 21, 2022 at 10:17 AM Ondrej Mosnacek <omosnace@redhat.com> wrote:
> 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(-)
>
> --
> 2.35.1

Both patches merged (the first one with a minor uppercase vs.
lowercase consistency correction).

-- 
Ondrej Mosnacek
Software Engineer, Linux Security - SELinux kernel
Red Hat, Inc.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-22  7:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21  8:17 [PATCH testsuite 0/2] FIOQSIZE followup fixes Ondrej Mosnacek
2022-04-21  8:17 ` [PATCH testsuite 1/2] policy/test_ioctl_xperms.te: add ioctl numbers for other arches Ondrej Mosnacek
2022-04-21  8:17 ` [PATCH testsuite 2/2] tests/ioctl: adjust size of variable passed to ioctl(2) Ondrej Mosnacek
2022-04-22  7:48 ` [PATCH testsuite 0/2] FIOQSIZE followup fixes Ondrej Mosnacek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.