From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:60257 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1945914AbcHRK6W (ORCPT ); Thu, 18 Aug 2016 06:58:22 -0400 Subject: Patch "soc: qcom: smp2p: Correct addressing of outgoing value" has been added to the 4.7-stable tree To: bjorn.andersson@linaro.org, andy.gross@linaro.org, gregkh@linuxfoundation.org Cc: , From: Date: Thu, 18 Aug 2016 12:57:39 +0200 Message-ID: <1471517859245251@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled soc: qcom: smp2p: Correct addressing of outgoing value to the 4.7-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: soc-qcom-smp2p-correct-addressing-of-outgoing-value.patch and it can be found in the queue-4.7 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 63af8e44eaa56ffe613628742a2642c4c2f1a029 Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Thu, 9 Jun 2016 17:22:56 -0700 Subject: soc: qcom: smp2p: Correct addressing of outgoing value From: Bjorn Andersson commit 63af8e44eaa56ffe613628742a2642c4c2f1a029 upstream. The valid_entries index should not be incremented until after we have acquired the pointer to the value, or we will read and write data one item off. Fixes: 50e99641413e ("soc: qcom: smp2p: Qualcomm Shared Memory Point to Point") Signed-off-by: Bjorn Andersson Signed-off-by: Andy Gross Signed-off-by: Greg Kroah-Hartman --- drivers/soc/qcom/smp2p.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/soc/qcom/smp2p.c +++ b/drivers/soc/qcom/smp2p.c @@ -344,11 +344,12 @@ static int qcom_smp2p_outbound_entry(str /* Allocate an entry from the smem item */ strlcpy(buf, entry->name, SMP2P_MAX_ENTRY_NAME); memcpy_toio(out->entries[out->valid_entries].name, buf, SMP2P_MAX_ENTRY_NAME); - out->valid_entries++; /* Make the logical entry reference the physical value */ entry->value = &out->entries[out->valid_entries].value; + out->valid_entries++; + entry->state = qcom_smem_state_register(node, &smp2p_state_ops, entry); if (IS_ERR(entry->state)) { dev_err(smp2p->dev, "failed to register qcom_smem_state\n"); Patches currently in stable-queue which might be from bjorn.andersson@linaro.org are queue-4.7/mfd-qcom_rpm-parametrize-also-ack-selector-size.patch queue-4.7/remoteproc-fix-potential-race-condition-in-rproc_add.patch queue-4.7/tty-serial-msm-don-t-read-off-end-of-tx-fifo.patch queue-4.7/mfd-qcom_rpm-fix-offset-error-for-msm8660.patch queue-4.7/soc-qcom-smp2p-correct-addressing-of-outgoing-value.patch