From nobody Sat Feb 18 17:55:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJxCt29LPz3spYv; Sat, 18 Feb 2023 17:55:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PJxCs2bjcz4Gm7; Sat, 18 Feb 2023 17:55:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676742905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HowWIIf5RiFc9heyAErVlnF5M51NubcBy2Pe0hIovKg=; b=XPMIQtlIo/GrTSRdk8XdotR8iYTy13eXik4Q6DBwoJV3VVx5skGuw7HEzg8G3ATVlqZ53L REIx4XRfw3Q4YcjRsZdMUYJxiEDqY7elYqpOD/snL8QitPOorfxfuYzpuwO9HYgQub9e+Z IkOpRy9uiAg6l0J1PgebuLIaocb1B9JUDlRjS7IHaQZZlpcC1i+WZGrgt7oll9H+eZyaqJ gGmbY11su0VgfmuhRZCu/WQVR4mCR1cNuPuwVKZeGuddkN8B/wyQdSNNzmkaRKyFH/08fN k+OWltEryO5kiOKJanIPR3F7+GeX6/lO/hPdbUkpLU0UpBSVYpeCNkKFdoxjuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676742905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HowWIIf5RiFc9heyAErVlnF5M51NubcBy2Pe0hIovKg=; b=Zj67qVKEU88rjbeFFouVokbwn/kfysvdrTWD4QEFl0X+lpCswPNcloOH1vN2ELs0YG74IL n+5IACWkljePu9PWNyLjSJcuJaInJtqewuYz3ILyiDp1QUqyvp/RHQAmA8fdO9E+mqiu+u sucMOvbIxVSWQZsExwrcf1DO2IM4sbXh9DbdCmLCbn778gm1BiuvtIS3EI4oIWQDjx0uZE k5dkYIeSH2Fs16NOshx0E5RP3lcZmfHkmBPOm9II8L9EZRaJpxFMoFbIhSNDFSmKd7vupM 6d0dStZAx9e8F0Xghed0OB9RrKFER/jRQCjV/tVzm20jYhqoJIPf5X/f7ebUIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676742905; a=rsa-sha256; cv=none; b=Xxn6erzZ46rdmQ+HOWyD4SBnzkZ/2OOVLZzRo5yRUEY3xxVOisuCafW4HieUgIEGGd1q5v f76pq4V2dWySJyDiA0iJOFDtzeyLUsOxVbKmVKVXxpEbqvVwthzfpD5/TcykmgIkHxh1Q0 7gdIkwIdDPuyTENzvr/oh9rnVz5L5HEuVUw922Qf15Qjht8O6ka6D0qk29JhsNf2Hja1/6 7syO0l4DK+qMPTCgDU4knCCF4ObxBzXGo+sSJmkBaZIJ+KNu+QRw1Sd/qb92HQIXbsf+Li 5UVMMAosWi21Y/ZePZRxBVQxQru6UmlWeCkxP3BWVZt6HakCH9UrAUBvOzY/5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJxCs1hmyzWRJ; Sat, 18 Feb 2023 17:55:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31IHt5uL083507; Sat, 18 Feb 2023 17:55:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31IHt5u7083506; Sat, 18 Feb 2023 17:55:05 GMT (envelope-from git) Date: Sat, 18 Feb 2023 17:55:05 GMT Message-Id: <202302181755.31IHt5u7083506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 453c7d6803aa - main - netlink: do not crash when linux message translation fails. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 453c7d6803aa9cbbaec74c7706276736de22f7b4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=453c7d6803aa9cbbaec74c7706276736de22f7b4 commit 453c7d6803aa9cbbaec74c7706276736de22f7b4 Author: Alexander V. Chernikov AuthorDate: 2023-02-18 17:41:48 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-18 17:53:06 +0000 netlink: do not crash when linux message translation fails. CID: 1498889 MFC after: 2 weeks --- 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); } }