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] [day] [month] [year] [list]
Message-ID: <CAA8EJppTfafU_RMjG2V9FbrpAviTcGhDZ9F2ZJJtNR08Ap5h7Q@mail.gmail.com>
Date: Sat, 8 Mar 2025 00:38:21 +0100
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: srinivas.kandagatla@...aro.org
Cc: gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org, 
	Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH 12/14] nvmem: make the misaligned raw_len non-fatal

On Fri, 7 Mar 2025 at 18:58, <srinivas.kandagatla@...aro.org> wrote:
>
> From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
>
> The commit 11ccaa312111 ("nvmem: core: verify cell's raw_len") enforced
> the raw read len being aligned to the NVMEM's word_size. However this
> change broke some of the platforms, because those used misaligned
> reads. Make this error non-fatal for the drivers that didn't specify
> raw_len directly and just increase the raw_len making it aligned.
>
> Fixes: 11ccaa312111 ("nvmem: core: verify cell's raw_len")

This patch does only make sense together with your tree, because it
references a commit from that tree.
As you are reposting them for Greg, commit IDs will change. It might
be easier to fold this patch into the offending commit.

> Reported-by: Mark Brown <broonie@...nel.org>
> Closes: https://lore.kernel.org/linux-arm-msm/Z7Xv9lNc6ckJVtKc@finisterre.sirena.org.uk/
> Tested-by: Mark Brown <broonie@...nel.org>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
> ---
>  drivers/nvmem/core.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> index b6f8544fd966..e206efc29a00 100644
> --- a/drivers/nvmem/core.c
> +++ b/drivers/nvmem/core.c
> @@ -612,7 +612,11 @@ static int nvmem_cell_info_to_nvmem_cell_entry_nodup(struct nvmem_device *nvmem,
>                         "cell %s raw len %zd unaligned to nvmem word size %d\n",
>                         cell->name ?: "<unknown>", cell->raw_len,
>                         nvmem->word_size);
> -               return -EINVAL;
> +
> +               if (info->raw_len)
> +                       return -EINVAL;
> +
> +               cell->raw_len = ALIGN(cell->raw_len, nvmem->word_size);
>         }
>
>         return 0;
> --
> 2.25.1
>


-- 
With best wishes
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ