[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6ac2e3636968832b7bc9a49d6a3f4d4998f9aa20.camel@perches.com>
Date: Thu, 05 Jul 2018 14:56:19 -0700
From: Joe Perches <joe@...ches.com>
To: Prakruthi Deepak Heragu <pheragu@...eaurora.org>, apw@...onical.com
Cc: linux-kernel@...r.kernel.org, ckadabi@...eaurora.org,
tsoni@...eaurora.org, bryanh@...eaurora.org
Subject: Re: [PATCH] checkpatch: forbid filesystem accesses from within the
kernel
On Thu, 2018-07-05 at 14:47 -0700, Prakruthi Deepak Heragu wrote:
> As use of sys_open/close/read/write system calls from within the kernel
> code is inappropriate, an error is triggered if used.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -5372,6 +5372,13 @@ sub process {
> "Avoid line continuations in quoted strings\n" . $herecurr);
> }
>
> +# sys_open/read/write/close are not allowed in the kernel
> + if ($line =~ /\b(sys_(?:open|read|write|close))\b/) {
> + ERROR("FILE_OPS",
> + "$1 is inappropriate in kernel code.\n" .
> + $herecurr);
> + }
> +
Is this really useful?
As far as I can tell, this would only give
false positives on all existing kernel code.
Powered by blists - more mailing lists