Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp455445yba; Wed, 15 May 2019 04:24:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyAkQM8AtgOjbA1ExEV6OXve9wYqHJJEBiLew37bdg6/CtCCRvgPIJZPXxmjJajmqNXZ1VU X-Received: by 2002:aa7:8243:: with SMTP id e3mr46506274pfn.213.1557919487208; Wed, 15 May 2019 04:24:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557919487; cv=none; d=google.com; s=arc-20160816; b=ZwUFRX4WN7tkiqB6ttjIpE/pKMxNNPMIyXeqCd6Z9xY7BfwS6VeoPnWA2SBtwUhWn6 CHQRTR/FuUzUKT0KwC5gdv1/jeryEas2ublrnBS3zx342qlnk3g978cAw5ixEPejsafM wv/aUZMvGwf9AUcp54SVv8Ys4wOlkT26u6uX5k75HP+TRXLkRNkIHAC65eZnfWvT/10e sURHG9lHSYUaefiCAQGMZkbVDQlUO7BfB/dt3lhNboATHzEBY6uWJsPajQRofm14h3qF dooN7oLkfJ5b9ppFldYwfQIYn9Yzb1Og3OVQyrM/zGxAm6qjiASKKFNghLw9T5Ob0pLr WhMg== 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=6Qk3VPCwvDMbBn4vbIVd2xgFEY1a1Nx8neUebTMtOhE=; b=oD7Eswl+E+ZHVsYQLLCk04D5HbNwGMTTV5CTgR8zSq5hKp0wplm3cO8M+boPx2QaMm N5yw+k7nrUmHHqb2BU/kSE8fLtm2eXjaQS0Ql576eBb3q4ilbapKeUVz7rsyIU0oXRyy uRj+9EeLTLYkSu4NdaygvtAd3HznoKiNTa4p954zme0f3EFgzT1KHjMNCm3Yh8Kjx0F7 +J3aRMWBToflANpKR7FRo94DBFywmHiG/yWYrmS5TGSfjUOS55rwD0UM1o/z9pSyMmzP T+xq0PST1Yh+l1xc2KfbFzYE/zM53S+yiU/80zWcQBikbeaw+5fMmgAZP/LTW+lU75In OLMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="R/AmU3Uu"; 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 b1si1515489plz.57.2019.05.15.04.24.32; Wed, 15 May 2019 04:24:47 -0700 (PDT) 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="R/AmU3Uu"; 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 S1731605AbfEOLXQ (ORCPT + 99 others); Wed, 15 May 2019 07:23:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:33562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731600AbfEOLXO (ORCPT ); Wed, 15 May 2019 07:23:14 -0400 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 0E9D22173C; Wed, 15 May 2019 11:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919393; bh=K2IkrEi/tD2IaYZmqAfSJbHk+BOVouzFnQkxLuBR1/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R/AmU3Uuxzh0loV85j20P4HVXXHNddoLr/zBG1vPR06iv+4zsqGH9s3+p/5EbjZpH iY4tIA5VVJL5Qh1n5ptddY6lb2RndwCdtV8u95+XWrtsnUhkQZyzEXyhJ4REH/5MCt +Ypk9ZqJeJU4beZ9OUBTV6KCp4VD/XVLlsNQpLnA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tony Camuso , Corey Minyard , Sasha Levin Subject: [PATCH 4.19 041/113] ipmi: ipmi_si_hardcode.c: init si_type array to fix a crash Date: Wed, 15 May 2019 12:55:32 +0200 Message-Id: <20190515090656.736553667@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090652.640988966@linuxfoundation.org> References: <20190515090652.640988966@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 [ Upstream commit a885bcfd152f97b25005298ab2d6b741aed9b49c ] The intended behavior of function ipmi_hardcode_init_one() is to default to kcs interface when no type argument is presented when initializing ipmi with hard coded addresses. However, the array of char pointers allocated on the stack by function ipmi_hardcode_init() was not inited to zeroes, so it contained stack debris. Consequently, passing the cruft stored in this array to function ipmi_hardcode_init_one() caused a crash when it was unable to detect that the char * being passed was nonsense and tried to access the address specified by the bogus pointer. The fix is simply to initialize the si_type array to zeroes, so if there were no type argument given to at the command line, function ipmi_hardcode_init_one() could properly default to the kcs interface. Signed-off-by: Tony Camuso Message-Id: <1554837603-40299-1-git-send-email-tcamuso@redhat.com> Signed-off-by: Corey Minyard Signed-off-by: Sasha Levin --- drivers/char/ipmi/ipmi_si_hardcode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/char/ipmi/ipmi_si_hardcode.c b/drivers/char/ipmi/ipmi_si_hardcode.c index 9ae2405c28bbd..0c28e872ad3ae 100644 --- a/drivers/char/ipmi/ipmi_si_hardcode.c +++ b/drivers/char/ipmi/ipmi_si_hardcode.c @@ -200,6 +200,8 @@ void __init ipmi_hardcode_init(void) char *str; char *si_type[SI_MAX_PARMS]; + memset(si_type, 0, sizeof(si_type)); + /* Parse out the si_type string into its components. */ str = si_type_str; if (*str != '\0') { -- 2.20.1