From nobody Sat Apr 08 19:45:02 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 4Pv5L71TY6z44nlk; Sat, 8 Apr 2023 19:45:03 +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 4Pv5L66YjDz44T6; Sat, 8 Apr 2023 19:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680983103; 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=D+oHELZE98MT7R7/U1+nAxgulsB8dhF8ytueWolAMW4=; b=UrXh9uprFkxE+Z/6tXkiaANkgk8WN3vdKz0pfcC9iAqSt1Bg5NhmggZ0UWv2aIn03WeYhy uIjvEta+bv3K1EDIYANLpq/hJaSNr0HjqXkhBfaFQ8r0dIqe3UdSSyrrSUu9gxlx4AqW96 PuGlxov/PpAX1YJdOcV66a5Ugcc0/l0nO7MfUgrolKMeFDpMCZktWoyaQQB/9vHO273g3a 2PLHUHzcyPaGYRJGT+u4srXrKdnKv1ZnCAoHa3RRP3s26cgMF41J8+6/eikMZxD0AmTgvw Jq+zLrbwF1XGcq1BfpYndabrBEvzn/GBs632fvwcicMFWsbcsNw5Q1cEJAU7WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680983103; 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=D+oHELZE98MT7R7/U1+nAxgulsB8dhF8ytueWolAMW4=; b=NuLBiO3ThbHNt/YuQ3qAeWpViZTZtFQ8Wckxrn2HCn5pJddcSSoh9mpPwi5LuSganZPejY kO9spQC5vVhw5X4g9sFc2wf5LXMtTH7h9doIOY0bJu5cNgDbDsJVX/+IlhBKlJ4ltaSu+K G+ceXwOnDE76banOQQFG0b+PIhAkNX5gZBk8eI2eiMAXj4SUZFGR0AuvskUytrHth9gJPY lqyaBIfQ4Ptve4yNiy1n/X5rnKZMO1jzQjKdD5t+ImTdDz2YiS0ZwQ02IaIZbcVNa0SsZt o1cuNepkuYEZNxWHSTc2Vo++YS3dXx4A6fk0vD6bSe8FPCiLY2xdHQPvYzEpaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1680983103; a=rsa-sha256; cv=none; b=BxrUQcDEmIlaKcQ2V2aYry2Ukb0tA/3zKKajVfBS05gsq0nZtRM0z55YCRd7Pq3FzrAFvr bWaaR3WWcxePkvKXw/rGWfQCmS37CYGiRiMTE5COymN+56/i6+TJ0cbd71gNdKSwTHI3n3 +IABSxIul2aILBPanL1OD1uIlFn68qlKfPcWGOpnEsMubhErtdZUUipUagNFf+vlJZY39P OJBuPK4ELHllx/eqzCfHZZj0CJViAFmFpeu2pCowK1V+Z0fK1QiYak0PcAk63EwTeKy7Vo tse8n1LFA6h6R+NSb0uog5z1TYur3jDlY+eQORN5QBqgxKRaXlIgyyxDDEJe8Q== 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 4Pv5L62XM6zfsx; Sat, 8 Apr 2023 19:45:02 +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 338Jj2fb018926; Sat, 8 Apr 2023 19:45:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 338Jj2Lm018925; Sat, 8 Apr 2023 19:45:02 GMT (envelope-from git) Date: Sat, 8 Apr 2023 19:45:02 GMT Message-Id: <202304081945.338Jj2Lm018925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: efd56d95cde2 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: efd56d95cde2f4f3a2df2d71e1c4eb76bbbec76b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=efd56d95cde2f4f3a2df2d71e1c4eb76bbbec76b commit efd56d95cde2f4f3a2df2d71e1c4eb76bbbec76b Author: Alexander V. Chernikov AuthorDate: 2023-02-18 17:41:48 +0000 Commit: Alexander V. Chernikov 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); } }