Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1006280iol; Sun, 12 Jun 2022 03:40:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnhy5n1TYvKv/Aee6xmdC+whGPcxfxmN2vMmWRi/ZHBVMH65SQk6/2wYjzmJ6Z3dU3/38C X-Received: by 2002:a17:903:288:b0:168:9bb4:7ae4 with SMTP id j8-20020a170903028800b001689bb47ae4mr20350797plr.104.1655030419910; Sun, 12 Jun 2022 03:40:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655030419; cv=none; d=google.com; s=arc-20160816; b=g3X2EzFxUG7dhwCdSh13DjIe044kGPI6aqiUJ9zu1RiZ8M/es5axGDXRleQKGU0aJV /N/93CS1zIczR1W2hVi94/FlbS8W1GMLOMqJSWA8wMFyaNfxdFVKTeHuvMqJQcnkz0Bo Jj8H0CXh82X7pX0/7MMYmN4D1Ytl55SmpgVgnFfR5MYZQ2lHT/OGqdRqcJSMgGJdj0Ev Z51bYLkm/AiKV6D6lMoLsCaw5ruPc04w8eAFBL3ZBCs1pyZXL1aBHuGo7zT1L0TvAtKo AKkW7HK9NAVjwxvBfyh/7Ixghjmf7c+EtZORg/Wx4ZnoB3Lz+WrjqDUqHDmvd+NwbqdQ lodw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=Ea5VDYyACTdLFfDR1OzYQ+USVPk0XrM3SL5Uf8rgmF0=; b=wG3pPfyy1XQ1DygpwRylqfrVD2VQhg9OdeZiU9xCEyy4b3zxrRdWtq/zRVRA5xJPhG JQW+78P3AS+2nqmx5t3q6d+sWVzNVRTZnBS4cG29MtF8T9vDshmHE4DTAqkURlw+aWkl mYz/Ank+Dade2PrTKCtxMZH4AnrxPtp8WyEVzRDKGlv5fdtf1WN918wlvjVan+1CXGcl peX0doxIHgrWjX6OqNnPI4n3DSamx771qFSVzRCh3sTgxgT4hJ0EfpuuMwPcnT2BHDDq jd+U7UC3qHDidVe+cncRk8wnAi4cVf2LqyAUPkDBRB2Xg/pwGG+RO+WjW2s6dXT4ej6a q1MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=KR0M7uzW; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id il14-20020a17090b164e00b001e30e046cfcsi7071844pjb.46.2022.06.12.03.40.08; Sun, 12 Jun 2022 03:40:19 -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; dkim=pass header.i=@fastly.com header.s=google header.b=KR0M7uzW; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235430AbiFLJA7 (ORCPT + 99 others); Sun, 12 Jun 2022 05:00:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235303AbiFLJAr (ORCPT ); Sun, 12 Jun 2022 05:00:47 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A50149F3E for ; Sun, 12 Jun 2022 02:00:45 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id z17so1482730wmi.1 for ; Sun, 12 Jun 2022 02:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ea5VDYyACTdLFfDR1OzYQ+USVPk0XrM3SL5Uf8rgmF0=; b=KR0M7uzWU0BPwWn1Brdk2z+8Fi7ZcEFz/0BqFDgszVZgE8lwHoAW6oSObc3l1b6vr4 BoC6dWRtE6EBumonrLPkkC91REo5S9yRXWhNwSvD4HcKvP5LKq/IS1A2cXQD+219YWhl ZvQrPdoNkDwgS4izTjiqJ0S57mfhBZYKU3hDk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ea5VDYyACTdLFfDR1OzYQ+USVPk0XrM3SL5Uf8rgmF0=; b=CJKgXrYYQr6dv1Cq8WdnH7JPtdTQGRDgb/Yi4kus/KBoXDV3Sj/dslOYZoUomImbdL yLKqwh8gb001mMay0kaupKuF0IHhOOnkoQ7XyXXdvlK0l5CSwSHIj4DC4RQK1MZ+9kBf mJJs2LyszgzBESIe+ttckeh6gBLR9Zf+YTDdX2WQ37IR+rNhIgd6bAUtKt9jpX/rOfhB T/erDs8QbJhXmwvtTUl5SUur0LLtUoCFYXZmoLJIpjBi4JFus71bKnrces6YpbYd1GGW lEYlHYYsA62OUl7d/5pd4sp8YY6JSXfOlkLFtW8t1H+oEh9ormpBKalGfzhQMVIFb72k XaOQ== X-Gm-Message-State: AOAM532qaJ39R5R6+82VHeibxXzv1ut40kTw2r6zXV7jpeg5iTVSBAw/ tXtU7wDtLe1LJS6umT1weM25Cg== X-Received: by 2002:a7b:c346:0:b0:397:626d:d2c4 with SMTP id l6-20020a7bc346000000b00397626dd2c4mr8629025wmj.172.1655024444792; Sun, 12 Jun 2022 02:00:44 -0700 (PDT) Received: from localhost.localdomain ([178.130.153.185]) by smtp.gmail.com with ESMTPSA id d34-20020a05600c4c2200b0039c5b4ab1b0sm4798603wmp.48.2022.06.12.02.00.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jun 2022 02:00:43 -0700 (PDT) From: Joe Damato To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Joe Damato Subject: [RFC,net-next v2 5/8] net: unix: Support MSG_NTCOPY Date: Sun, 12 Jun 2022 01:57:54 -0700 Message-Id: <1655024280-23827-6-git-send-email-jdamato@fastly.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1655024280-23827-1-git-send-email-jdamato@fastly.com> References: <1655024280-23827-1-git-send-email-jdamato@fastly.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org Add support for MSG_NTCOPY to unix sockets. The helper function msg_set_iter_copy_type is used to set the copy flag on the iovec iterator correctly. Signed-off-by: Joe Damato --- net/unix/af_unix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 3453e00..b8f522d 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -1905,6 +1905,8 @@ static int unix_dgram_sendmsg(struct socket *sock, struct msghdr *msg, skb_put(skb, len - data_len); skb->data_len = data_len; skb->len = len; + + msg_set_iter_copy_type(msg); err = skb_copy_datagram_from_iter(skb, 0, &msg->msg_iter, len); if (err) goto out_free; @@ -2165,6 +2167,8 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg, skb_put(skb, size - data_len); skb->data_len = data_len; skb->len = size; + + msg_set_iter_copy_type(msg); err = skb_copy_datagram_from_iter(skb, 0, &msg->msg_iter, size); if (err) { kfree_skb(skb); -- 2.7.4