* [PATCH] headers_check: better search for functions in headers
@ 2010-11-30 16:21 Alexander Shishkin
2010-11-30 16:36 ` Randy Dunlap
2010-12-14 16:07 ` Michal Marek
0 siblings, 2 replies; 4+ messages in thread
From: Alexander Shishkin @ 2010-11-30 16:21 UTC (permalink / raw)
To: linux-kernel
Cc: Alexander Shishkin, Stephen Hemminger, Andrew Morton,
Michal Marek, WANG Cong
Some headers don't bother with "extern" in function prototypes,
which results in said prototypes being unnoticed and exported
to userland.
This patch slightly improves detection of such cases by checking
for C type names as well in the beginning of a line.
Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
CC: Stephen Hemminger <shemminger@vyatta.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Michal Marek <mmarek@suse.cz>
CC: WANG Cong <amwang@redhat.com>
CC: linux-kernel@vger.kernel.org
---
| 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
--git a/scripts/headers_check.pl b/scripts/headers_check.pl
index 50d6cfd..e0e25a1 100644
--- a/scripts/headers_check.pl
+++ b/scripts/headers_check.pl
@@ -64,7 +64,7 @@ sub check_include
sub check_declarations
{
- if ($line =~m/^\s*extern\b/) {
+ if ($line =~m/^(\s*extern|unsigned|char|short|int|long|void)\b/) {
printf STDERR "$filename:$lineno: " .
"userspace cannot call function or variable " .
"defined in the kernel\n";
--
1.7.2.1.45.gb66c2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] headers_check: better search for functions in headers
2010-11-30 16:21 [PATCH] headers_check: better search for functions in headers Alexander Shishkin
@ 2010-11-30 16:36 ` Randy Dunlap
2010-11-30 16:42 ` Alexander Shishkin
2010-12-14 16:07 ` Michal Marek
1 sibling, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2010-11-30 16:36 UTC (permalink / raw)
To: Alexander Shishkin
Cc: linux-kernel, Stephen Hemminger, Andrew Morton, Michal Marek,
WANG Cong
On Tue, 30 Nov 2010 18:21:59 +0200 Alexander Shishkin wrote:
> Some headers don't bother with "extern" in function prototypes,
> which results in said prototypes being unnoticed and exported
> to userland.
>
> This patch slightly improves detection of such cases by checking
> for C type names as well in the beginning of a line.
>
> Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
> CC: Stephen Hemminger <shemminger@vyatta.com>
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: Michal Marek <mmarek@suse.cz>
> CC: WANG Cong <amwang@redhat.com>
> CC: linux-kernel@vger.kernel.org
> ---
> scripts/headers_check.pl | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl
> index 50d6cfd..e0e25a1 100644
> --- a/scripts/headers_check.pl
> +++ b/scripts/headers_check.pl
> @@ -64,7 +64,7 @@ sub check_include
>
> sub check_declarations
> {
> - if ($line =~m/^\s*extern\b/) {
> + if ($line =~m/^(\s*extern|unsigned|char|short|int|long|void)\b/) {
> printf STDERR "$filename:$lineno: " .
> "userspace cannot call function or variable " .
s/call/reference/ ?
> "defined in the kernel\n";
> --
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] headers_check: better search for functions in headers
2010-11-30 16:36 ` Randy Dunlap
@ 2010-11-30 16:42 ` Alexander Shishkin
0 siblings, 0 replies; 4+ messages in thread
From: Alexander Shishkin @ 2010-11-30 16:42 UTC (permalink / raw)
To: Randy Dunlap
Cc: linux-kernel, Stephen Hemminger, Andrew Morton, Michal Marek,
WANG Cong
On Tue, Nov 30, 2010 at 08:36:07AM -0800, Randy Dunlap wrote:
> On Tue, 30 Nov 2010 18:21:59 +0200 Alexander Shishkin wrote:
>
> > Some headers don't bother with "extern" in function prototypes,
> > which results in said prototypes being unnoticed and exported
> > to userland.
> >
> > This patch slightly improves detection of such cases by checking
> > for C type names as well in the beginning of a line.
> >
> > Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
> > CC: Stephen Hemminger <shemminger@vyatta.com>
> > CC: Andrew Morton <akpm@linux-foundation.org>
> > CC: Michal Marek <mmarek@suse.cz>
> > CC: WANG Cong <amwang@redhat.com>
> > CC: linux-kernel@vger.kernel.org
> > ---
> > scripts/headers_check.pl | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl
> > index 50d6cfd..e0e25a1 100644
> > --- a/scripts/headers_check.pl
> > +++ b/scripts/headers_check.pl
> > @@ -64,7 +64,7 @@ sub check_include
> >
> > sub check_declarations
> > {
> > - if ($line =~m/^\s*extern\b/) {
> > + if ($line =~m/^(\s*extern|unsigned|char|short|int|long|void)\b/) {
> > printf STDERR "$filename:$lineno: " .
> > "userspace cannot call function or variable " .
>
> s/call/reference/ ?
Yes, there's a mistake there, but it's unrelated to this patch.
Maybe goes in another patch?
Regards,
--
Alex
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] headers_check: better search for functions in headers
2010-11-30 16:21 [PATCH] headers_check: better search for functions in headers Alexander Shishkin
2010-11-30 16:36 ` Randy Dunlap
@ 2010-12-14 16:07 ` Michal Marek
1 sibling, 0 replies; 4+ messages in thread
From: Michal Marek @ 2010-12-14 16:07 UTC (permalink / raw)
To: Alexander Shishkin
Cc: linux-kernel, Stephen Hemminger, Andrew Morton, WANG Cong
On 30.11.2010 17:21, Alexander Shishkin wrote:
> Some headers don't bother with "extern" in function prototypes,
> which results in said prototypes being unnoticed and exported
> to userland.
>
> This patch slightly improves detection of such cases by checking
> for C type names as well in the beginning of a line.
Applied to kbuild-2.6.git#misc, thanks.
Michal
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-12-14 16:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-30 16:21 [PATCH] headers_check: better search for functions in headers Alexander Shishkin
2010-11-30 16:36 ` Randy Dunlap
2010-11-30 16:42 ` Alexander Shishkin
2010-12-14 16:07 ` Michal Marek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox