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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18D84C004D4 for ; Thu, 19 Jan 2023 10:01:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230296AbjASKA7 convert rfc822-to-8bit (ORCPT ); Thu, 19 Jan 2023 05:00:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230286AbjASKAY (ORCPT ); Thu, 19 Jan 2023 05:00:24 -0500 Received: from us-smtp-delivery-44.mimecast.com (unknown [207.211.30.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A4F067796 for ; Thu, 19 Jan 2023 02:00:21 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-369-nW76kCZIPne7wc871JK6_w-1; Thu, 19 Jan 2023 05:00:04 -0500 X-MC-Unique: nW76kCZIPne7wc871JK6_w-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A533A1818E58; Thu, 19 Jan 2023 10:00:03 +0000 (UTC) Received: from hog (unknown [10.39.192.162]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A87422026D68; Thu, 19 Jan 2023 10:00:02 +0000 (UTC) Date: Thu, 19 Jan 2023 10:58:32 +0100 From: Sabrina Dubroca To: Paolo Abeni Cc: netdev@vger.kernel.org, Eric Dumazet , "David S. Miller" , Jakub Kicinski Subject: Re: [PATCH net] net/ulp: use consistent error code when blocking ULP Message-ID: References: <7bb199e7a93317fb6f8bf8b9b2dc71c18f337cde.1674042685.git.pabeni@redhat.com> MIME-Version: 1.0 In-Reply-To: <7bb199e7a93317fb6f8bf8b9b2dc71c18f337cde.1674042685.git.pabeni@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: queasysnail.net Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 2023-01-18, 13:24:12 +0100, Paolo Abeni wrote: > The referenced commit changed the error code returned by the kernel > when preventing a non-established socket from attaching the ktls > ULP. Before to such a commit, the user-space got ENOTCONN instead > of EINVAL. > > The existing self-tests depend on such error code, and the change > caused a failure: > > RUN global.non_established ... > tls.c:1673:non_established:Expected errno (22) == ENOTCONN (107) > non_established: Test failed at step #3 > FAIL global.non_established > > In the unlikely event existing applications do the same, address > the issue by restoring the prior error code in the above scenario. > > Note that the only other ULP performing similar checks at init > time - smc_ulp_ops - also fails with ENOTCONN when trying to attach > the ULP to a non-established socket. > > Reported-by: Sabrina Dubroca > Fixes: 2c02d41d71f9 ("net/ulp: prevent ULP without clone op from entering the LISTEN status") > Signed-off-by: Paolo Abeni Reviewed-by: Sabrina Dubroca Thanks Paolo. -- Sabrina