Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17925952ybl; Thu, 2 Jan 2020 14:57:41 -0800 (PST) X-Google-Smtp-Source: APXvYqy5ejWKwKu70dFwF4y7mP3wnzU9MIO3lzEW7/08g7N4xdzbJmAoKR1GwHPAcD1zxefPh9wz X-Received: by 2002:a05:6830:11d2:: with SMTP id v18mr82538830otq.151.1578005861317; Thu, 02 Jan 2020 14:57:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005861; cv=none; d=google.com; s=arc-20160816; b=Op+gpUViOhdmGpg8P7CHKKT1WQ9hfQPvpa7rZ4Y3UHuzGLnNr7q+xbWw0pt1ragqnR MvBLsubNatRk5JfqplDmvI3902tI29e39Vk/kI9+55wslomnDDldJI7prEv4ogPJe12D winyhbUQI5B5/Z+IBBeMO/ABB3TH4ZNBImnPG0R64OYI8zqhdLvY9rj3taGGf0+4eYyV O5Rbad2BYl128997V1cBMWhfx52In9iWJuxIZYNt6vb/Nt2PIjmCbXDc/QHKZ+7nSnfH R8ot1t4vOD/uXgLGhyAfhsfMY5960Y6VcgfWrH4dUiGRzruJDPaFiCVOBEjkKGuXyt41 wBgA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wDiuHh1FpJKY8xJ0UE3mAB8afLzbUOxZ0eFkFEaAQFU=; b=ShwplBDuR8i6d/2Q1Ls1KcN1ZlyMdeJODLDC4PnmyJe6y7ShYNr8txwWIyS0JIx3US hCqU1SzqpY/6mVQdqE6znBxvWfdnWKiqPu7qYSHf+FCADj4u8bM+HcyoTRycEguEkdri CJcAVDLg+W9M2I2soofRykLHA37aQqa/tJs02R8gdZesOAWbaLWjaHUVzZ7aoYQY8wqL XzexJxhzga73/ylL4HDedYFx2KxHrcc5Jx7ERfFPSOF4wHrsBmMqd3nJsl9RouXlZCGm J6wq+huUA+Sdxz/FXs5GbAk+qyPROu0VayesYzs+QB4JgbZ0va3hfK3QQsslr2xTbj3Q JVWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="o/ft4bX7"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l21si31945709otk.142.2020.01.02.14.57.29; Thu, 02 Jan 2020 14:57:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="o/ft4bX7"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728481AbgABWzU (ORCPT + 99 others); Thu, 2 Jan 2020 17:55:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:35750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728605AbgABWTa (ORCPT ); Thu, 2 Jan 2020 17:19:30 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6304421582; Thu, 2 Jan 2020 22:19:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003569; bh=L+Pr4KaWWePHS/ARhpT5PkchyA1n1K5Ej5ew12Jliww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o/ft4bX7L7RVi4y7wd05LR96gXl4p02jChd8DWZnDUShhSfgcwp6YHzQ60z9xg7Qz AlqGw1B7VCES7rZYJdrRt6yPKKpXiBSs6VM0ahlsV6DaMuHVzta527PKDO2t5ZjcKh uZ+B4dLMTNZ6YdheR6g3WtwW0Cs/r9df3ReRVaY0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lee Duncan , Mike Christie , David Disseldorp , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.19 009/114] scsi: target: compare full CHAP_A Algorithm strings Date: Thu, 2 Jan 2020 23:06:21 +0100 Message-Id: <20200102220030.096331221@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220029.183913184@linuxfoundation.org> References: <20200102220029.183913184@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Disseldorp [ Upstream commit 9cef2a7955f2754257a7cddedec16edae7b587d0 ] RFC 2307 states: For CHAP [RFC1994], in the first step, the initiator MUST send: CHAP_A= Where A1,A2... are proposed algorithms, in order of preference. ... For the Algorithm, as stated in [RFC1994], one value is required to be implemented: 5 (CHAP with MD5) LIO currently checks for this value by only comparing a single byte in the tokenized Algorithm string, which means that any value starting with a '5' (e.g. "55") is interpreted as "CHAP with MD5". Fix this by comparing the entire tokenized string. Reviewed-by: Lee Duncan Reviewed-by: Mike Christie Signed-off-by: David Disseldorp Link: https://lore.kernel.org/r/20190912095547.22427-2-ddiss@suse.de Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/target/iscsi/iscsi_target_auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/iscsi/iscsi_target_auth.c b/drivers/target/iscsi/iscsi_target_auth.c index e2fa3a3bc81d..b6bf605fa5c1 100644 --- a/drivers/target/iscsi/iscsi_target_auth.c +++ b/drivers/target/iscsi/iscsi_target_auth.c @@ -78,7 +78,7 @@ static int chap_check_algorithm(const char *a_str) if (!token) goto out; - if (!strncmp(token, "5", 1)) { + if (!strcmp(token, "5")) { pr_debug("Selected MD5 Algorithm\n"); kfree(orig); return CHAP_DIGEST_MD5; -- 2.20.1