Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "lkm" script fails on dmesg permissions #1

Merged
merged 3 commits into from
Aug 31, 2021

Conversation

gregbuchholz
Copy link
Contributor

Changing to "sudo dmesg" fixes it.

…esg which fails on

permissions.  Changing to "sudo dmesg" fixes it.
@gregbuchholz
Copy link
Contributor Author

This was with Ubuntu 21.04

Copy link
Collaborator

@kaiwan kaiwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @gregbuchholz, thank you!
With default settings on Ubuntu, dmesg doesn't require root access..
have you changed something? Is it a custom built kernel with CONFIG_SECURITY_DMESG_RESTRICT set (will restrict dmesg to root-only)?

@gregbuchholz
Copy link
Contributor Author

gregbuchholz commented Aug 31, 2021

I had compiled a new 5.13.11 based on localmodconfig in a virtual machine. Searching the .config file does confirm that CONFIG_SECURITY_DMESG_RESTRICT is set to 'y'. Then booting the stock 5.11.0-31-generic kernel that came with the Ubuntu 21.04 install, I get the same behavior with dmesg needing root permissions. This is also consistent with the Lubuntu installed on my laptop. It looks like this might have been a change in Ubuntu starting with the 20.10 release. See also:

"Ubuntu 20.10 Moving Ahead In Restricting Access To dmesg"

https://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-20.10-dmesg-Needs-Root

@kaiwan
Copy link
Collaborator

kaiwan commented Aug 31, 2021

I had compiled a new 5.13.11 based on localmodconfig in a virtual machine. Searching the .config file does confirm that >CONFIG_SECURITY_DMESG_RESTRICT is set to 'y'.
Right; this makes sense..

"Ubuntu 20.10 Moving Ahead In Restricting Access To dmesg"
https://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-20.10-dmesg-Needs-Root
Ah, then no wonder... the book uses Ubuntu 20.04, so didn't require sudo.
Ok, lets enable it now, as in any case,
sudo is used within the script (so, the default sudo timeout should ensure that the password is in any case requested only once).
Thank you!

Ubuntu 20.10 onward has enabled CONFIG_SECURITY_DMESG_RESTRICT ! That's good for security
So we need to 'sudo' dmesg; thanks to @gregbuchholz for pointing this out
Ubuntu 20.10 onward has enabled CONFIG_SECURITY_DMESG_RESTRICT ! That's good for security
So we need to 'sudo' dmesg; thanks to @gregbuchholz for pointing this out
Copy link
Collaborator

@kaiwan kaiwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ubuntu 20.10 onward has enabled CONFIG_SECURITY_DMESG_RESTRICT ! That's good for security
So we need to 'sudo' dmesg; thanks to @gregbuchholz for pointing this out

@kaiwan kaiwan merged commit bc36e21 into PacktPublishing:master Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants