linux/drivers/dpll
Ivan Vecera 7cce782d83 dpll: use exact lookup for reference sync pin id
dpll_pin_ref_sync_state_set() looks up the reference sync pin in the
pin->ref_sync_pins xarray, which is keyed by the sync pin's id (see
dpll_pin_ref_sync_pair_add() using xa_insert() with ref_sync_pin->id).
The pin id to operate on is supplied by userspace via DPLL_A_PIN_ID.

The lookup however used xa_find() with a ULONG_MAX limit, which returns
the first present entry with an index greater than or equal to the
requested id, not the entry stored exactly at that id. If userspace
passes an id that is not paired as a reference sync pin, but another
pin with a higher id is present in the xarray, xa_find() silently
returns that wrong pin and the subsequent ref_sync_set() operates on
it. The request only fails when the given id is larger than every
present key.

Use xa_load() for an exact-key lookup instead, mirroring the deletion
path in dpll_pin_ref_sync_pair_del().

Fixes: 58256a26bf ("dpll: add reference sync get/set")
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Link: https://patch.msgid.link/20260917143736.526221-1-ivecera@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-21 17:19:42 -07:00
..
zl3073x dpll: zl3073x: add PTP clock support 2026-08-18 09:40:06 -07:00
dpll_core.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-08-18 10:42:41 -07:00
dpll_core.h dpll: use pin owner's dpll ref for pin-level attribute reporting 2026-07-24 16:15:19 -07:00
dpll_netlink.c dpll: use exact lookup for reference sync pin id 2026-09-21 17:19:42 -07:00
dpll_netlink.h dpll: extend pin notifier with notification source ID 2026-06-13 13:24:34 -07:00
dpll_nl.c dpll: add DPLL_PIN_TYPE_INT_NCO pin type 2026-07-06 14:45:05 +02:00
dpll_nl.h dpll: add pin operational state 2026-04-30 16:21:49 +02:00
Kconfig dpll: Add reference count tracking support 2026-02-05 15:57:46 +01:00
Makefile dpll: Add basic Microchip ZL3073x support 2025-07-09 19:08:52 -07:00