From: Vineet Gupta <vineet.gupta1@synopsys.com>
To: Eugeniy Paltsev <eugeniy.paltsev@synopsys.com>,
<linux-snps-arc@lists.infradead.org>
Cc: <khilman@baylibre.com>,
Alexey Brodkin <alexey.brodkin@synopsys.com>,
<linux-kernel@vger.kernel.org>,
Corentin Labbe <clabbe@baylibre.com>
Subject: Re: [PATCH v2 1/2] ARC: U-boot: check arguments paranoidly
Date: Fri, 15 Feb 2019 15:55:08 -0800 [thread overview]
Message-ID: <f27a52c2-3f1a-51c2-6b4f-dfbdc94b8aff@synopsys.com> (raw)
In-Reply-To: <20190214150745.18773-2-Eugeniy.Paltsev@synopsys.com>
[...]
> -char __initdata *uboot_arg;
> +unsigned int __initdata uboot_arg;
Why ?
In both places it is actually used, it is intended as a pointer. The cast for
range check is needed but lets cast there. See below for real reason.
> -static inline int is_kernel(unsigned long addr)
> +static inline bool uboot_arg_invalid(unsigned int addr)
> {
> - if (addr >= (unsigned long)_stext && addr <= (unsigned long)_end)
> - return 1;
> +
> + /* Check that address doesn't clobber resident kernel image */
> + return addr >= (unsigned int)_stext && addr <= (unsigned int)_end;
...
> +
> + /* see if U-boot passed an external Device Tree blob */
> + if (uboot_tag == UBOOT_TAG_DTB) {
> + machine_desc = setup_machine_fdt((void *)uboot_arg);
On a 64-bit paradigm, with LP64 ABI, this will break since int will be 4b, while
pointer 8b.
I'll fix it up locally and push !
-Vineet
next prev parent reply other threads:[~2019-02-15 23:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-14 15:07 [PATCH v2 0/2] ARC: rework U-boot arguments handling Eugeniy Paltsev
2019-02-14 15:07 ` [PATCH v2 1/2] ARC: U-boot: check arguments paranoidly Eugeniy Paltsev
2019-02-15 23:55 ` Vineet Gupta [this message]
2019-02-14 15:07 ` [PATCH v2 2/2] ARC: enable uboot support unconditionally Eugeniy Paltsev
2019-07-18 20:51 ` Alexey Brodkin
2019-08-02 7:40 ` Greg Kroah-Hartman
2019-08-02 16:25 ` Alexey Brodkin
2019-08-05 11:17 ` Greg Kroah-Hartman
2019-02-15 11:12 ` [PATCH v2 0/2] ARC: rework U-boot arguments handling LABBE Corentin
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=f27a52c2-3f1a-51c2-6b4f-dfbdc94b8aff@synopsys.com \
--to=vineet.gupta1@synopsys.com \
--cc=alexey.brodkin@synopsys.com \
--cc=clabbe@baylibre.com \
--cc=eugeniy.paltsev@synopsys.com \
--cc=khilman@baylibre.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
/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
all inboxes | Powered by JetHome®