|
@@ -5,6 +5,7 @@
|
|
|
*/
|
|
|
|
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/Kernel/GlobalInformation.h>
|
|
|
+#include <Kernel/Process.h>
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
@@ -51,7 +52,12 @@ ErrorOr<void> SysFSGlobalInformation::refresh_data(OpenFileDescription& descript
|
|
|
return ENOMEM;
|
|
|
}
|
|
|
auto builder = TRY(KBufferBuilder::try_create());
|
|
|
- TRY(const_cast<SysFSGlobalInformation&>(*this).try_generate(builder));
|
|
|
+ TRY(Process::current().jail().with([&](auto& my_jail) -> ErrorOr<void> {
|
|
|
+ if (my_jail && !is_readable_by_jailed_processes())
|
|
|
+ return Error::from_errno(EPERM);
|
|
|
+ TRY(const_cast<SysFSGlobalInformation&>(*this).try_generate(builder));
|
|
|
+ return {};
|
|
|
+ }));
|
|
|
auto& typed_cached_data = static_cast<SysFSInodeData&>(*cached_data);
|
|
|
typed_cached_data.buffer = builder.build();
|
|
|
if (!typed_cached_data.buffer)
|