Skip to content

Commit

Permalink
LoadPin: Report friendly block device name
Browse files Browse the repository at this point in the history
Instead of only reporting major/minor, include the actual block device
name, at least as seen by the kernel.

Signed-off-by: Kees Cook <keescook@chromium.org>
  • Loading branch information
Kees Cook committed Oct 18, 2018
1 parent 5736184 commit f4b626d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion security/loadpin/loadpin.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@ 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);
pr_info("dev(%u,%u): %s\n",
bdevname(mnt_sb->s_bdev, bdev);
pr_info("%s (%u:%u): %s\n", bdev,
MAJOR(mnt_sb->s_bdev->bd_dev),
MINOR(mnt_sb->s_bdev->bd_dev),
ro ? "read-only" : "writable");
Expand Down

0 comments on commit f4b626d

Please sign in to comment.