]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
posix-clock: Store file pointer in struct posix_clock_context
authorWojtek Wasko <wwasko@nvidia.com>
Mon, 3 Mar 2025 16:13:43 +0000 (18:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Jan 2026 09:27:30 +0000 (10:27 +0100)
commitba3a97c832725ccd0cf0904115c71ba30f4c2089
treeb9733cc33b550e75d4eaf16d1decb178c367e489
parentea2d9bfd422e92fd197f6a0b1fe7d81413b871e0
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>
include/linux/posix-clock.h
kernel/time/posix-clock.c