Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp157648pxx; Wed, 28 Oct 2020 01:02:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwq6cChrslNU3dWseZxVGn1o0+DC5ceFcTsdaGNN73EmZUQs757vO3ZHvb1NEBC17Kxu8gk X-Received: by 2002:a50:d59c:: with SMTP id v28mr6193832edi.241.1603872154983; Wed, 28 Oct 2020 01:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603872154; cv=none; d=google.com; s=arc-20160816; b=wBOdKOL6+IRu5VVsuNXniaWObrl3e9Lnlacbin87RfZ8W1sz69w4DV6KOXPlwt0tv5 Nz2bFVirxdKpUO2uvq3VZSxXmqJeNRAtyzt0ZW2mMM71qhpKXaGHr72reBiSRL91mFZJ mz/K6WkKFynlqMFCkAkktCVecj9ZS7QUS7aS7FXkAKkRAxSQcJfRDXhNnyUmCTXUCtIK jWjqv6WFxALbnk5KUaD3nF4jENSYQXD6hnzwZXnhIzrAMT6KE9CmQdJzH21u/eHK6pDF 6JWX1iEvze+vCnxDFTQKfOBmyjqKrW56aPSvIwutFOBzjqLzIkshNN3mO2y6TSRsg3Bq qVRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IA0pweEZBW8c6FvevuPxpiBbvcjbznRrikgb26+nRvw=; b=IeuWJ2ZzJ5FIp3YIZGmX/hOA9uMWoN6mcmwSozrHyW636XUfYAvpYdO3aR3z0x6PME nfZBiGkFRX+u2cWCd6Cih/ItInxcBLqKzSyGdyldNF6ZLvueTPBlmU/rtzBl0iOnK8jj RuK2LN7OvWaIcYxGNIvOvEAokKMWmJncj0K38uEjmUX02evTcYIWrqz18x2BvZNQXBUN 7gkIYtK7RUzWN8V5PTxmbA7R/1YGH/+O19XtwtYqPkgm+ZSVncFf33iWByUV63zyKVdb KWMBRcFHeEfAE9BK9RUKyxc0UAg1MJGlHhhdZpelyH9Hfk157i1n78YeEJEZAjmrqabj fGxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wnhG7WPw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gf17si2900638ejb.226.2020.10.28.01.02.12; Wed, 28 Oct 2020 01:02:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wnhG7WPw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S368160AbgJ0N5N (ORCPT + 99 others); Tue, 27 Oct 2020 09:57:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:43680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S368149AbgJ0N5K (ORCPT ); Tue, 27 Oct 2020 09:57:10 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 2E270218AC; Tue, 27 Oct 2020 13:57:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807029; bh=/NlU0/3d84vVPG+nHAIZydHM6HSVzfZ3j8P+/gBXXl8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wnhG7WPwYO8DvWjTcM5ZOVVSRD47HfeWALeoDsieyeafb4aiXIcT2nw4KOIKrPYig eiBzt2H/3m8MdGM/CA4W5KLL5PuldpHzDzkI3PwJ/2maHFBqf7CXQzvGD54ZD/Gq7y hiZrcGrcE/qj6gCnJkrUj7eivozwymzKn4/4vtY4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dominik Maier , Dan Carpenter , Steve French Subject: [PATCH 4.4 017/112] cifs: remove bogus debug code Date: Tue, 27 Oct 2020 14:48:47 +0100 Message-Id: <20201027134901.383747842@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter commit d367cb960ce88914898cbfa43645c2e43ede9465 upstream. The "end" pointer is either NULL or it points to the next byte to parse. If there isn't a next byte then dereferencing "end" is an off-by-one out of bounds error. And, of course, if it's NULL that leads to an Oops. Printing "*end" doesn't seem very useful so let's delete this code. Also for the last debug statement, I noticed that it should be printing "sequence_end" instead of "end" so fix that as well. Reported-by: Dominik Maier Signed-off-by: Dan Carpenter Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/cifs/asn1.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) --- a/fs/cifs/asn1.c +++ b/fs/cifs/asn1.c @@ -541,8 +541,8 @@ decode_negTokenInit(unsigned char *secur return 0; } else if ((cls != ASN1_CTX) || (con != ASN1_CON) || (tag != ASN1_EOC)) { - cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 0\n", - cls, con, tag, end, *end); + cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p exit 0\n", + cls, con, tag, end); return 0; } @@ -552,8 +552,8 @@ decode_negTokenInit(unsigned char *secur return 0; } else if ((cls != ASN1_UNI) || (con != ASN1_CON) || (tag != ASN1_SEQ)) { - cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 1\n", - cls, con, tag, end, *end); + cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p exit 1\n", + cls, con, tag, end); return 0; } @@ -563,8 +563,8 @@ decode_negTokenInit(unsigned char *secur return 0; } else if ((cls != ASN1_CTX) || (con != ASN1_CON) || (tag != ASN1_EOC)) { - cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 0\n", - cls, con, tag, end, *end); + cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p exit 0\n", + cls, con, tag, end); return 0; } @@ -575,8 +575,8 @@ decode_negTokenInit(unsigned char *secur return 0; } else if ((cls != ASN1_UNI) || (con != ASN1_CON) || (tag != ASN1_SEQ)) { - cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 1\n", - cls, con, tag, end, *end); + cifs_dbg(FYI, "cls = %d con = %d tag = %d sequence_end = %p exit 1\n", + cls, con, tag, sequence_end); return 0; }