From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756723AbbFPWDA (ORCPT ); Tue, 16 Jun 2015 18:03:00 -0400 Received: from mail-yk0-f179.google.com ([209.85.160.179]:34060 "EHLO mail-yk0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752096AbbFPWCv (ORCPT ); Tue, 16 Jun 2015 18:02:51 -0400 X-Greylist: delayed 92595 seconds by postgrey-1.27 at vger.kernel.org; Tue, 16 Jun 2015 18:02:51 EDT MIME-Version: 1.0 In-Reply-To: <1426130037-17956-20-git-send-email-scottwood@freescale.com> References: <1426130037-17956-1-git-send-email-scottwood@freescale.com> <1426130037-17956-20-git-send-email-scottwood@freescale.com> Date: Tue, 16 Jun 2015 15:02:50 -0700 X-Google-Sender-Auth: TfwSU0QeLQYshF30h5_aed6rqLs Message-ID: Subject: Re: [PATCH 20/22] pstore: %pF is only for function pointers From: Kees Cook To: Anton Vorontsov Cc: trivial@kernel.org, LKML , Colin Cross , Tony Luck , Scott Wood Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 11, 2015 at 8:13 PM, Scott Wood 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 > Cc: Anton Vorontsov > Cc: Colin Cross > Cc: Kees Cook > Cc: Tony Luck > --- > 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 -Kees -- Kees Cook Chrome OS Security