Message ID | 20230413114705.157046-1-kevin.brodsky@arm.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp971919vqo; Thu, 13 Apr 2023 04:52:23 -0700 (PDT) X-Google-Smtp-Source: AKy350aDT1U+Z+hsU7DSTOn/NPU0WoP6V7RECA6+XZxfzC+mAikQOoGaqsU2lwiz41LA1zBvJn/a X-Received: by 2002:a17:907:1b1b:b0:94e:4fac:d92b with SMTP id mp27-20020a1709071b1b00b0094e4facd92bmr2521287ejc.58.1681386743176; Thu, 13 Apr 2023 04:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681386743; cv=none; d=google.com; s=arc-20160816; b=ssjc9Eb3+Oc3IhpHTfmw3K4cO95uz4RYqDWnEAsWKyPTRzdlXeITWAYJXKrK0BSDWz L5Rt/mvb6l+6Ho7RXzJuiPqmHHpjQ8uP+Q5Abshpzi3cxoLUcJq94+wAPkSCmfcIhPog F8R0F0fOOqTTFYmtqyRXC2Jv+YfXtb1qdWIEYUGg+fm3m2PlboXq5EhA5IVJGKjZU989 4k/qX9npARYy6UHtoaf2jzEIzHKCzZTLv/k0O/jDASqdue7PZAHZsILmZmJ+8D1/bq4A 2hYF+pEhqtsURlYw7Vf6DxqM5W0SD2BotPzBh/SJUq00lMLTsXUWsIQnRtg1C0IUShx2 kXjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Ijhg0h+yWm3+qlsw51WSoZ03j8ktCVOEgLtwS4JEMK8=; b=c78tyCY7rxWpj/DceNiaRw5vrNu23+ra28b78Ux8qyT9+rsY0GWhYcqVrHYPpkm41W 1jdAlVfmB3IWc010Ls3HfQWudh690uE1LbKnBH2huaX0F5krGPl5jUpLfjkElo3j54AN 3VaMKPeuIWRymvAsMBRhhKzVAdKPObYRFoY3V2CvZTrw8XgXxzkVxBghE7w9B5VNm04t Tt415HsTaHzyl/JMamAgpn84Lr9cJ50fmsEGuZDmNuA1MD6/gTl9Qct9zNHbnfYR6bVu Htd+Fwj3fOx8fBEfAsZ0ZJ6n/YBrXKs72BVZJPfUyKuVcegKsZapoLNSoYyYFAEHYn34 eKZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a1709060fd400b0094e7446dff5si1793897ejk.939.2023.04.13.04.51.58; Thu, 13 Apr 2023 04:52:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230459AbjDMLsI (ORCPT <rfc822;peter110.wang@gmail.com> + 99 others); Thu, 13 Apr 2023 07:48:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbjDMLr5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 13 Apr 2023 07:47:57 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 93441A5E9; Thu, 13 Apr 2023 04:47:34 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4D7AAD75; Thu, 13 Apr 2023 04:48:02 -0700 (PDT) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.65]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CFED43F73F; Thu, 13 Apr 2023 04:47:16 -0700 (PDT) From: Kevin Brodsky <kevin.brodsky@arm.com> To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Kevin Brodsky <kevin.brodsky@arm.com>, Christoph Hellwig <hch@lst.de>, Eric Dumazet <edumazet@google.com>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org> Subject: [PATCH v2 0/3] net: Finish up ->msg_control{,_user} split Date: Thu, 13 Apr 2023 12:47:02 +0100 Message-Id: <20230413114705.157046-1-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762883105635200398?= X-GMAIL-MSGID: =?utf-8?q?1763061785692730543?= |
Series |
net: Finish up ->msg_control{,_user} split
|
|
Message
Kevin Brodsky
April 13, 2023, 11:47 a.m. UTC
Hi, Commit 1f466e1f15cf ("net: cleanly handle kernel vs user buffers for ->msg_control") introduced the msg_control_user and msg_control_is_user fields in struct msghdr, to ensure that user pointers are represented as such. It also took care of converting most users of struct msghdr::msg_control where user pointers are involved. It did however miss a number of cases, and some code using msg_control inappropriately has also appeared in the meantime. This series is attempting to complete the split, by eliminating the remaining cases where msg_control is used when in fact a user pointer is stored in the union (patch 1). It also addresses a couple of issues with msg_control_is_user: one where it is not updated as it should (patch 2), and one where it is not initialised (patch 3). v1..v2: * Split out the msg_control_is_user fixes into separate patches. v1: https://lore.kernel.org/all/20230411122625.3902339-1-kevin.brodsky@arm.com/ Thanks, Kevin Cc: Christoph Hellwig <hch@lst.de> Cc: Eric Dumazet <edumazet@google.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jakub Kicinski <kuba@kernel.org> Kevin Brodsky (3): net: Ensure ->msg_control_user is used for user buffers net/compat: Update msg_control_is_user when setting a kernel pointer net/ipv6: Initialise msg_control_is_user net/compat.c | 13 +++++++------ net/core/scm.c | 9 ++++++--- net/ipv4/tcp.c | 4 ++-- net/ipv6/ipv6_sockglue.c | 1 + 4 files changed, 16 insertions(+), 11 deletions(-)
Comments
Hello: This series was applied to netdev/net-next.git (main) by David S. Miller <davem@davemloft.net>: On Thu, 13 Apr 2023 12:47:02 +0100 you wrote: > Hi, > > Commit 1f466e1f15cf ("net: cleanly handle kernel vs user buffers for > ->msg_control") introduced the msg_control_user and > msg_control_is_user fields in struct msghdr, to ensure that user > pointers are represented as such. It also took care of converting most > users of struct msghdr::msg_control where user pointers are involved. It > did however miss a number of cases, and some code using msg_control > inappropriately has also appeared in the meantime. > > [...] Here is the summary with links: - [v2,1/3] net: Ensure ->msg_control_user is used for user buffers https://git.kernel.org/netdev/net-next/c/c39ef2130491 - [v2,2/3] net/compat: Update msg_control_is_user when setting a kernel pointer https://git.kernel.org/netdev/net-next/c/60daf8d40b80 - [v2,3/3] net/ipv6: Initialise msg_control_is_user https://git.kernel.org/netdev/net-next/c/b6d85cf5bd14 You are awesome, thank you!