From: Joe Perches <joe@perches.com>
To: Prakruthi Deepak Heragu <pheragu@codeaurora.org>, apw@canonical.com
Cc: linux-kernel@vger.kernel.org, ckadabi@codeaurora.org,
tsoni@codeaurora.org, bryanh@codeaurora.org
Subject: Re: [PATCH] checkpatch: forbid filesystem accesses from within the kernel
Date: Thu, 05 Jul 2018 14:56:19 -0700 [thread overview]
Message-ID: <6ac2e3636968832b7bc9a49d6a3f4d4998f9aa20.camel@perches.com> (raw)
In-Reply-To: <1530827270-19947-1-git-send-email-pheragu@codeaurora.org>
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.
prev parent reply other threads:[~2018-07-05 21:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-05 21:47 Prakruthi Deepak Heragu
2018-07-05 21:56 ` Joe Perches [this message]
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=6ac2e3636968832b7bc9a49d6a3f4d4998f9aa20.camel@perches.com \
--to=joe@perches.com \
--cc=apw@canonical.com \
--cc=bryanh@codeaurora.org \
--cc=ckadabi@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pheragu@codeaurora.org \
--cc=tsoni@codeaurora.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®