From: 孟敬姿 <mengjingzi@iie.ac.cn>
To: pmladek@suse.com, rostedt@goodmis.org, john.ogness@linutronix.de,
senozhatsky@chromium.org, keescook@chromium.org,
tony.luck@intel.com, gpiccoli@igalia.com
Cc: linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Suggestion for Capability Check Refinement in check_syslog_permissions()
Date: Wed, 3 Jan 2024 13:00:58 +0800 (GMT+08:00) [thread overview]
Message-ID: <1ee10aa6.d064.18ccdb23971.Coremail.mengjingzi@iie.ac.cn> (raw)
Hi, we suggest revisiting the capability checks in check_syslog_permissions(). Currently CAP_SYSLOG is checked first, and if it’s not there but there is a CAP_SYS_ADMIN, it can also pass the check. We recommend refining this check to exclusively use CAP_SYSLOG. Here's our reasoning for this suggestion:
(1) Independence of CAP_SYSLOG and CAP_SYS_ADMIN: Since the introduction of CAP_SYSLOG in Linux 2.6.37, it has been a distinct capability from CAP_SYS_ADMIN. For compatibility reasons, it might make sense to keep CAP_SYS_ADMIN at the beginning. However, now that 13 years have passed,we think maybe it's appropriate to update the code to reflect their separate roles.
(2) Maintaining Least Privilege Principle: CAP_SYS_ADMIN is overloaded and known as the new "root"[1]. And according to the manual page[2] “Don't choose CAP_SYS_ADMIN if you can possibly avoid it!”, it's beneficial to use the most specific capability required for a given task.
This issue exists in several kernel versions and we have checked it on the latest stable release(Linux 6.6.9).
Your feedback and insights on this proposed modification would be highly appreciated. Thank you for your time and consideration.
Best regards,
Jingzi
reference:
[1] https://lwn.net/Articles/486306/
[2] https://www.man7.org/linux/man-pages/man7/capabilities.7.html
next reply other threads:[~2024-01-03 5:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-03 5:00 孟敬姿 [this message]
2024-01-03 6:59 ` Greg KH
2024-01-04 9:43 ` Petr Mladek
2024-01-04 16:27 ` Steven Rostedt
2024-01-05 6:20 ` [PATCH] cap_syslog: remove CAP_SYS_ADMIN when dmesg_restrict Jingzi Meng
2024-01-05 14:49 ` Theodore Ts'o
2024-01-05 15:23 ` Petr Mladek
2024-01-08 6:32 ` 孟敬姿
2024-01-08 17:57 ` Kees Cook
2024-01-15 1:24 ` 孟敬姿
2024-02-01 18:05 ` Kees Cook
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=1ee10aa6.d064.18ccdb23971.Coremail.mengjingzi@iie.ac.cn \
--to=mengjingzi@iie.ac.cn \
--cc=gpiccoli@igalia.com \
--cc=john.ogness@linutronix.de \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=tony.luck@intel.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
all inboxes | Powered by JetHome®