Kernel/ProcFS: Make various things superuser-only once again

File and directory permissions regressed with the recent ProcFS changes.
This patch restores the superuser-only permissions where appropriate.
This commit is contained in:
Andreas Kling 2021-07-28 18:59:53 +02:00
parent 58f62cd1d0
commit 07141434e0
Notes: sideshowbarker 2024-07-18 07:59:48 +09:00
2 changed files with 9 additions and 0 deletions

View file

@ -539,6 +539,8 @@ class ProcFSDmesg final : public ProcFSGlobalInformation {
public:
static NonnullRefPtr<ProcFSDmesg> must_create();
virtual mode_t required_mode() const override { return 0400; }
private:
ProcFSDmesg();
virtual bool output(KBufferBuilder& builder) override
@ -670,6 +672,8 @@ class ProcFSModules final : public ProcFSGlobalInformation {
public:
static NonnullRefPtr<ProcFSModules> must_create();
virtual mode_t required_mode() const override { return 0400; }
private:
ProcFSModules();
virtual bool output(KBufferBuilder& builder) override
@ -695,6 +699,8 @@ class ProcFSProfile final : public ProcFSGlobalInformation {
public:
static NonnullRefPtr<ProcFSProfile> must_create();
virtual mode_t required_mode() const override { return 0400; }
private:
ProcFSProfile();
virtual bool output(KBufferBuilder& builder) override

View file

@ -143,6 +143,7 @@ public:
virtual gid_t owner_group() const override { return m_associated_process ? m_associated_process->gid() : 0; }
virtual KResult refresh_data(FileDescription&) const override;
virtual RefPtr<ProcFSExposedComponent> lookup(StringView name) override;
virtual mode_t required_mode() const override { return 0500; }
virtual void prepare_for_deletion() override;
@ -234,6 +235,8 @@ public:
return process->gid();
}
virtual mode_t required_mode() const override { return 0400; }
protected:
ProcFSProcessInformation(StringView name, const ProcFSProcessDirectory& process_directory)
: ProcFSExposedComponent(name)