From patchwork Tue Jun 26 00:58:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 139896 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4615788lji; Mon, 25 Jun 2018 17:59:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL08aSPVHn+tjrC/U6XET4uo+9vIc1bMCyWUSzb+1TIw+qeod8Eo+wMaqFToDtTbPhSOJqC X-Received: by 2002:a62:444c:: with SMTP id r73-v6mr15125166pfa.255.1529974752395; Mon, 25 Jun 2018 17:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529974752; cv=none; d=google.com; s=arc-20160816; b=P3BW0M7SMKm7u08GVbvMbx1yLSsu+VXdLjWrrqJ9wYm0gOSTgs9oSykS7VasAC+cOD 9FFLNI1srkeqU7j2+s34fOu8yLj2d2h4ebumCP0I69I6utxaZ7cvrnrn8sY77GJyI+fS 1++xgihARtTX3qUynFNRTYkH7vumQAr6xvZgcZlnVIA0q5QVuRhIn8O7OXnOEeDVcZs1 GE1gje5Kq/x/x7i452G45nl2Jh0dbDLfs5Yp6lbJyx14A8Qqn6q9G12j1P7xqv95KUid W5J99sHscXuKewj38zoary7Ik1EQwUPqXwFPpDZJpz6V/ZRW/JHldVOnOv8H9eTwJTHX duRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=kqgmo0i4y6iTyIYd+DAmlJreZeAqlQhGPtH0NQFjIq0=; b=dqq+NFzMliEzd5GCupo/HDgIc6+82n4/5oFpF+MxqjpiUiPpg4wBn/7V0NiUIAXQ4C Qh0NDfX3UMcBP8bndP4sg7e6DUa/DWn/M3irpswuOIpHQn4b+cObf/Vtg3qUBaORm9zB i/elaENnoxZ9spCpKQYMqOprE73w1hMRlrrxxuxncM1AkDxTQh9vMETNZ4FzH2zG8+PX sbeHHcHiBu21qTzLl4IMNlKlBmKfzwuepnBOFj6dEQZvRh7sByh3w+r1/DkBpdBPNkPK emJdfgKrXXqhjOW1XNAoGn8dJOPFUz2jjRkaytYeGG0ZZ2qnzPC6M64XIzGopNuWUMdt qSOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SRnGHuqG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n10-v6si288453pgs.485.2018.06.25.17.59.12; Mon, 25 Jun 2018 17:59:12 -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=@linaro.org header.s=google header.b=SRnGHuqG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934945AbeFZA7K (ORCPT + 31 others); Mon, 25 Jun 2018 20:59:10 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:55887 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934743AbeFZA7H (ORCPT ); Mon, 25 Jun 2018 20:59:07 -0400 Received: by mail-it0-f66.google.com with SMTP id 16-v6so15191013itl.5 for ; Mon, 25 Jun 2018 17:59:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kqgmo0i4y6iTyIYd+DAmlJreZeAqlQhGPtH0NQFjIq0=; b=SRnGHuqGRWAP9bcYjbBbeEsbcOvOZkdcGCB1Iq9kv18JrY9oKTjqquT1IIQXlbi575 23ez0uSDFaXLHQqbyoYYmatCE/Y7i/+oHQ3gCJ5c2z4StuosYA7hpb8bXdnr3gNGxps0 c/3SaytnfzVdbNLHcKl/60qDy3ATWQevcA6hQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kqgmo0i4y6iTyIYd+DAmlJreZeAqlQhGPtH0NQFjIq0=; b=ZiuEfDlA5+fBi1wCnMwIPWRe4BjU6UgE6Sv6dcceDL7eXuTzE30zumkH5iWsGnUOBx IOnCpHWKrDZgD9JP79XLXz4t1FR7H5ccs11+P1mq/Eat5dEgiTcSrtd880T9iBy4qGp4 ajrUTeu/Tp+2BjIBDqsdCKPkDQOeL9ZFn/NQMcxYE8r0uQ7Bx4XDWD5vR5i2CY3JUfXq QJ6U0oxSRp2aS6dFBsVaeu88mYULsL2BvOdS/jAKKL5hkx+IzP8m20Vfd7xhlzFvtiaT NMoIA1rVcVv/t9fXOnR9LuKzzH+OuQdPcePqLYAfsdGNl9qqEvP2A5JSzNGBGKQSCfdy 0nYw== X-Gm-Message-State: APt69E2CWErLhnTw+jOS/+n3awYAA/E1Ps+c4AkxBKhC7xvnZbkK5gQY M2X+rOf06EmOSxbwhgx+HVvcWg== X-Received: by 2002:a24:f549:: with SMTP id k70-v6mr883648ith.123.1529974747021; Mon, 25 Jun 2018 17:59:07 -0700 (PDT) Received: from localhost.localdomain (c-71-195-29-92.hsd1.mn.comcast.net. [71.195.29.92]) by smtp.gmail.com with ESMTPSA id f193-v6sm372556itf.9.2018.06.25.17.59.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 17:59:06 -0700 (PDT) From: Alex Elder To: andy.gross@linaro.org Cc: clew@codeaurora.org, aneela@codeaurora.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH resend 06/12] soc: qcom: smem: require order of host ids to match Date: Mon, 25 Jun 2018 19:58:50 -0500 Message-Id: <20180626005856.14174-7-elder@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180626005856.14174-1-elder@linaro.org> References: <20180626005856.14174-1-elder@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In qcom_smem_enumerate_partitions(), we find all partitions that have a given local host id in either its host0 or its host1 field in the partition table entry. We then verify that the header structure at the start of each partition also contains the same two host ids as is found in the table of contents. There is no requirement that the order of the two host ids be the same in the table of contents and in the partition header. This patch changes that, requiring host0 to in the partition table entry to equal host0 in the partition header structure (and similar for the host1 values). Signed-off-by: Alex Elder --- drivers/soc/qcom/smem.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c index 6931602d9a9e..49f228e9d2d3 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -847,15 +847,9 @@ static int qcom_smem_enumerate_partitions(struct qcom_smem *smem, return -EINVAL; } - if (host0 != local_host && host1 != local_host) { + if (host0 != host0 || host1 != host1) { dev_err(smem->dev, - "Partition %d hosts are invalid\n", i); - return -EINVAL; - } - - if (host0 != remote_host && host1 != remote_host) { - dev_err(smem->dev, - "Partition %d hosts are invalid\n", i); + "Partition %d hosts don't match\n", i); return -EINVAL; }