From: <ye.xingchen@zte.com.cn>
To: <paul@paul-moore.com>
Cc: <stephen.smalley.work@gmail.com>, <eparis@parisplace.org>,
<selinux@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH security-next] selinux: use sysfs_emit() to instead of scnprintf()
Date: Mon, 5 Dec 2022 19:32:08 +0800 (CST) [thread overview]
Message-ID: <202212051932088061889@zte.com.cn> (raw)
From: ye xingchen <ye.xingchen@zte.com.cn>
Follow the advice of the Documentation/filesystems/sysfs.rst and show()
should only use sysfs_emit() or sysfs_emit_at() when formatting the
value to be returned to user space.
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
security/selinux/avc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index 9a43af0ebd7d..517fe3454aec 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -174,7 +174,7 @@ int avc_get_hash_stats(struct selinux_avc *avc, char *page)
rcu_read_unlock();
- return scnprintf(page, PAGE_SIZE, "entries: %d\nbuckets used: %d/%d\n"
+ return sysfs_emit(page, "entries: %d\nbuckets used: %d/%d\n"
"longest chain: %d\n",
atomic_read(&avc->avc_cache.active_nodes),
slots_used, AVC_CACHE_SLOTS, max_chain_len);
--
2.25.1
next reply other threads:[~2022-12-05 11:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-05 11:32 ye.xingchen [this message]
2022-12-06 20:26 ` [PATCH security-next] selinux: use sysfs_emit() to instead of scnprintf() Paul Moore
2022-12-06 22:49 ` Paul Moore
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=202212051932088061889@zte.com.cn \
--to=ye.xingchen@zte.com.cn \
--cc=eparis@parisplace.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=selinux@vger.kernel.org \
--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 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.