From patchwork Mon Mar 29 07:57:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 410817 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3433557jai; Mon, 29 Mar 2021 01:36:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgQPcMru2ri64ZDQNz42SkYNmiZ4nVi8SHYcpav4gAxikg/okCXrGvhPQ2WhgKfvFYt1kI X-Received: by 2002:aa7:dc56:: with SMTP id g22mr27644569edu.219.1617007014413; Mon, 29 Mar 2021 01:36:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617007014; cv=none; d=google.com; s=arc-20160816; b=yx1toVN2xG10tuOVOtiuXJKGxjog/Ktx4z3QZBD2tRBmhI8uIcqXKUYOC301MAmHkf +sc4jNFxjRuRrbTQpmNul/P4a5GSUzAagjb5tz1jWQ5pzmRxIvoZizDf/vdaOJq6BJXu ThGzRXBJ+bN/SyWdnDzToiZyVeNg1htltMSXNWaoOcySngciotYLcK5OkqCKrDTamYLk IXzzHB+y9elXpQh6OvzybPHu+BYdKD+CBQop4RQJxaz3nwfxbx/QC2TM0NSAivBtzagH w3EnB8Z49OdeBDgJy4Ua792X23b6ePXKHBeCSz+gaGu+v1BkNZi4Wkveh4UyrB2zd3Ic mAdQ== 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=0K7Y0aX70Yb4AqB9KyRY7nAOcJS6V4wCf7uutU8I/pA=; b=cDUVeWVC+FpJXSXyq9r26SO9jLuBwLNbBw5rwuV2042onlEy5vZ0qecFF9QvkHJyTu 4oXIC6VAErtews9H1t3NmxKfCcj9TzYo7eZPmsdEiWxguFdt8z6Cd2JAfGI1QB+EZmw/ gqDcqKP+8Mnpne2LOd8wCFpLjRNCg2BGPWp1E8ZTecOOitSLvRHl4p12aQnkomvEOQ17 vXGNRpgzZ9uJ7AhjrRWJySFesLjvdhkTp2cL7IR4aAEFFR1Ys/qWl1urDbgiTxjIcVct ztn90REKZeuyTJdQ/zv6FYMR6q7uACUmMDCxCZPsIDX7GZmCvqCQzuQOw4wdNYXNcNEB tE4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hUsvNtkO; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (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 t22si11690307ejj.746.2021.03.29.01.36.54; Mon, 29 Mar 2021 01:36:54 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=@linuxfoundation.org header.s=korg header.b=hUsvNtkO; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231941AbhC2IgX (ORCPT + 12 others); Mon, 29 Mar 2021 04:36:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:55736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233270AbhC2Iel (ORCPT ); Mon, 29 Mar 2021 04:34:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C7EFA619AB; Mon, 29 Mar 2021 08:34:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006881; bh=WTJcMEegiKcxEk43R4BYWCA/O9UUUJxOtBYag4De+vc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hUsvNtkONWX5jAI5ggUkN2r07vSzRVwPxinrpEHM4ZHpsW+qLBEMb0/KsBl/ZTn/b AEWrcnhbw5c8wpK2jiRogpMYdQRZsO2QimZ8KTyhZddyOs5lQuM3dDRniX+URIwXbt nUjVEizhhOQpT0huWKhWzqUZD+lgrGnLhpkUelI0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sujit Kautkar , Alex Elder , Bjorn Andersson , "David S. Miller" , Sasha Levin Subject: [PATCH 5.11 137/254] net: ipa: terminate message handler arrays Date: Mon, 29 Mar 2021 09:57:33 +0200 Message-Id: <20210329075637.725042865@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075633.135869143@linuxfoundation.org> References: <20210329075633.135869143@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Alex Elder [ Upstream commit 3a9ef3e11c5d33e5cb355b4aad1a4caad2407541 ] When a QMI handle is initialized, an array of message handler structures is provided, defining how any received message should be handled based on its type and message ID. The QMI core code traverses this array when a message arrives and calls the function associated with the (type, msg_id) found in the array. The array is supposed to be terminated with an empty (all zero) entry though. Without it, an unsupported message will cause the QMI core code to go past the end of the array. Fix this bug, by properly terminating the message handler arrays provided when QMI handles are set up by the IPA driver. Fixes: 530f9216a9537 ("soc: qcom: ipa: AP/modem communications") Reported-by: Sujit Kautkar Signed-off-by: Alex Elder Reviewed-by: Bjorn Andersson Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ipa/ipa_qmi.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.30.1 diff --git a/drivers/net/ipa/ipa_qmi.c b/drivers/net/ipa/ipa_qmi.c index 2fc64483f275..e594bf3b600f 100644 --- a/drivers/net/ipa/ipa_qmi.c +++ b/drivers/net/ipa/ipa_qmi.c @@ -249,6 +249,7 @@ static const struct qmi_msg_handler ipa_server_msg_handlers[] = { .decoded_size = IPA_QMI_DRIVER_INIT_COMPLETE_REQ_SZ, .fn = ipa_server_driver_init_complete, }, + { }, }; /* Handle an INIT_DRIVER response message from the modem. */ @@ -269,6 +270,7 @@ static const struct qmi_msg_handler ipa_client_msg_handlers[] = { .decoded_size = IPA_QMI_INIT_DRIVER_RSP_SZ, .fn = ipa_client_init_driver, }, + { }, }; /* Return a pointer to an init modem driver request structure, which contains