public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/3] Various fixes for out-of-bound uaccess
@ 2023-10-23 13:56 Kevin Brodsky
  2023-10-23 13:56 ` [LTP] [PATCH 1/3] syscalls/{, f}setxattr: Fix passing of value pointer Kevin Brodsky
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Kevin Brodsky @ 2023-10-23 13:56 UTC (permalink / raw)
  To: ltp; +Cc: Kevin Brodsky

Hi,

This series addresses various situations where syscalls tests cause the
kernel to access arbitrary data, beyond the bounds of the object that
the test meant to specify.

Patch 1 and 2 are straightforward fixes for tests that don't pass
syscall arguments correctly.

Patch 3 is a little subtler, in that the argument is appropriately
passed, but the kernel ends up accessing arbitrary data due to the
referenced buffer being too small.

These issues were caught while running the syscalls suite on
Morello [1], using the pure-capability ABI [2]. Thanks to the capability
representation, pointers carry bounds that match the object they refer
to. The kernel accesses user memory via such capabilities, and as a
result a syscall will fail (-EFAULT) if any uaccess goes out of bounds.

A CI run can be found here [3].

Cheers,
Kevin

[1] https://www.morello-project.org/
[2] https://git.morello-project.org/morello/kernel/linux/-/wikis/Morello-pure-capability-kernel-user-Linux-ABI-specification
[3] https://github.com/kevin-brodsky-arm/ltp/actions/runs/6610988117

Kevin Brodsky (3):
  syscalls/{,f}setxattr: Fix passing of value pointer
  syscalls/msgctl06: Pass an appropriate struct to msgsnd()
  Provide a PATH_MAX-long buffer when expecting ENAMETOOLONG

 include/old/usctest.h                             | 12 ++----------
 testcases/kernel/syscalls/fsetxattr/fsetxattr01.c |  2 +-
 testcases/kernel/syscalls/ipc/msgctl/msgctl06.c   |  6 +++++-
 testcases/kernel/syscalls/rename/rename10.c       |  2 +-
 testcases/kernel/syscalls/setxattr/setxattr01.c   |  2 +-
 5 files changed, 10 insertions(+), 14 deletions(-)

-- 
2.38.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2023-10-24 10:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-23 13:56 [LTP] [PATCH 0/3] Various fixes for out-of-bound uaccess Kevin Brodsky
2023-10-23 13:56 ` [LTP] [PATCH 1/3] syscalls/{, f}setxattr: Fix passing of value pointer Kevin Brodsky
2023-10-23 13:56 ` [LTP] [PATCH 2/3] syscalls/msgctl06: Pass an appropriate struct to msgsnd() Kevin Brodsky
2023-10-23 13:56 ` [LTP] [PATCH 3/3] Provide a PATH_MAX-long buffer when expecting ENAMETOOLONG Kevin Brodsky
2023-10-23 14:40   ` Cyril Hrubis
2023-10-23 14:50     ` Kevin Brodsky
2023-10-23 15:06       ` Cyril Hrubis
2023-10-24  9:07         ` Kevin Brodsky
2023-10-24  9:36           ` Cyril Hrubis
2023-10-24 10:36             ` Kevin Brodsky
2023-10-23 14:39 ` [LTP] [PATCH 0/3] Various fixes for out-of-bound uaccess Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox