Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1166442 > unrolled thread

Re: [PATCH 20/22] pstore: %pF is only for function pointers

Started byKees Cook <keescook@chromium.org>
First post2015-06-17 00:10 +0200
Last post2015-06-17 00:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 20/22] pstore: %pF is only for function pointers Kees Cook <keescook@chromium.org> - 2015-06-17 00:10 +0200
    Re: [PATCH 20/22] pstore: %pF is only for function pointers Anton Vorontsov <anton@enomsg.org> - 2015-06-17 00:40 +0200

#1166442 — Re: [PATCH 20/22] pstore: %pF is only for function pointers

FromKees Cook <keescook@chromium.org>
Date2015-06-17 00:10 +0200
SubjectRe: [PATCH 20/22] pstore: %pF is only for function pointers
Message-ID<pC7dn-787-13@gated-at.bofh.it>
On Wed, Mar 11, 2015 at 8:13 PM, Scott Wood <scottwood@freescale.com> wrote:
> Use %pS for actual addresses, otherwise you'll get bad output
> on arches like ppc64 where %pF expects a function descriptor.
>
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> Cc: Anton Vorontsov <anton@enomsg.org>
> Cc: Colin Cross <ccross@android.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Tony Luck <tony.luck@intel.com>
> ---
>  fs/pstore/inode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
> index b32ce53..f8a5bfe 100644
> --- a/fs/pstore/inode.c
> +++ b/fs/pstore/inode.c
> @@ -107,7 +107,7 @@ static int pstore_ftrace_seq_show(struct seq_file *s, void *v)
>         struct pstore_ftrace_seq_data *data = v;
>         struct pstore_ftrace_record *rec = (void *)(ps->data + data->off);
>
> -       seq_printf(s, "%d %08lx  %08lx  %pf <- %pF\n",
> +       seq_printf(s, "%d %08lx  %08lx  %ps <- %pS\n",
>                 pstore_ftrace_decode_cpu(rec), rec->ip, rec->parent_ip,
>                 (void *)rec->ip, (void *)rec->parent_ip);
>
> --
> 2.1.0
>

Anton, does this look okay to you? (i.e. switching from function
pointer to direct pointer?) vsprintf docs say:
 * Note: The difference between 'S' and 'F' is that on ia64 and ppc64
 * function pointers are really function descriptors, which contain a
 * pointer to the real address.

So this seems correct to me.

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

-- 
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1166457

FromAnton Vorontsov <anton@enomsg.org>
Date2015-06-17 00:40 +0200
Message-ID<pC7Gp-7G6-1@gated-at.bofh.it>
In reply to#1166442
On Tue, Jun 16, 2015 at 03:02:50PM -0700, Kees Cook wrote:
> On Wed, Mar 11, 2015 at 8:13 PM, Scott Wood <scottwood@freescale.com> wrote:
> > Use %pS for actual addresses, otherwise you'll get bad output
> > on arches like ppc64 where %pF expects a function descriptor.
> >
> > Signed-off-by: Scott Wood <scottwood@freescale.com>
...
> > -       seq_printf(s, "%d %08lx  %08lx  %pf <- %pF\n",
> > +       seq_printf(s, "%d %08lx  %08lx  %ps <- %pS\n",
...
> Anton, does this look okay to you? (i.e. switching from function
> pointer to direct pointer?) vsprintf docs say:
>  * Note: The difference between 'S' and 'F' is that on ia64 and ppc64
>  * function pointers are really function descriptors, which contain a
>  * pointer to the real address.
> 
> So this seems correct to me.
> 
> Reviewed-by: Kees Cook <keescook@chromium.org>

Without questioning the confusing behaviour of "%pF", yes, sure... ack. :)

(However, intuitively I'd expect %pF to behave like %pS... but this surely not
going to change...)

Thanks!

Anton
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web