lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180425043543.GE2052@tuxbook-pro>
Date:   Tue, 24 Apr 2018 21:35:43 -0700
From:   Bjorn Andersson <bjorn.andersson@...aro.org>
To:     Alex Elder <elder@...aro.org>
Cc:     andy.gross@...aro.org, clew@...eaurora.org, aneela@...eaurora.org,
        david.brown@...aro.org, linux-arm-msm@...r.kernel.org,
        linux-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/6] soc: qcom: smem: fix first cache entry calculation

On Tue 10 Apr 15:25 PDT 2018, Alex Elder wrote:

> Cached items are found at the high end of an smem partition.  A
> cached item's shared memory precedes the private entry structure
> that describes it.
> 
> The address of the structure describing the first cached item should
> be returned by phdr_to_first_cached_entry().  However the function
> calculates the start address using the wrong structure size.
> 
> Fix this by computing the first item's entry structure address by
> subtracting the size of a private entry structure rather than a
> partition header structure.
> 
> Signed-off-by: Alex Elder <elder@...aro.org>

Sorry, I didn't spot these on the mailing list.

Reviewed-by: Bjorn Andersson <bjorn.andersson@...aro.org>

Regards,
Bjorn

> ---
>  drivers/soc/qcom/smem.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c
> index 0b94d62fad2b..7f38c5e11440 100644
> --- a/drivers/soc/qcom/smem.c
> +++ b/drivers/soc/qcom/smem.c
> @@ -292,8 +292,9 @@ static void *phdr_to_first_cached_entry(struct smem_partition_header *phdr,
>  					size_t cacheline)
>  {
>  	void *p = phdr;
> +	struct smem_private_entry *e;
>  
> -	return p + le32_to_cpu(phdr->size) - ALIGN(sizeof(*phdr), cacheline);
> +	return p + le32_to_cpu(phdr->size) - ALIGN(sizeof(*e), cacheline);
>  }
>  
>  static void *phdr_to_last_cached_entry(struct smem_partition_header *phdr)
> -- 
> 2.14.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ