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=-6.9 required=3.0 tests=DKIM_ADSP_ALL,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 3E4ABC432C0 for ; Sat, 30 Nov 2019 13:32:21 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F3FAB2073C for ; Sat, 30 Nov 2019 13:32:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=valentin-vidic.from.hr header.i=@valentin-vidic.from.hr header.b="CXX1d0bx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3FAB2073C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=valentin-vidic.from.hr Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1ib2qy-0005zb-7Y; Sat, 30 Nov 2019 08:32:04 -0500 Received: from valentin-vidic.from.hr ([94.229.67.141]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1ib2qv-0005zT-II for kernelnewbies@kernelnewbies.org; Sat, 30 Nov 2019 08:32:01 -0500 X-Virus-Scanned: Debian amavisd-new at valentin-vidic.from.hr Received: by valentin-vidic.from.hr (Postfix, from userid 1000) id 9A01F363; Sat, 30 Nov 2019 14:31:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=valentin-vidic.from.hr; s=2017; t=1575120718; bh=d+JHN0TcE2kCykQqbgMyCJ01d0b7oVBKrSAaZmUzKCM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CXX1d0bxe3w4uGV7b/PW5UiXJzFWbHyahCVucgtTjBYINSPk6Ncl/nLkL+xyRVFcH D0+u5zmUBQv4q4vUazgg3/z81aqFxJdfnasHJ75uqFUrh1TTx24d5KZi7AI19VoBu3 ehoBFpySWjayrgs8GJQiuD8dlmRXSn0DL/EFZk+G4ZE67tN2vvzx6ubrYN3DWVvNLL 4JVzaM2/5oTSwjdxlmizwpwMmLAqMdgrJkiTXHvbbxY7cNKAmbUdiq6tr0drLbqRiB y3MWmNj+Cx1CcmuXXxQAWrHLITbn2F3ZrJ7SlTh4lHiF08eUe6Lcb1cLITxO7F43WE 36QRonnMTQeRA== Date: Sat, 30 Nov 2019 14:31:58 +0100 From: Valentin =?utf-8?B?VmlkacSH?= To: Jeffrey Walton Subject: Re: [PATCH] net/tls: Fix return values for setsockopt Message-ID: <20191130133158.GK20116@valentin-vidic.from.hr> References: <59577.1575110094@turing-police> <20191130125451.24616-1-vvidic@valentin-vidic.from.hr> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Valdis =?utf-8?Q?Kl=C4=93tnieks?= , kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Sat, Nov 30, 2019 at 08:15:56AM -0500, Jeffrey Walton wrote: > On Sat, Nov 30, 2019 at 7:55 AM Valentin Vidic > wrote: > > > > ENOTSUPP is not available in userspace: > > > > setsockopt failed, 524, Unknown error 524 > > > > Signed-off-by: Valentin Vidic > > --- > > net/tls/tls_main.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c > > index bdca31ffe6da..5830b8e02a36 100644 > > --- a/net/tls/tls_main.c > > +++ b/net/tls/tls_main.c > > @@ -496,7 +496,7 @@ static int do_tls_setsockopt_conf(struct sock *sk, char __user *optval, > > /* check version */ > > if (crypto_info->version != TLS_1_2_VERSION && > > crypto_info->version != TLS_1_3_VERSION) { > > - rc = -ENOTSUPP; > > + rc = -EINVAL; > > goto err_crypto_info; > > } > > A quick comment... ENOTSUP is available in [0] if you want > to stay in the "not supported" path. For this case I put EINVAL because other similar checks in do_tls_setsockopt_conf already use that (for example invalid value for crypto_info->cipher_type). -- Valentin _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies