From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: u-boot@lists.denx.de
Subject: [PATCH] for [BUG] rsa: crash in br_i32_decode() called from rsa_gen_key_prop() (Heinrich Schuchardt)
Date: Mon, 14 Sep 2020 13:05:38 +0200 [thread overview]
Message-ID: <fda2944b-602c-ee13-3b76-942e8949b80d@gmx.de> (raw)
In-Reply-To: <dda03210b10945039341dd1bde1cec92@external.thalesgroup.com>
On 9/9/20 9:35 AM, REITHER Robert - Contractor wrote:
> Fixes problem for unaligned 32bit big-endian access in lib/rsa/rsa-keyprop.c
>
> Exchanges br_i32_decode() with get_unaligned_be32().
> This will keep the unaligned access for architectures capable and will do some byte-shift magic for the not so capable ones...
>
> robert.reither at external.thalesgroup.com
Hello Robert,
the solution approach looks fine but unfortunately your mail is not in
patch format.
Please, add you signature when committing the patch.
Format the patch with 'git format-patch'.
Check the file with 'scripts/checkpatch.pl'.
Determine the maintainers with 'scripts/get_maintainer.pl'.
Send the patch with 'git send-email' to the maintainers and the list.
Best regards
Heinrich
>
> */
> static unsigned br_dec16be(const void *src)
> {
> - return be16_to_cpup(src);
> + return get_unaligned_be16(src);
> }
> /**
> @@ -33,7 +34,7 @@ static unsigned br_dec16be(const void *s
> */
> static uint32_t br_dec32be(const void *src)
> {
> - return be32_to_cpup(src);
> + return get_unaligned_be32(src);
> }
> /**
>
> --- u-boot-master-20200908/lib/rsa/rsa-keyprop.c 2020-09-07 20:17:33.000000000 +0200
> +++ mycode/lib/rsa/rsa-keyprop.c 2020-09-08 18:10:59.122022000 +0200
> @@ -15,6 +15,7 @@
> #include <asm/byteorder.h>
> #include <crypto/internal/rsa.h>
> #include <u-boot/rsa-mod-exp.h>
> +#include <asm/unaligned.h>
> /**
> * br_dec16be() - Convert 16-bit big-endian integer to native
> @@ -23,7 +24,7 @@
>
prev parent reply other threads:[~2020-09-14 11:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-09 7:35 [PATCH] for [BUG] rsa: crash in br_i32_decode() called from rsa_gen_key_prop() (Heinrich Schuchardt) REITHER Robert - Contractor
2020-09-14 11:05 ` Heinrich Schuchardt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fda2944b-602c-ee13-3b76-942e8949b80d@gmx.de \
--to=xypron.glpk@gmx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox