Linux-api Archive mirror
 help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: Aaditya raj <rajaditya073@gmail.com>
Cc: linux-security-module@vger.kernel.org, jmorris@namei.org,
	keescook@chromium.org, john.johansen@canonical.com,
	penguin-kernel@i-love.sakura.ne.jp,
	stephen.smalley.work@gmail.com, linux-kernel@vger.kernel.org,
	linux-api@vger.kernel.org, mic@digikod.net
Subject: Re: Watchdog bark! bark due to excessive logging from SELinux in Linux-modules;
Date: Mon, 21 Aug 2023 12:43:47 -0400	[thread overview]
Message-ID: <CAHC9VhSre7fiAVNtbyVcjg3v3uUwzOm0grNbmo1ppKOyh1B=jg@mail.gmail.com> (raw)
In-Reply-To: <CAP2_zdp=oGKVfuAYUSXb_42yU-8-86AtS27TiXpibS4mj8wrfg@mail.gmail.com>

On Mon, Aug 21, 2023 at 7:14 AM Aaditya raj <rajaditya073@gmail.com> wrote:
>
> Hi Team ,
>
> There is an Watchdog bark issue seen due to excessive logging from SELinux , I have attached a patch to restrict excessive logging , please review the patch and please let me know if there is any issue.
>
> I have modified the file “security/selinux/hooks.c” on line number 1353 , replaced pr_warn with pr_warn_ratelimited.
>
> ---
>  security/selinux/hooks.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Can you provide more information about what kernel you are using and
the filesystem(s) you have mounted which are causing this error,
including how they are mounted?  I wouldn't expect a normal system to
flood the logs with many of these warnings, so I'm wondering if
something else is wrong ...

> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index d06e350fedee..83f3e5a0ccc6 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -1350,7 +1350,7 @@ static int inode_doinit_use_xattr(struct inode *inode, struct dentry *dentry,
>         if (rc < 0) {
>                 kfree(context);
>                 if (rc != -ENODATA) {
> -                       pr_warn("SELinux: %s:  getxattr returned %d for dev=%s ino=%ld\n",
> +                       pr_warn_ratelimited("SELinux: %s:  getxattr returned %d for dev=%s ino=%ld\n",
>                                 __func__, -rc, inode->i_sb->s_id, inode->i_ino);
>                         return rc;
>                 }

-- 
paul-moore.com

           reply	other threads:[~2023-08-21 16:44 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CAP2_zdp=oGKVfuAYUSXb_42yU-8-86AtS27TiXpibS4mj8wrfg@mail.gmail.com>]

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='CAHC9VhSre7fiAVNtbyVcjg3v3uUwzOm0grNbmo1ppKOyh1B=jg@mail.gmail.com' \
    --to=paul@paul-moore.com \
    --cc=jmorris@namei.org \
    --cc=john.johansen@canonical.com \
    --cc=keescook@chromium.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mic@digikod.net \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=rajaditya073@gmail.com \
    --cc=stephen.smalley.work@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).