From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0789FC64E90 for ; Mon, 30 Nov 2020 15:16:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD1A920719 for ; Mon, 30 Nov 2020 15:16:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Kfrc/sLA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727870AbgK3PQn (ORCPT ); Mon, 30 Nov 2020 10:16:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725899AbgK3PQn (ORCPT ); Mon, 30 Nov 2020 10:16:43 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C421DC0613D2 for ; Mon, 30 Nov 2020 07:15:56 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id h21so25576970wmb.2 for ; Mon, 30 Nov 2020 07:15:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NesG8pcsYSfQoY/slcY4d6T+07DJ7f3FoANgYGzQoKc=; b=Kfrc/sLA475KYNnrjuw5pkeVf7Ij1Kfep3ag+tD2Pby0kKSV1ZCOesoodBqSdmosjh kFGXP/RNXSeSYMuB6x3ZBqFaJVbNYFSuTlkehEkm1IDuCJKJ6WMKtMHSJj0om6qDN0CI TSFsXMgH+PrrRO148Q7zuDRRDc9anlvb3A17wMRONtTqSVfyFA6KK+cDD54dN5a2S43L HG2DeY3hc1ceTZMv313WDhO7/d610lAcTiE71HeqdvJOOyH/I4i4vpEjx5X03+TEGX1e rRalO9uO1snwKC1PT4+2wkq8EhxMLUhUL/gN0bmo3c4J+Om923DZbmA+8qDU6pcVtLdw S6Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NesG8pcsYSfQoY/slcY4d6T+07DJ7f3FoANgYGzQoKc=; b=KJDY2+nAuQz1FraSsJFpTQSQM68ULv7UVTmeqyFyYuBiDzZ95kjr9fPAMdIyet/3XZ sQKcugVlT/XS4ypI6IxJ1T9FJaLsuNOgjDUl6HBrcozIpXOewLvOZaEOBpcwLPqeZvYD U4tpWVRdDpXmBI+GJVcrsaKUo8N4kzqdoHyaeltpjBrEU9lME18gtNKFrsGc5eSMcacb bVjMT0GcXxzOJnbnBfzaTIg3fN/dJqhnV9QTbRSso/7XkfMaCNPkPoEWB88vA/991t0E JYAKOQvAxyCuJoXjl1ABCRCN13Hq3M+pSbWw7/ja1eUTAxzML8LHg2p9JNGx5UaM/OMM nOeA== X-Gm-Message-State: AOAM533jJFaDwStVOv0587Odb41IoHGrh9Q41CEaCEVF2Tc4tf538X4r 2NSeEd/8bXc4Or2HzIl5q9nPmxlG5tDA777N3tEYww== X-Google-Smtp-Source: ABdhPJzs/DZ+fzz23J4RJ9c/ym5TsIHOzSYgN4LtJmT8ecjk4Lxu9If4SyD3IX8KHKdz5SLMGUY7LAM3WMyejkRzPRQ= X-Received: by 2002:a7b:cb09:: with SMTP id u9mr22204317wmj.25.1606749355171; Mon, 30 Nov 2020 07:15:55 -0800 (PST) MIME-Version: 1.0 References: <4bb2cb8a-c3ef-bfa9-7b04-cb2cca32d3ee@samba.org> <5d71d36c-0bfb-a313-07e8-0e22f7331a7a@samba.org> <12153e6a-37b1-872f-dd82-399e255eef5d@samba.org> In-Reply-To: From: Soheil Hassas Yeganeh Date: Mon, 30 Nov 2020 10:15:19 -0500 Message-ID: Subject: Re: [RFC 0/1] whitelisting UDP GSO and GRO cmsgs To: Stefan Metzmacher Cc: Victor Stewart , io-uring , Luke Hsiao , "David S. Miller" , Jann Horn , Arjun Roy , netdev , Jens Axboe Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Mon, Nov 30, 2020 at 10:05 AM Stefan Metzmacher wrote: > > Hi Soheil, > > > Thank you for CCing us. > > > > The reason for PROTO_CMSG_DATA_ONLY is explained in the paragraph > > above in the commit message. PROTO_CMSG_DATA_ONLY is basically to > > allow-list a protocol that is guaranteed not to have the privilege > > escalation in https://crbug.com/project-zero/1975. TCP doesn't have > > that issue, and I believe UDP doesn't have that issue either (but > > please audit and confirm that with +Jann Horn). > > > > If you couldn't find any non-data CMSGs for UDP, you should just add > > PROTO_CMSG_DATA_ONLY to inet dgram sockets instead of introducing > > __sys_whitelisted_cmsghdrs as Stefan mentioned. > > Was there a specific reason why you only added the PROTO_CMSG_DATA_ONLY check > in __sys_recvmsg_sock(), but not in __sys_sendmsg_sock()? We only needed this for recvmsg(MSG_ERRQUEUE) to support transmit zerocopy. So, we took a more conservative approach and didn't add it for sendmsg(). I believe it should be fine to add it for TCP sendmsg, because for SO_MARK we check the user's capability: if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN)) return -EPERM; I believe udp_sendmsg() is sane too and I cannot spot any issue there. > metze > > >