Thread (26 messages) 26 messages, 5 authors, 2021-06-23
STALE1829d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 09/10] security: reduce stack footprint in loadpin_read_file()

From: Anton Suvorov <hidden>
Date: 2021-06-02 15:31:52
Also in: linux-fsdevel, lkml
Subsystem: loadpin security module, security subsystem, the rest · Maintainers: Kees Cook, Paul Moore, James Morris, "Serge E. Hallyn", Linus Torvalds

Stack usage reduced (measured with allyesconfig):

./security/loadpin/loadpin.c    loadpin_read_file       200     56      -144

Signed-off-by: Anton Suvorov <redacted>
---
 security/loadpin/loadpin.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/security/loadpin/loadpin.c b/security/loadpin/loadpin.c
index b12f7d986b1e..ad4e6756c038 100644
--- a/security/loadpin/loadpin.c
+++ b/security/loadpin/loadpin.c
@@ -78,11 +78,8 @@ static void check_pinning_enforcement(struct super_block *mnt_sb)
 	 * device, allow sysctl to change modes for testing.
 	 */
 	if (mnt_sb->s_bdev) {
-		char bdev[BDEVNAME_SIZE];
-
 		ro = bdev_read_only(mnt_sb->s_bdev);
-		bdevname(mnt_sb->s_bdev, bdev);
-		pr_info("%s (%u:%u): %s\n", bdev,
+		pr_info("%pg (%u:%u): %s\n", mnt_sb->s_bdev,
 			MAJOR(mnt_sb->s_bdev->bd_dev),
 			MINOR(mnt_sb->s_bdev->bd_dev),
 			ro ? "read-only" : "writable");
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help