Received: by 10.192.165.148 with SMTP id m20csp251658imm; Tue, 24 Apr 2018 21:48:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/KGMNSFgwuz/i6Yqhb4ekIuN2xdcLIloI/UNoYAzoDkGAEYwVkxvwycxq4ZKPXqQFoJDye X-Received: by 10.98.236.220 with SMTP id e89mr26722103pfm.33.1524631721096; Tue, 24 Apr 2018 21:48:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524631721; cv=none; d=google.com; s=arc-20160816; b=hPBYj5zc66kMt3LJWUgAFeIizFKlwO3i0u41ibQqgXaN/CDyE8xFVXxi3yPvaD/Bjq JPggnMuiTDmwjpZb+sxbrJqQNHiqzulQoLtDdl+Hq8XpHSIF9/hgaBp4w2kuqsPSVenP HPsw9RwEtlJ/UVmiWF+9W0325Yh3z0AQ9IB6WpIfZjFRScEjg8Q1Ac3EuxdfF4Api+Xc dKXziqHAb9w447nnIc73mo7nIDkd8PYmJ64u1si88+pYQN3sIs4Gl5sbw4PWrPOJ1IS1 VnCiaZrHnY+PGV1w+tdyOklV8j9rj7GnZXJ9szz5JlaTcFXuOjl3TfjKKRUxCXO0Zh9q MNBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=M3wD+obo3+mFB5i9KbJksfCbzAldlvWfXGcdlN8ekgs=; b=rUpHGlYCQ0QVq5EZVdr1XMwobrXfKgJN/GlS9CfwqfD/V1YMub6EPMKo4K2/5Ku+TF 0C1DVWlhwfWuOYX5VK+uz0pm7VeCdkZWxlZ5kktueT4CaXWTbTjlGHKxjpiD3oYPZ2QU GlMWaEWx+MpZ7U0CweqpSDYJ1W5Us52HAG2aPScpcyr3B1FWxL6A4czl1ly2R0XF7WZI K+iZiJDvVOaehgma/PBco1b+uWQNlbQZo0bLtVWniTHbKwvQ6eXUKzOQEJb4fm5s7RcO DYUSX+WHZBJSVjAmb2gcYxEWf92fdI8xeoG5G4YQtYvNAd5iy+sLYVotL4kkObqst+u+ BgVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UcyG1JOP; 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 l15si10680360pgn.414.2018.04.24.21.48.26; Tue, 24 Apr 2018 21:48:41 -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=UcyG1JOP; 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 S1751255AbeDYErV (ORCPT + 99 others); Wed, 25 Apr 2018 00:47:21 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:43315 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750943AbeDYErS (ORCPT ); Wed, 25 Apr 2018 00:47:18 -0400 Received: by mail-pg0-f68.google.com with SMTP id f132so12442009pgc.10 for ; Tue, 24 Apr 2018 21:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=M3wD+obo3+mFB5i9KbJksfCbzAldlvWfXGcdlN8ekgs=; b=UcyG1JOPqgwdnIAyo3UtrYaZy9g5Syyz/XORpnSaEIG3sp36LRcJGdWdpaugcCEuvK zMVCGRjM+eeVdhNZ7U9Me23n0MJWVLRGy0fXUBAWpVUZaB9ewOxvOc7dPRmf4R7mgCEq an9SQZwLVx8ur5s0SVCuiItykhOD4mL0/7DrE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=M3wD+obo3+mFB5i9KbJksfCbzAldlvWfXGcdlN8ekgs=; b=XUsrYG19KU3FUrtJJqP6HCsTItRT+dv8Ozt8rMgXJx1CAm7cFnBuEuhlerNmUa3cjw YGvchS0WU+inaRVJk1JBMT5WsNirTTNagiMs45mJBRfI88OwqNS0xk4uCfA6253nC6bo q9pf6S74JoytNRwB5RIotu6vGly0auOzOJYby94jaZwNaC3qRSzGkErOeASMBaSHuMYa 603XPgdGI0teYtiruHozbG1kBwxLem0TNvJHDKk2YKbHU5kTGnITR4fIIaQc96P7GiZN QpJlipVUi0y/RJwBa96Fb9/qQBEL1Qs7KojiBFnw1qXwfyxSkDOMwPkGsU96IlhLbdJd t3IQ== X-Gm-Message-State: ALQs6tBzvuV5Cv/h5H5DhRy+htaAOQEf0CKv1rn0KW9c0WuTiD6OXE5M nqRAWNzAEnSPN8qya8EaFZUkHg== X-Received: by 10.99.113.80 with SMTP id b16mr22505236pgn.326.1524631637756; Tue, 24 Apr 2018 21:47:17 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id j74sm5851732pfk.25.2018.04.24.21.47.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Apr 2018 21:47:17 -0700 (PDT) Date: Tue, 24 Apr 2018 21:48:26 -0700 From: Bjorn Andersson To: Alex Elder Cc: andy.gross@linaro.org, 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: Re: [PATCH 4/6] soc: qcom: smem: fix off-by-one error in qcom_smem_alloc_private() Message-ID: <20180425044826.GH2052@tuxbook-pro> References: <20180410222542.29474-1-elder@linaro.org> <20180410222542.29474-5-elder@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180410222542.29474-5-elder@linaro.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 10 Apr 15:25 PDT 2018, Alex Elder wrote: > It's OK if the space for a newly-allocated uncached entry actually > touches the free cached space boundary. It's only a problem if it > would cross it. > > Signed-off-by: Alex Elder Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > drivers/soc/qcom/smem.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c > index 82f0908b90e1..0ed263055988 100644 > --- a/drivers/soc/qcom/smem.c > +++ b/drivers/soc/qcom/smem.c > @@ -375,7 +375,7 @@ static int qcom_smem_alloc_private(struct qcom_smem *smem, > > /* Check that we don't grow into the cached region */ > alloc_size = sizeof(*hdr) + ALIGN(size, 8); > - if ((void *)hdr + alloc_size >= cached) { > + if ((void *)hdr + alloc_size > cached) { > dev_err(smem->dev, "Out of memory\n"); > return -ENOSPC; > } > -- > 2.14.1 >