Re: [RFC PATCH v19 2/5] security: Add new SHOULD_EXEC_CHECK and SHOULD_EXEC_RESTRICT securebits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 16/07/2024 16:02, Jeff Xu wrote:
For below two cases: will they be restricted by one (or some) mode above ?

1> cat /tmp/a.sh | sh

2> sh -c "$(cat /tmp/a.sh)"

It will almost certainly depend on your context, but to properly lock down a system, they must be restricted. "We were unable to check the file" ought to be treated the same as "the file failed the check".

If your goal is to only execute files that have been pre-approved in some manner, you're implying that you don't want interactive execution at all (since that is not a file that's been pre-approved). So a mere "sh" or "sh -c ..." would be restricted without checking anything other than the secure bit.

Cheers,
Steve




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux