From 73f565d1b836fa1d6af86efe7838f8407368508c Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sun, 23 Dec 2018 22:12:36 +0000 Subject: [PATCH] netlink_smc_diag: fix off-by-one error in xlat lookup * netlink_smc_diag.c (decode_smc_diag_shutdown): Decrement xlat size by one to account for XLAT_END as other users of xlats do. Fixes: v4.25~54 "netlink_smc_diag: decode SMC_DIAG_SHUTDOWN attribute value" --- netlink_smc_diag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlink_smc_diag.c b/netlink_smc_diag.c index 88337829..25809fc8 100644 --- a/netlink_smc_diag.c +++ b/netlink_smc_diag.c @@ -136,7 +136,7 @@ decode_smc_diag_shutdown(struct tcb *const tcp, const void *const opaque_data) { const struct decode_nla_xlat_opts opts = { - ARRSZ_PAIR(sock_shutdown_flags), "???_SHUTDOWN", + ARRSZ_PAIR(sock_shutdown_flags) - 1, "???_SHUTDOWN", .size = 1, };