From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
patches@lists.linux.dev, Lin Ma <linma@zju.edu.cn>,
Florian Westphal <fw@strlen.de>,
Tung Nguyen <tung.q.nguyen@dektech.com.au>,
Jakub Kicinski <kuba@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 4.19 42/49] net: tipc: resize nlattr array to correct size
Date: Mon, 19 Jun 2023 12:30:20 +0200 [thread overview]
Message-ID: <20230619102132.123492586@linuxfoundation.org> (raw)
In-Reply-To: <20230619102129.856988902@linuxfoundation.org>
From: Lin Ma <linma@zju.edu.cn>
[ Upstream commit 44194cb1b6045dea33ae9a0d54fb7e7cd93a2e09 ]
According to nla_parse_nested_deprecated(), the tb[] is supposed to the
destination array with maxtype+1 elements. In current
tipc_nl_media_get() and __tipc_nl_media_set(), a larger array is used
which is unnecessary. This patch resize them to a proper size.
Fixes: 1e55417d8fc6 ("tipc: add media set to new netlink api")
Fixes: 46f15c6794fb ("tipc: add media get/dump to new netlink api")
Signed-off-by: Lin Ma <linma@zju.edu.cn>
Reviewed-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Tung Nguyen <tung.q.nguyen@dektech.com.au>
Link: https://lore.kernel.org/r/20230614120604.1196377-1-linma@zju.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/tipc/bearer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 0f970259d0d5a..4353968bc5a5c 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -1128,7 +1128,7 @@ int tipc_nl_media_get(struct sk_buff *skb, struct genl_info *info)
struct tipc_nl_msg msg;
struct tipc_media *media;
struct sk_buff *rep;
- struct nlattr *attrs[TIPC_NLA_BEARER_MAX + 1];
+ struct nlattr *attrs[TIPC_NLA_MEDIA_MAX + 1];
if (!info->attrs[TIPC_NLA_MEDIA])
return -EINVAL;
@@ -1177,7 +1177,7 @@ int __tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info)
int err;
char *name;
struct tipc_media *m;
- struct nlattr *attrs[TIPC_NLA_BEARER_MAX + 1];
+ struct nlattr *attrs[TIPC_NLA_MEDIA_MAX + 1];
if (!info->attrs[TIPC_NLA_MEDIA])
return -EINVAL;
--
2.39.2
next prev parent reply other threads:[~2023-06-19 10:42 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-19 10:29 [PATCH 4.19 00/49] 4.19.287-rc1 review Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 01/49] power: supply: ab8500: Fix external_power_changed race Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 02/49] power: supply: bq27xxx: Use mod_delayed_work() instead of cancel() + schedule() Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 03/49] ARM: dts: vexpress: add missing cache properties Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 04/49] power: supply: Ratelimit no data debug output Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 05/49] regulator: Fix error checking for debugfs_create_dir Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 06/49] irqchip/meson-gpio: Mark OF related data as maybe unused Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 07/49] power: supply: Fix logic checking if system is running from battery Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 08/49] parisc: Improve cache flushing for PCXL in arch_sync_dma_for_cpu() Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 09/49] MIPS: Alchemy: fix dbdma2 Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 10/49] mips: Move initrd_start check after initrd address sanitisation Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 11/49] xen/blkfront: Only check REQ_FUA for writes Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 12/49] ocfs2: fix use-after-free when unmounting read-only filesystem Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 13/49] ocfs2: check new file size on fallocate call Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 14/49] nios2: dts: Fix tse_mac "max-frame-size" property Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 15/49] nilfs2: fix incomplete buffer cleanup in nilfs_btnode_abort_change_key() Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 16/49] nilfs2: fix possible out-of-bounds segment allocation in resize ioctl Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 17/49] kexec: support purgatories with .text.hot sections Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 18/49] powerpc/purgatory: remove PGO flags Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 19/49] nouveau: fix client work fence deletion race Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 20/49] RDMA/uverbs: Restrict usage of privileged QKEYs Greg Kroah-Hartman
2023-06-19 10:29 ` [PATCH 4.19 21/49] net: usb: qmi_wwan: add support for Compal RXM-G1 Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 22/49] Remove DECnet support from kernel Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 23/49] USB: serial: option: add Quectel EM061KGL series Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 24/49] usb: dwc3: gadget: Reset num TRBs before giving back the request Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 25/49] usb: gadget: f_ncm: Add OS descriptor support Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 26/49] usb: gadget: f_ncm: Fix NTP-32 support Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 27/49] netfilter: nfnetlink: skip error delivery on batch in case of ENOMEM Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 28/49] ping6: Fix send to link-local addresses with VRF Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 29/49] RDMA/rxe: Remove the unused variable obj Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 30/49] RDMA/rxe: Removed unused name from rxe_task struct Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 31/49] RDMA/rxe: Fix the use-before-initialization error of resp_pkts Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 32/49] IB/uverbs: Fix to consider event queue closing also upon non-blocking mode Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 33/49] IB/isert: Fix dead lock in ib_isert Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 34/49] IB/isert: Fix possible list corruption in CMA handler Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 35/49] IB/isert: Fix incorrect release of isert connection Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 36/49] sctp: fix an error code in sctp_sf_eat_auth() Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 37/49] igb: fix nvm.ops.read() error handling Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 38/49] drm/nouveau/dp: check for NULL nv_connector->native_mode Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 39/49] drm/nouveau/kms: Dont change EDID when it hasnt actually changed Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 40/49] drm/nouveau: add nv_encoder pointer check for NULL Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 41/49] net: lapbether: only support ethernet devices Greg Kroah-Hartman
2023-06-19 10:30 ` Greg Kroah-Hartman [this message]
2023-06-19 10:30 ` [PATCH 4.19 43/49] selftests/ptp: Fix timestamp printf format for PTP_SYS_OFFSET Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 44/49] neighbour: Remove unused inline function neigh_key_eq16() Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 45/49] net: Remove unused inline function dst_hold_and_use() Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 46/49] neighbour: delete neigh_lookup_nodev as not used Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 47/49] drm/nouveau/kms: Fix NULL pointer dereference in nouveau_connector_detect_depth Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 48/49] powerpc: Fix defconfig choice logic when cross compiling Greg Kroah-Hartman
2023-06-19 10:30 ` [PATCH 4.19 49/49] mmc: block: ensure error propagation for non-blk Greg Kroah-Hartman
2023-06-20 9:19 ` [PATCH 4.19 00/49] 4.19.287-rc1 review Chris Paterson
2023-06-20 10:21 ` Jon Hunter
2023-06-20 10:46 ` Sudip Mukherjee (Codethink)
2023-06-20 11:04 ` Naresh Kamboju
2023-06-20 21:05 ` Shuah Khan
2023-06-21 0:37 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230619102132.123492586@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=fw@strlen.de \
--cc=kuba@kernel.org \
--cc=linma@zju.edu.cn \
--cc=patches@lists.linux.dev \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tung.q.nguyen@dektech.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).