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=-8.4 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_GIT 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 3DF7EC432C0 for ; Sat, 30 Nov 2019 12:55:47 +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 BBA6120801 for ; Sat, 30 Nov 2019 12:55:45 +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="j3xOp03M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBA6120801 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 1ib2HK-0005HM-6p; Sat, 30 Nov 2019 07:55:14 -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 1ib2HH-0005HF-5y for kernelnewbies@kernelnewbies.org; Sat, 30 Nov 2019 07:55:11 -0500 X-Virus-Scanned: Debian amavisd-new at valentin-vidic.from.hr Received: by valentin-vidic.from.hr (Postfix, from userid 1000) id 629FD2D6; Sat, 30 Nov 2019 13:55:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=valentin-vidic.from.hr; s=2017; t=1575118502; bh=pW9/x/Zaa3RBLFywltpoZxMRWGFuvmhPgETDh4Fc5RA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j3xOp03MtTXHjRqdoqgii6CA1d+RdArSqzk0qduQdjEjpzLNCXq2JLzwGgmg44FGz xJogkOYsC48Hw1276gSbiS2lXOiVuoGNqh2m0BosD1ObMZ/b8Hb4JOa1jVNESbKBop M1gQ3OY35a7OcWSArI1ydPOZbizo1n62qvfZvN0g5iCL4auRDlfQuLgakROQERLgnc ZSMPPNksd7tV9mE5sIiXGuJBOd/h5WI0dgKVMZtTz0OCM1s9ktxNCK6nmPGjugEORZ PLHEfx0zAGN+y0xxVSqc4rFbF+I/SwE6kS0BJDY1VxSD5aI8xjP7WZr1v71Epk7Mn8 PDSWjbA1RdA6w== From: Valentin Vidic To: =?UTF-8?q?Valdis=20Kl=C4=93tnieks?= Subject: [PATCH] net/tls: Fix return values for setsockopt Date: Sat, 30 Nov 2019 13:54:51 +0100 Message-Id: <20191130125451.24616-1-vvidic@valentin-vidic.from.hr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <59577.1575110094@turing-police> References: <59577.1575110094@turing-police> MIME-Version: 1.0 Cc: Valentin Vidic , 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 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; } @@ -723,7 +723,7 @@ static int tls_init(struct sock *sk) * share the ulp context. */ if (sk->sk_state != TCP_ESTABLISHED) - return -ENOTSUPP; + return -ENOTCONN; /* allocate tls context */ write_lock_bh(&sk->sk_callback_lock); -- 2.20.1 _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies