From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x225zLVVjJgusdDrEogJhsNxhtw3etJTMISEEk9lkW17GVaQM4uDHjJhJBwScYJtXjTfnfT9a ARC-Seal: i=1; a=rsa-sha256; t=1517256874; cv=none; d=google.com; s=arc-20160816; b=DIL/xDGQ16zmzWdTr8991cHsntieffy+Cici1zMEnUBgnY2z78r1350Uca7RowGpA1 9zR4uByPG14RU5Yo/kf41fuc4+em+12d7oc2ktCYNCLfrH/vX9FSEDtkSEPoar+jSOEJ awsTD46Ec9X8W2JqKM46B92WO+eTs/nmJfLpFe4MFX69vEm0+y6BPrgPZmkEIG4NMqCW rmfnhnopgXItwrRslssUYObU00Jph92KNTtd+J3H8Qnvj50vN0Hvm6tkTo0NCqXSYOPl 7HwT3vlY9sqzo7xfle7WX/Ogt/2fY1P3icIaZs440TNDJCPr7o4mNfsbio0A5r2C3a/S TB4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=kAkEqP/8Q08hxLYC6pQdHUmDt/SxX3/eU4m6y3O8UkY=; b=wUsiSM/mzCAdEN/rl/hWyg9fJw9e5WI9qwE3ZHLD7Uox6yK7NWgD3P8PwxSWWvzfaZ BsCErCfor8iYKtC4OlRY0Y9iZW+4o70tOPCSLuoKqDSRRnSsIfvH9zhw1aITIJMT74vK lc/knVZkG1/CMaqSdiCRFLPceOAtvON6xr8qDdMymWscexHdy/Ag7IW78oWjQ0CN/bKm ArtVR/qEqY8jn0ADpDhmLsm8BCZ1qXd6WFAX+j8nvOlCrUJJcpMUvUHqtl6qoAYiUF+m s+vRM/wiLhNWuYIAi9EgSo4A6ZLquzA8yCtqatlE4kk2zUVvRyPLx+iCwiLo47bRTbEu wyxg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sabrina Dubroca , "David S. Miller" Subject: [PATCH 4.14 56/71] tls: return -EBUSY if crypto_info is already set Date: Mon, 29 Jan 2018 13:57:24 +0100 Message-Id: <20180129123831.271071306@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180129123827.271171825@linuxfoundation.org> References: <20180129123827.271171825@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590959143939240269?= X-GMAIL-MSGID: =?utf-8?q?1590959143939240269?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sabrina Dubroca [ Upstream commit 877d17c79b66466942a836403773276e34fe3614 ] do_tls_setsockopt_tx returns 0 without doing anything when crypto_info is already set. Silent failure is confusing for users. Fixes: 3c4d7559159b ("tls: kernel TLS support") Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/tls/tls_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c @@ -364,8 +364,10 @@ static int do_tls_setsockopt_tx(struct s crypto_info = &ctx->crypto_send; /* Currently we don't support set crypto info more than one time */ - if (TLS_CRYPTO_INFO_READY(crypto_info)) + if (TLS_CRYPTO_INFO_READY(crypto_info)) { + rc = -EBUSY; goto out; + } switch (tmp_crypto_info.cipher_type) { case TLS_CIPHER_AES_GCM_128: {