From nobody Sat May 28 20:53:32 2022 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 2DEC51B50D89; Sat, 28 May 2022 20:53:33 +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 4L9YmX2RNzz4l4r; Sat, 28 May 2022 20:53:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653771212; 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=fbQO7p+V5P19uHVVjCUntOhIY/XNqYoDMWwXzzZZmss=; b=hczj3uziu/q3gQV/Of8iem8vQm+I5ZBPMI8DJPktnrCG8yixPm4JelaXRAALK1UseHEk8y ssdyjlABVc/dLNZ4KmnOIqWqSlXEoGb5RoTMuohf59iuK9l3cHYdRIi2DBFbFO1ZD4fFOM 4RBfgZe8Q3gYndW6WY30LjgaR4WjTYtMTu0VWE0pMoGkvOM47/+YP4Kw7g+mbje1jRfpUI bFukeQHb8b0sxXORqexfGjPflqBtCS8w7Ticcx2DwM6SMRK2pHDhIRIA4knGEwcNQtsjqW lU92I7jsIrp/zML9PfgY1q4paPfU7NtUrAF6vVYPyQurqyXbsAB7y9M4+UUoiA== 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 2FF7015E5D; Sat, 28 May 2022 20:53:32 +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 24SKrWoA099585; Sat, 28 May 2022 20:53:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24SKrWQ7099584; Sat, 28 May 2022 20:53:32 GMT (envelope-from git) Date: Sat, 28 May 2022 20:53:32 GMT Message-Id: <202205282053.24SKrWQ7099584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 3735f9cff1e8 - main - linux(4): Handle multiple mbufs in a control message chain in recvmsg 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3735f9cff1e8a7ce7079b957bc3b37f0f886caed Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653771212; 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=fbQO7p+V5P19uHVVjCUntOhIY/XNqYoDMWwXzzZZmss=; b=LPg/q18OEIWXqD2+8L41bLY3sNSjzTsVtD+5H3IW20IeS9iv3AIOSLlq2PursBYtDmgduj Q+Z3qxYfjnSKn+Emwn/BINN9p4YdSElmKAlSehtlyvVR+XacNgwlLEBL0H9ygqRniizSLg nqG12w1PZuY8kLFmBIRzTaGkHRsEANluhGbFVgeeIsKuRANm62r+ozV172ItgSRZNEKpYq AxPm8PSuy/DXEdYy/QMTi59ErWFTSpb/NoczATMrQLsKhMnHwjlqtjjcSAhoo8ilG9N6DA cUZHTY+RPKVoLqX2aK/nSNRAyoEGv1dvfcCwUSxtvR9RGK1oK1xyB3+9z/TYRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653771212; a=rsa-sha256; cv=none; b=AiQ1lzZzukt9FyuJsB4Sh59TECL12rHEeC3WgzSZNI0S/L4V5NAff9sFTZeteCZh4eeqwI jEenaKPIJkONO36Zz4g3dOhK9p+SP6TNsXNSUSv74oXxXuJP9mPHWbHTMTQkFhkQZNLGlM gIQ8N/6JKJoaIdqfmU9BYdNBf5rOQg2JpfF/OQ5q5RDw662SLrzAnAKlR1N8qch84Hxkhr a5ph6kviTbisLqvw5K4pVHScmtEyX4QyxZYsQmZG7kgaWCI8d1BZf7oFzUUe0JJmKWyPv9 zJ4TE1bye/rMDpd27xCFBSm/T/o8OfhRL46bgwe1FCbJtTMfMHtXQ24E59CSlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=3735f9cff1e8a7ce7079b957bc3b37f0f886caed commit 3735f9cff1e8a7ce7079b957bc3b37f0f886caed Author: Dmitry Chagin AuthorDate: 2022-05-28 20:48:45 +0000 Commit: Dmitry Chagin CommitDate: 2022-05-28 20:48:45 +0000 linux(4): Handle multiple mbufs in a control message chain in recvmsg PR: 230274 MFC after: 2 weeks --- sys/compat/linux/linux_socket.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 67da1b51a86e..9434e40709bb 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1727,7 +1727,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struct l_msghdr *msghdr, socklen_t datalen, maxlen, outlen; struct l_msghdr l_msghdr; struct iovec *iov, *uiov; - struct mbuf *control = NULL; + struct mbuf *m, *control = NULL; struct mbuf **controlp; struct sockaddr *sa; caddr_t outbuf; @@ -1797,10 +1797,10 @@ linux_recvmsg_common(struct thread *td, l_int s, struct l_msghdr *msghdr, lcm = malloc(L_CMSG_HDRSZ, M_LINUX, M_WAITOK | M_ZERO); msg->msg_control = mtod(control, struct cmsghdr *); msg->msg_controllen = control->m_len; - cm = CMSG_FIRSTHDR(msg); outbuf = PTRIN(l_msghdr.msg_control); outlen = 0; - while (cm != NULL) { + for (m = control; m != NULL; m = m->m_next) { + cm = mtod(m, struct cmsghdr *); lcm->cmsg_type = bsd_to_linux_cmsg_type(p, cm->cmsg_type, cm->cmsg_level); lcm->cmsg_level = bsd_to_linux_sockopt_level(cm->cmsg_level); @@ -1876,7 +1876,6 @@ cont: if (error == 0) { outbuf += LINUX_CMSG_ALIGN(datalen); outlen += LINUX_CMSG_LEN(datalen); - cm = CMSG_NXTHDR(msg, cm); } } err: