Kernel: Allow read access sparingly to some /sys/kernel directory nodes

Those nodes are not exposing any sensitive information so there's no
harm in exposing them.
This commit is contained in:
Liav A 2022-11-12 20:04:20 +02:00 committed by Andrew Kaster
parent 1ca0ac5207
commit 95d8aa2982
13 changed files with 26 additions and 0 deletions

View file

@ -23,6 +23,8 @@ public:
private: private:
SysFSDiskUsage(SysFSDirectory const& parent_directory); SysFSDiskUsage(SysFSDirectory const& parent_directory);
virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override; virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override;
virtual bool is_readable_by_jailed_processes() const override { return true; }
}; };
} }

View file

@ -23,6 +23,8 @@ public:
private: private:
explicit SysFSInterrupts(SysFSDirectory const& parent_directory); explicit SysFSInterrupts(SysFSDirectory const& parent_directory);
virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override; virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override;
virtual bool is_readable_by_jailed_processes() const override { return true; }
}; };
} }

View file

@ -23,6 +23,8 @@ public:
private: private:
explicit SysFSKeymap(SysFSDirectory const& parent_directory); explicit SysFSKeymap(SysFSDirectory const& parent_directory);
virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override; virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override;
virtual bool is_readable_by_jailed_processes() const override { return true; }
}; };
} }

View file

@ -23,6 +23,8 @@ public:
private: private:
explicit SysFSMemoryStatus(SysFSDirectory const& parent_directory); explicit SysFSMemoryStatus(SysFSDirectory const& parent_directory);
virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override; virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override;
virtual bool is_readable_by_jailed_processes() const override { return true; }
}; };
} }

View file

@ -22,6 +22,8 @@ public:
private: private:
explicit SysFSNetworkARPStats(SysFSDirectory const&); explicit SysFSNetworkARPStats(SysFSDirectory const&);
virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override; virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override;
virtual bool is_readable_by_jailed_processes() const override { return true; }
}; };
} }

View file

@ -22,6 +22,8 @@ public:
private: private:
explicit SysFSNetworkAdaptersStats(SysFSDirectory const&); explicit SysFSNetworkAdaptersStats(SysFSDirectory const&);
virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override; virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override;
virtual bool is_readable_by_jailed_processes() const override { return true; }
}; };
} }

View file

@ -22,6 +22,8 @@ public:
private: private:
explicit SysFSLocalNetStats(SysFSDirectory const&); explicit SysFSLocalNetStats(SysFSDirectory const&);
virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override; virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override;
virtual bool is_readable_by_jailed_processes() const override { return true; }
}; };
} }

View file

@ -22,6 +22,8 @@ public:
private: private:
explicit SysFSNetworkRouteStats(SysFSDirectory const&); explicit SysFSNetworkRouteStats(SysFSDirectory const&);
virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override; virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override;
virtual bool is_readable_by_jailed_processes() const override { return true; }
}; };
} }

View file

@ -22,6 +22,8 @@ public:
private: private:
explicit SysFSNetworkTCPStats(SysFSDirectory const&); explicit SysFSNetworkTCPStats(SysFSDirectory const&);
virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override; virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override;
virtual bool is_readable_by_jailed_processes() const override { return true; }
}; };
} }

View file

@ -22,6 +22,8 @@ public:
private: private:
explicit SysFSNetworkUDPStats(SysFSDirectory const&); explicit SysFSNetworkUDPStats(SysFSDirectory const&);
virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override; virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override;
virtual bool is_readable_by_jailed_processes() const override { return true; }
}; };
} }

View file

@ -23,6 +23,8 @@ public:
private: private:
explicit SysFSOverallProcesses(SysFSDirectory const& parent_directory); explicit SysFSOverallProcesses(SysFSDirectory const& parent_directory);
virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override; virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override;
virtual bool is_readable_by_jailed_processes() const override { return true; }
}; };
} }

View file

@ -23,6 +23,8 @@ public:
private: private:
explicit SysFSSystemStatistics(SysFSDirectory const& parent_directory); explicit SysFSSystemStatistics(SysFSDirectory const& parent_directory);
virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override; virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override;
virtual bool is_readable_by_jailed_processes() const override { return true; }
}; };
} }

View file

@ -22,6 +22,8 @@ public:
private: private:
explicit SysFSUptime(SysFSDirectory const& parent_directory); explicit SysFSUptime(SysFSDirectory const& parent_directory);
virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override; virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override;
virtual bool is_readable_by_jailed_processes() const override { return true; }
}; };
} }