]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
of/irq: Fix interrupt-map cell length check in of_irq_parse_imap_parent()
authorZijun Hu <quic_zijuhu@quicinc.com>
Mon, 9 Dec 2024 13:24:59 +0000 (21:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Dec 2024 12:53:00 +0000 (13:53 +0100)
commitcd126daadfe289dfccee90cf1f63fa1d62efeb73
treeef574462a7421d3df5402bfa16fee65c0cb2ae7a
parent61f3036bc24679c8f915caaa59574a807f60a42e
of/irq: Fix interrupt-map cell length check in of_irq_parse_imap_parent()

commit fec3edc47d5cfc2dd296a5141df887bf567944db upstream.

On a malformed interrupt-map property which is shorter than expected by
1 cell, we may read bogus data past the end of the property instead of
returning an error in of_irq_parse_imap_parent().

Decrement the remaining length when skipping over the interrupt parent
phandle cell.

Fixes: 935df1bd40d4 ("of/irq: Factor out parsing of interrupt-map parent phandle+args from of_irq_parse_raw()")
Cc: stable@vger.kernel.org
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Link: https://lore.kernel.org/r/20241209-of_irq_fix-v1-1-782f1419c8a1@quicinc.com
[rh: reword commit msg]
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/of/irq.c