Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2187704pxa; Fri, 7 Aug 2020 05:29:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziRi6e/2CEYJtrhaDtdXjrRiyOsrtiTbQs1hDjTsWU4qjlyP7y9rP7SxKWz3OXH77r7xPl X-Received: by 2002:a17:907:20f5:: with SMTP id rh21mr8979504ejb.194.1596803358962; Fri, 07 Aug 2020 05:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596803358; cv=none; d=google.com; s=arc-20160816; b=UyqU1iRHdO4c2Yvn+0CDZ/nW/HWw7OPavJxzcT8ssPEfjdOf03QBOh09NfFA51DMJs +ZJx+nasJG5ixg87iQGWEmE2FIvL25ZtZppJTH9Wf1R7ulqwTCWyW0odzNSJDLHqzzWQ 8IABkREhklF+hACTS96nsmuxP0x5DHsxfoqcLvKc0WCNeTF0pJ8k0iUkzEZAE3EnsjlN jN1buJCDdcuGtjYf3QYsUeVpYGXladVu6udlZSmrxYwnahIUDYI/+Q4iHGkQV++kic8f FPfLCE++R5FvCpLx+rB8YcaJrVLqQ4SHh7ErfI7bc5RgBr4t1ts5htKqcyDjv2Kt5RWb YkOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=YOQ1FJbTC688U91SUr/3KQgxq03yZvsY2VJ/Qo+JSyQ=; b=QnVqWFOgEzLeCu8NZhMF2Vt0fp5LvLcr8TL92luZtWeVR/bIPKT5pncXyFvNbI6vwf 4C3g2/g79wJj2Qad5WBcaHIIBHZ7Duq/I/1wMUHHDj1VTj90NRjSi+4s6rJIEbkGcm40 XWESRKOhly2YG+Ie63JL3sYjFYMBsQb564GbC11oTLLvLAByVjFjUhoZuVpUIbYjvUAY GQEO9ht5zaJeibw1QOjsk6FpWmp+CmVyaHXGHCzrx/PV6YkIHDqmtLiR0RLWMCFwaQji shMcLcZbIgzLPbnvqN0nn0Pt2DG/QBDXHHtakxbwerDtcxB+3Yj8KllIP224py+NQPAq XgnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si5549664ejb.515.2020.08.07.05.28.56; Fri, 07 Aug 2020 05:29:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728478AbgHGM17 (ORCPT + 99 others); Fri, 7 Aug 2020 08:27:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727783AbgHGM17 (ORCPT ); Fri, 7 Aug 2020 08:27:59 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED276C061574 for ; Fri, 7 Aug 2020 05:27:58 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=localhost) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k41TV-0006hW-30; Fri, 07 Aug 2020 14:27:53 +0200 Message-ID: Subject: Re: [PATCH v2 net-next] net/tls: allow MSG_CMSG_COMPAT in sendmsg From: Rouven Czerwinski To: Jakub Kicinski , Pooja Trivedi Cc: Aviad Yehezkel , Boris Pismenny , Daniel Borkmann , netdev@vger.kernel.org, John Fastabend , linux-kernel@vger.kernel.org, kernel@pengutronix.de, "David S. Miller" Date: Fri, 07 Aug 2020 14:27:48 +0200 In-Reply-To: References: <20200806064906.14421-1-r.czerwinski@pengutronix.de> <20200806114657.42f1ce8c@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Organization: Pengutronix e.K. Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: r.czerwinski@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2020-08-07 at 10:26 +0200, Rouven Czerwinski wrote: > On Thu, 2020-08-06 at 11:46 -0700, Jakub Kicinski wrote: > > On Thu, 6 Aug 2020 08:49:06 +0200 Rouven Czerwinski wrote: > > > Trying to use ktls on a system with 32-bit userspace and 64-bit > > > kernel > > > results in a EOPNOTSUPP message during sendmsg: > > > > > > setsockopt(3, SOL_TLS, TLS_TX, …, 40) = 0 > > > sendmsg(3, …, msg_flags=0}, 0) = -1 EOPNOTSUPP (Operation not > > > supported) > > > > > > The tls_sw implementation does strict flag checking and does not > > > allow > > > the MSG_CMSG_COMPAT flag, which is set if the message comes in > > > through > > > the compat syscall. > > > > > > This patch adds MSG_CMSG_COMPAT to the flag check to allow the > > > usage of > > > the TLS SW implementation on systems using the compat syscall > > > path. > > > > > > Note that the same check is present in the sendmsg path for the > > > TLS > > > device implementation, however the flag hasn't been added there > > > for > > > lack > > > of testing hardware. > > > > > > Signed-off-by: Rouven Czerwinski > > > > I don't know much about the compat stuff, I trust our cmsg handling > > is > > fine? > > > > Just to be sure - did you run tools/testing/selftests/net/tls ? > > After some pains to get this to correctly compile I have two failing > tests, both for multi_chunk_sendfile: > > root@192:~ /usr/lib/kselftest/net/tls > [==========] Running 93 tests from 4 test cases. > … > [ RUN ] tls.12.multi_chunk_sendfile > multi_chunk_sendfile: Test terminated by timeout > [ FAIL ] tls.12.multi_chunk_sendfile > … > [ RUN ] tls.13.multi_chunk_sendfile > multi_chunk_sendfile: Test terminated by timeout > [ FAIL ] tls.13.multi_chunk_sendfile > … > [==========] 91 / 93 tests passed. > [ FAILED ] I just tested on my x86_64 workstation and these specific tests fail there too, do they only work on 5.8? They were added in 5.8, but I am running 5.7.11 here. It looks like these failures are not MSG_CMSG_COMPAT related. Pooja Trivedi do you have an idea? Regards, Rouven