Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6206792ybv; Tue, 18 Feb 2020 12:02:22 -0800 (PST) X-Google-Smtp-Source: APXvYqy2K3wQ1qs7+Y9sJniJX0AsEPCSegqP5YzRZapc6/hw+L2aMv5BNZWBsmS6g/GMWB1e+6Hi X-Received: by 2002:a05:6830:140b:: with SMTP id v11mr17023144otp.340.1582056142482; Tue, 18 Feb 2020 12:02:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582056142; cv=none; d=google.com; s=arc-20160816; b=sN4I5i1//T+KXQYY3uArOxBArP0Z06isR/CM+zfvkforVCB0qLaSILpPflsQNZC0cN fB3woSPiqTxCAWj/xR99EKub0ibY3YLe90pzn42SswDE7juMKGAe8ckMHc8PzvId40Tr eORUon+CcebVr0toZyrphrguxJdVug6tyLG8zDTWsIjo9Y+YmVQgiBJqH26G5mSVv+xT zYAG81091hOW4OTFqhXBYqhw3xplA0OdL6LU3w45IAk9n2FdewkSJkyB2a5C6silq2hJ MaJO8g06a6add3bM5qN7BaalVUs7OA3qwhDzxuKFcN/VKGsv4vi0HoCSHEss2MYTwLHy PoCg== 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=hYvDDPEHZNE1pYmIQJ1n9kB68cKExdU7F/uH/6ZSrpg=; b=A+0u6Z3TpHCw9y6N0TeLQbXkHcKlcWGNmeBgyGli+54e7p00lPo7JFZX7LNYjcsD7+ 9zvRSXt84m7ni3hatktU7eZTgsNyGSJbndbre4xA1TCEWXZldAE1sXPUERmr7LFKsGb6 umiDFVK/ll6lH+B1LM1xY84cUs134t5BSEBmCo0DcwMkPmDmB49qrl3KpcehxADJp1wC 3P3esOGgufS9S52ZxdvvMqmp7ecVZatl2EnlB1IVWCL3CFpEUyEiXxPYO/KBOhfLfwkg ll19ewHmBd/VRAqc0gQo1qCy9A7/r5+gafLlkogHa/SKUvj6Mc2gpMceMF8cpK1dd1J2 NSBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i9TPnexn; 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 i2si2145514otc.130.2020.02.18.12.02.10; Tue, 18 Feb 2020 12:02:22 -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=i9TPnexn; 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 S1728582AbgBRUCI (ORCPT + 99 others); Tue, 18 Feb 2020 15:02:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:42152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727785AbgBRUCG (ORCPT ); Tue, 18 Feb 2020 15:02:06 -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 92A4A2465D; Tue, 18 Feb 2020 20:02:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582056126; bh=ThgjNCU+8MS+eBKTclwmfynFRyuPnapydKLL6JZ7fXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i9TPnexnLOjecV3Ene+xaO3XC0HCYzuKSDMt7bkwwnVy5HbDptpalW2U2/7kDMhBG TQY3TpsD8oeoQ29v8dEL908KqRz/teOVgGbbiP9jo+myLeBbqKqULD1Eo0s+kfMd38 6YsD0xemDiznn0vQfy0maxVSaRX6Fc0w4q1nesZY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Marek=20Beh=C3=BAn?= , sohu0106 , Olof Johansson Subject: [PATCH 5.5 45/80] bus: moxtet: fix potential stack buffer overflow Date: Tue, 18 Feb 2020 20:55:06 +0100 Message-Id: <20200218190436.649116364@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200218190432.043414522@linuxfoundation.org> References: <20200218190432.043414522@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: Marek BehĂșn commit 3bf3c9744694803bd2d6f0ee70a6369b980530fd upstream. The input_read function declares the size of the hex array relative to sizeof(buf), but buf is a pointer argument of the function. The hex array is meant to contain hexadecimal representation of the bin array. Link: https://lore.kernel.org/r/20200215142130.22743-1-marek.behun@nic.cz Fixes: 5bc7f990cd98 ("bus: Add support for Moxtet bus") Signed-off-by: Marek BehĂșn Reported-by: sohu0106 Signed-off-by: Olof Johansson Signed-off-by: Greg Kroah-Hartman --- drivers/bus/moxtet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/bus/moxtet.c +++ b/drivers/bus/moxtet.c @@ -466,7 +466,7 @@ static ssize_t input_read(struct file *f { struct moxtet *moxtet = file->private_data; u8 bin[TURRIS_MOX_MAX_MODULES]; - u8 hex[sizeof(buf) * 2 + 1]; + u8 hex[sizeof(bin) * 2 + 1]; int ret, n; ret = moxtet_spi_read(moxtet, bin);