From: Daniel Micay <danielmicay@gmail.com>
To: Kees Cook <keescook@chromium.org>, linux-kernel@vger.kernel.org
Cc: kexec@lists.infradead.org, Eric Biederman <ebiederm@xmission.com>
Subject: Re: [PATCH] kexec_file: Adjust type of kexec_purgatory
Date: Tue, 09 May 2017 19:13:45 -0400 [thread overview]
Message-ID: <1494371625.7678.3.camel@gmail.com> (raw)
In-Reply-To: <20170509230639.GA132135@beast>
On Tue, 2017-05-09 at 16:06 -0700, Kees Cook wrote:
> Defining kexec_purgatory as a zero-length char array upsets compile
> time size checking. Since this is entirely runtime sized, switch
> this to void *. This silences the warning generated by the future
> CONFIG_FORTIFY_SOURCE, which did not like the memcmp() of a "0 byte"
> array.
>
> Cc: Daniel Micay <danielmicay@gmail.com>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> kernel/kexec_file.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
> index b118735fea9d..bc86f85f1329 100644
> --- a/kernel/kexec_file.c
> +++ b/kernel/kexec_file.c
> @@ -30,7 +30,7 @@
> * Declare these symbols weak so that if architecture provides a
> purgatory,
> * these will be overridden.
> */
> -char __weak kexec_purgatory[0];
> +void * __weak kexec_purgatory;
> size_t __weak kexec_purgatory_size = 0;
>
> static int kexec_calculate_store_digests(struct kimage *image);
> --
> 2.7.4
It seems more correct to use char `char __weak kexec_purgatory[]`,
otherwise isn't __builtin_object_size ending up as 8, which is still
wrong?
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
WARNING: multiple messages have this Message-ID (diff)
From: Daniel Micay <danielmicay@gmail.com>
To: Kees Cook <keescook@chromium.org>, linux-kernel@vger.kernel.org
Cc: Eric Biederman <ebiederm@xmission.com>, kexec@lists.infradead.org
Subject: Re: [PATCH] kexec_file: Adjust type of kexec_purgatory
Date: Tue, 09 May 2017 19:13:45 -0400 [thread overview]
Message-ID: <1494371625.7678.3.camel@gmail.com> (raw)
In-Reply-To: <20170509230639.GA132135@beast>
On Tue, 2017-05-09 at 16:06 -0700, Kees Cook wrote:
> Defining kexec_purgatory as a zero-length char array upsets compile
> time size checking. Since this is entirely runtime sized, switch
> this to void *. This silences the warning generated by the future
> CONFIG_FORTIFY_SOURCE, which did not like the memcmp() of a "0 byte"
> array.
>
> Cc: Daniel Micay <danielmicay@gmail.com>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> kernel/kexec_file.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
> index b118735fea9d..bc86f85f1329 100644
> --- a/kernel/kexec_file.c
> +++ b/kernel/kexec_file.c
> @@ -30,7 +30,7 @@
> * Declare these symbols weak so that if architecture provides a
> purgatory,
> * these will be overridden.
> */
> -char __weak kexec_purgatory[0];
> +void * __weak kexec_purgatory;
> size_t __weak kexec_purgatory_size = 0;
>
> static int kexec_calculate_store_digests(struct kimage *image);
> --
> 2.7.4
It seems more correct to use char `char __weak kexec_purgatory[]`,
otherwise isn't __builtin_object_size ending up as 8, which is still
wrong?
next prev parent reply other threads:[~2017-05-09 23:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-09 23:06 [PATCH] kexec_file: Adjust type of kexec_purgatory Kees Cook
2017-05-09 23:06 ` Kees Cook
2017-05-09 23:13 ` Daniel Micay [this message]
2017-05-09 23:13 ` Daniel Micay
2017-05-09 23:22 ` Kees Cook
2017-05-09 23:22 ` Kees Cook
2017-05-10 0:15 ` Eric W. Biederman
2017-05-10 0:15 ` Eric W. Biederman
2017-05-10 19:54 ` Kees Cook
2017-05-10 19:54 ` Kees Cook
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=1494371625.7678.3.camel@gmail.com \
--to=danielmicay@gmail.com \
--cc=ebiederm@xmission.com \
--cc=keescook@chromium.org \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.