All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Roberts, William C" <william.c.roberts@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"apw@canonical.com" <apw@canonical.com>,
	"kernel-hardening@lists.openwall.com" 
	<kernel-hardening@lists.openwall.com>
Subject: Re: [PATCH] checkpatch: add warning on %pk instead of %pK usage
Date: Mon, 13 Feb 2017 14:20:41 -0800	[thread overview]
Message-ID: <1487024441.6214.12.camel@perches.com> (raw)
In-Reply-To: <476DC76E7D1DF2438D32BFADF679FC562305F62F@ORSMSX103.amr.corp.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2383 bytes --]

(Adding back the cc's)

On Mon, 2017-02-13 at 21:28 +0000, Roberts, William C wrote:
> <snip>
> > No worries.
> > No idea why it doesn't work for you.
> > Maybe the hand applying was somehow
> > faulty?
> > 
> > The attached is on top of -next so it does have offsets on Linus' tree, but it seems
> > to work.
> > 
> > (on -linux)
> > 
> > $ patch -p1 < cp_vsp.diff
> > patching file scripts/checkpatch.pl
> > Hunk #1 succeeded at 5634 (offset -36 lines).
> > 
> > $ cat t_block.c
> > {
> > 	MY_DEBUG(drv->foo,
> > 		 "%pk",
> > 		 foo->boo);
> > }
> > $ ./scripts/checkpatch.pl -f t_block.c
> > WARNING: Invalid vsprintf pointer extension '%pk'
> > #2: FILE: t_block.c:2:
> > +	MY_DEBUG(drv->foo,
> > +		 "%pk",
> > +		 foo->boo);
> > 
> > total: 0 errors, 1 warnings, 5 lines checked
> > 
> > NOTE: For some of the reported defects, checkpatch may be able to
> >       mechanically convert to the typical style using --fix or --fix-inplace.
> > 
> > t_block.c has style problems, please review.
> > 
> > NOTE: If any of the errors are false positives, please report
> >       them to the maintainer, see CHECKPATCH in MAINTAINERS.
> 
> 
> Applied. It works fine with your example (see attached 0001-tblock.patch) but it doesn't provide
> Output for me with 0002-drv-hack.patch (attached as well)
> 
> $ ./scripts/checkpatch.pl 0002-drv-hack.patch 
> total: 0 errors, 0 warnings, 10 lines checked
> 
> 0002-drv-hack.patch has no obvious style problems and is ready for submission.
> 
> ./scripts/checkpatch.pl 0001-tblock.patch 
> WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
> #13: 
> new file mode 100644
> 
> WARNING: Invalid vsprintf pointer extension '%pk'
> #19: FILE: t_block.c:2:
> +	MY_DEBUG(drv->foo,
> +		"%pk",
> +		 foo->boo);
> 
> total: 0 errors, 2 warnings, 6 lines checked
> 
> NOTE: For some of the reported defects, checkpatch may be able to
>       mechanically convert to the typical style using --fix or --fix-inplace.
> 
> 0001-tblock.patch has style problems, please review.
> 
> NOTE: If any of the errors are false positives, please report
>       them to the maintainer, see CHECKPATCH in MAINTAINERS.

This means _all_ the $stat checks aren't being done
on patches that add just a single multi-line statement.

Andrew?  Any thoughts on how to enable $stat appropriately
for patch contexts with a single multi-line statement?

[-- Attachment #2: 1.patch --]
[-- Type: text/x-patch, Size: 695 bytes --]

From 00191661141fb11abac22efe98ee58d37a9d9391 Mon Sep 17 00:00:00 2001
From: William Roberts <william.c.roberts@intel.com>
Date: Mon, 13 Feb 2017 11:35:03 -0800
Subject: [PATCH 2/2] drv hack

Signed-off-by: William Roberts <william.c.roberts@intel.com>
---
 drivers/char/applicom.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index e5c62dc..4f6934d 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -153,6 +153,10 @@ static int ac_register_board(unsigned long physloc, void __iomem *loc,
 		return 0;
 	}

+	MY_DEBUG(drv->foo,
+		"%pk",
+		foo->boo);
+
 	boardno--;
 
 	apbs[boardno].PhysIO = physloc;
-- 
2.7.4


WARNING: multiple messages have this Message-ID (diff)
From: Joe Perches <joe@perches.com>
To: "Roberts, William C" <william.c.roberts@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"apw@canonical.com" <apw@canonical.com>,
	"kernel-hardening@lists.openwall.com"
	<kernel-hardening@lists.openwall.com>
Subject: [kernel-hardening] Re: [PATCH] checkpatch: add warning on %pk instead of %pK usage
Date: Mon, 13 Feb 2017 14:20:41 -0800	[thread overview]
Message-ID: <1487024441.6214.12.camel@perches.com> (raw)
In-Reply-To: <476DC76E7D1DF2438D32BFADF679FC562305F62F@ORSMSX103.amr.corp.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2383 bytes --]

(Adding back the cc's)

On Mon, 2017-02-13 at 21:28 +0000, Roberts, William C wrote:
> <snip>
> > No worries.
> > No idea why it doesn't work for you.
> > Maybe the hand applying was somehow
> > faulty?
> > 
> > The attached is on top of -next so it does have offsets on Linus' tree, but it seems
> > to work.
> > 
> > (on -linux)
> > 
> > $ patch -p1 < cp_vsp.diff
> > patching file scripts/checkpatch.pl
> > Hunk #1 succeeded at 5634 (offset -36 lines).
> > 
> > $ cat t_block.c
> > {
> > 	MY_DEBUG(drv->foo,
> > 		 "%pk",
> > 		 foo->boo);
> > }
> > $ ./scripts/checkpatch.pl -f t_block.c
> > WARNING: Invalid vsprintf pointer extension '%pk'
> > #2: FILE: t_block.c:2:
> > +	MY_DEBUG(drv->foo,
> > +		 "%pk",
> > +		 foo->boo);
> > 
> > total: 0 errors, 1 warnings, 5 lines checked
> > 
> > NOTE: For some of the reported defects, checkpatch may be able to
> >       mechanically convert to the typical style using --fix or --fix-inplace.
> > 
> > t_block.c has style problems, please review.
> > 
> > NOTE: If any of the errors are false positives, please report
> >       them to the maintainer, see CHECKPATCH in MAINTAINERS.
> 
> 
> Applied. It works fine with your example (see attached 0001-tblock.patch) but it doesn't provide
> Output for me with 0002-drv-hack.patch (attached as well)
> 
> $ ./scripts/checkpatch.pl 0002-drv-hack.patch 
> total: 0 errors, 0 warnings, 10 lines checked
> 
> 0002-drv-hack.patch has no obvious style problems and is ready for submission.
> 
> ./scripts/checkpatch.pl 0001-tblock.patch 
> WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
> #13: 
> new file mode 100644
> 
> WARNING: Invalid vsprintf pointer extension '%pk'
> #19: FILE: t_block.c:2:
> +	MY_DEBUG(drv->foo,
> +		"%pk",
> +		 foo->boo);
> 
> total: 0 errors, 2 warnings, 6 lines checked
> 
> NOTE: For some of the reported defects, checkpatch may be able to
>       mechanically convert to the typical style using --fix or --fix-inplace.
> 
> 0001-tblock.patch has style problems, please review.
> 
> NOTE: If any of the errors are false positives, please report
>       them to the maintainer, see CHECKPATCH in MAINTAINERS.

This means _all_ the $stat checks aren't being done
on patches that add just a single multi-line statement.

Andrew?  Any thoughts on how to enable $stat appropriately
for patch contexts with a single multi-line statement?

[-- Attachment #2: 1.patch --]
[-- Type: text/x-patch, Size: 695 bytes --]

From 00191661141fb11abac22efe98ee58d37a9d9391 Mon Sep 17 00:00:00 2001
From: William Roberts <william.c.roberts@intel.com>
Date: Mon, 13 Feb 2017 11:35:03 -0800
Subject: [PATCH 2/2] drv hack

Signed-off-by: William Roberts <william.c.roberts@intel.com>
---
 drivers/char/applicom.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index e5c62dc..4f6934d 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -153,6 +153,10 @@ static int ac_register_board(unsigned long physloc, void __iomem *loc,
 		return 0;
 	}

+	MY_DEBUG(drv->foo,
+		"%pk",
+		foo->boo);
+
 	boardno--;
 
 	apbs[boardno].PhysIO = physloc;
-- 
2.7.4


  parent reply	other threads:[~2017-02-13 22:20 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-10 19:37 [PATCH] checkpatch: add warning on %pk instead of %pK usage william.c.roberts
2017-02-10 19:37 ` [kernel-hardening] " william.c.roberts
2017-02-10 20:12 ` Joe Perches
2017-02-10 20:12   ` [kernel-hardening] " Joe Perches
2017-02-10 22:14   ` Roberts, William C
2017-02-10 22:14     ` [kernel-hardening] " Roberts, William C
2017-02-10 22:26     ` Roberts, William C
2017-02-10 22:26       ` [kernel-hardening] " Roberts, William C
2017-02-10 22:49       ` Joe Perches
2017-02-10 22:49         ` [kernel-hardening] " Joe Perches
2017-02-10 22:59         ` Joe Perches
2017-02-10 22:59           ` [kernel-hardening] " Joe Perches
2017-02-10 23:31         ` Roberts, William C
2017-02-10 23:31           ` [kernel-hardening] " Roberts, William C
2017-02-10 23:49           ` Joe Perches
2017-02-10 23:49             ` [kernel-hardening] " Joe Perches
2017-02-10 23:54         ` Roberts, William C
2017-02-10 23:54           ` [kernel-hardening] " Roberts, William C
2017-02-11  0:01           ` Joe Perches
2017-02-11  0:01             ` [kernel-hardening] " Joe Perches
2017-02-11  1:32         ` Roberts, William C
2017-02-11  1:32           ` [kernel-hardening] " Roberts, William C
2017-02-11  3:23           ` Joe Perches
2017-02-11  3:23             ` [kernel-hardening] " Joe Perches
2017-02-13 19:46             ` Roberts, William C
2017-02-13 19:46               ` [kernel-hardening] " Roberts, William C
2017-02-13 20:14               ` Joe Perches
2017-02-13 20:14                 ` [kernel-hardening] " Joe Perches
     [not found]               ` <1487016251.6214.6.camel@perches.com>
     [not found]                 ` <476DC76E7D1DF2438D32BFADF679FC562305F62F@ORSMSX103.amr.corp.intel.com>
2017-02-13 22:20                   ` Joe Perches [this message]
2017-02-13 22:20                     ` Joe Perches
2017-02-15 23:49                     ` Roberts, William C
2017-02-15 23:49                       ` [kernel-hardening] " Roberts, William C
2017-02-16  0:19                       ` Joe Perches
2017-02-16  0:19                         ` [kernel-hardening] " Joe Perches
2017-02-27 16:26                       ` Roberts, William C
2017-02-27 16:26                         ` [kernel-hardening] " Roberts, William C
2017-02-27 20:54                         ` [PATCH] checkpatch: Add ability to find bad uses of vsprintf %p<foo> extensions Joe Perches
2017-02-27 20:54                           ` [kernel-hardening] " Joe Perches
2017-02-27 21:18                           ` Kees Cook
2017-02-27 21:18                             ` Kees Cook
2017-02-28 15:34                           ` Roberts, William C
2017-02-28 15:34                             ` [kernel-hardening] " Roberts, William C
2017-03-01  0:06                           ` Andrew Morton
2017-03-01  0:06                             ` [kernel-hardening] " Andrew Morton
2017-03-01  0:11                             ` Kees Cook
2017-03-01  0:11                               ` Kees Cook
2017-03-01  1:14                               ` Joe Perches
2017-03-01  1:14                                 ` Joe Perches
2017-03-01  0:12                             ` Joe Perches
2017-03-01  0:12                               ` [kernel-hardening] " Joe Perches

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=1487024441.6214.12.camel@perches.com \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=william.c.roberts@intel.com \
    /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.