Kernel: Don't leak kmalloc pointers through FIFO absolute paths

Instead of using the FIFO's memory address as part of its absolute path
identity, just use an incrementing FIFO index instead.

Note that this is not used for anything other than debugging (it helps
you identify which file descriptors refer to the same FIFO by looking
at /proc/PID/fds
This commit is contained in:
Andreas Kling 2020-01-07 07:29:50 +01:00
commit 56a2c21e0c
Notes: sideshowbarker 2024-07-19 10:18:07 +09:00
2 changed files with 5 additions and 11 deletions

View file

@ -14,8 +14,6 @@ public:
Writer
};
static RefPtr<FIFO> from_fifo_id(u32);
static NonnullRefPtr<FIFO> create(uid_t);
virtual ~FIFO() override;
@ -43,4 +41,6 @@ private:
DoubleBuffer m_buffer;
uid_t m_uid { 0 };
int m_fifo_id { 0 };
};