summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorWojtek Wasko2025-03-03 18:13:43 +0200
committerGreg Kroah-Hartman2026-02-06 16:44:03 +0100
commit6fd6b7bff59f908616c5e289a8b3ab41a75c9667 (patch)
tree8281f611b674fc23bc5126f5c5553d70e590dbf9 /kernel
parent375abf52353ca5e1a2e5f763629a870f91d0c38a (diff)
posix-clock: Store file pointer in struct posix_clock_context
[ Upstream commit e859d375d1694488015e6804bfeea527a0b25b9f ] File descriptor based pc_clock_*() operations of dynamic posix clocks have access to the file pointer and implement permission checks in the generic code before invoking the relevant dynamic clock callback. Character device operations (open, read, poll, ioctl) do not implement a generic permission control and the dynamic clock callbacks have no access to the file pointer to implement them. Extend struct posix_clock_context with a struct file pointer and initialize it in posix_clock_open(), so that all dynamic clock callbacks can access it. Acked-by: Richard Cochran <richardcochran@gmail.com> Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Wojtek Wasko <wwasko@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/posix-clock.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c
index a6487a9d6085..b130bb56cc4e 100644
--- a/kernel/time/posix-clock.c
+++ b/kernel/time/posix-clock.c
@@ -129,6 +129,7 @@ static int posix_clock_open(struct inode *inode, struct file *fp)
goto out;
}
pccontext->clk = clk;
+ pccontext->fp = fp;
if (clk->ops.open) {
err = clk->ops.open(pccontext, fp->f_mode);
if (err) {