Date: Sat, 8 Apr 2023 19:45:02 GMT From: "Alexander V. Chernikov" <melifaro@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: efd56d95cde2 - stable/13 - netlink: do not crash when linux message translation fails. Message-ID: <202304081945.338Jj2Lm018925@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=efd56d95cde2f4f3a2df2d71e1c4eb76bbbec76b commit efd56d95cde2f4f3a2df2d71e1c4eb76bbbec76b Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2023-02-18 17:41:48 +0000 Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> CommitDate: 2023-04-08 19:14:31 +0000 netlink: do not crash when linux message translation fails. CID: 1498889 MFC after: 2 weeks (cherry picked from commit 453c7d6803aa9cbbaec74c7706276736de22f7b4) --- sys/netlink/netlink_io.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netlink/netlink_io.c b/sys/netlink/netlink_io.c index fb8006f689e4..509065d04818 100644 --- a/sys/netlink/netlink_io.c +++ b/sys/netlink/netlink_io.c @@ -430,9 +430,11 @@ nl_receive_message(struct nlmsghdr *hdr, int remaining_length, struct nlmsghdr *hdr_orig = hdr; hdr = linux_netlink_p->msg_from_linux(nlp->nl_proto, hdr, npt); if (hdr == NULL) { - npt->hdr = hdr_orig; + /* Failed to translate to kernel format. Report an error back */ + hdr = hdr_orig; + npt->hdr = hdr; if (hdr->nlmsg_flags & NLM_F_ACK) - nlmsg_ack(nlp, EAGAIN, hdr, npt); + nlmsg_ack(nlp, EOPNOTSUPP, hdr, npt); return (0); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202304081945.338Jj2Lm018925>