Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp613013pxx; Wed, 28 Oct 2020 12:24:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6ydZ6oAKVKvcDys7lN82OhcucH8Du3N9NJy/gA0iqxcR8dLnQsxq4k6rmXNUusDDHixb4 X-Received: by 2002:a17:906:a149:: with SMTP id bu9mr594244ejb.115.1603913062926; Wed, 28 Oct 2020 12:24:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603913062; cv=none; d=google.com; s=arc-20160816; b=ZxYXfEFQvZUWvp2+KbVl3mOO0OIWhWh+YWnEC71Md2vdTKwBGXMtsCjgwzHm/SwHYd QdBtboybYD27wMPuHOnLqvDYSIwUpbCcT/dxWxZ/5lPOZe1lRhUHBvVPoslwYiXGG50K MX/A6e9fJkV1frzotf7ppKm+EuWMnqTLr5kE4R/3q277FUthgTR5UkI6JZBaiw+xmitw Xs/pnJf6pzw0qLYgecF17mBiSPfwEDyO7ITzBa/UTcULqZYUAruEUdGDgeyiV6sbEk4G lx70PwNJqnsHjFxqkIlfQb8X1Qr9IIV/uH6ym1Bme+ydUcxQDZKOBbJddQ17repW1wzl cRrA== 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=tNXkP05cI1hIJWugHGwkT8tyOvncDxDJ+2QPcX4q4B+HqHKtd952a8tKh0a+1XFWgG eXjErqeYTKOtyW5DwBGysFKBV6fTN6dSdFWwrbS2tX18e8mdeQCEj70pCohVns08mSFv v3MHGDH6bmKwegzCpl2hFfBYwugDJo4wqpObIJ4G39HdwVg8FRH3MyVjkMadnlRFciFS GVXI84cd4ygxFT+T9Hzhp26gQ6yavE8roR7Vzo7JydbtnVBLmkP/5wVWr1YIrKSXfim1 PRwfU26xaFnptwLkneeOLpX2uuBBLiAy6F946p1BxhEjDyRgy7pkO6hNY+XmaBMnYSlm pR8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GvQVH32T; 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 x19si30189edq.122.2020.10.28.12.24.00; Wed, 28 Oct 2020 12:24:22 -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=GvQVH32T; 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 S1827329AbgJ0SXF (ORCPT + 99 others); Tue, 27 Oct 2020 14:23:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:49896 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753763AbgJ0OCC (ORCPT ); Tue, 27 Oct 2020 10:02:02 -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 613632225C; Tue, 27 Oct 2020 14:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807321; bh=/NlU0/3d84vVPG+nHAIZydHM6HSVzfZ3j8P+/gBXXl8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GvQVH32T8rWF7sn4IEsNGHFc913/SZvxUoUq3f6Z3ARFUfTN359sijJ9Dq5/XPzUC ijvs1JhIMjt67DgbgeECx5kFEAYpkBtvo5iE098c22YvJCpFNahxvLTAdeeBoxc4DU W4bktSIC/GVCihFbGjR75Yp1E7MNpI1ivGlKt2PM= 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.9 011/139] cifs: remove bogus debug code Date: Tue, 27 Oct 2020 14:48:25 +0100 Message-Id: <20201027134902.677707100@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134902.130312227@linuxfoundation.org> References: <20201027134902.130312227@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; }