-
Notifications
You must be signed in to change notification settings - Fork 105
[Deepin-Kernel-SIG] [linux 6.6-y] [Upstream] treewide: mark stuff as __ro_after_init #620
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
[Deepin-Kernel-SIG] [linux 6.6-y] [Upstream] treewide: mark stuff as __ro_after_init #620
Conversation
mainline inclusion from mainline-v6.7-rc1 category: security __read_mostly predates __ro_after_init. Many variables which are marked __read_mostly should have been __ro_after_init from day 1. Also, mark some stuff as "const" and "__init" while I'm at it. [akpm@linux-foundation.org: revert sysctl_nr_open_min, sysctl_nr_open_max changes due to arm warning] [akpm@linux-foundation.org: coding-style cleanups] Link: https://lkml.kernel.org/r/4f6bb9c0-abba-4ee4-a7aa-89265e886817@p183 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> (cherry picked from commit 68279f9) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Reviewer's Guide by SourceryThis pull request replaces No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @opsiff - I've reviewed your changes - here's some feedback:
Overall Comments:
- This looks like a good cleanup, converting
__read_mostlyto__ro_after_initwhere appropriate.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sourcery-ai[bot] The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
mainline inclusion
from mainline-v6.7-rc1
category: security
__read_mostly predates __ro_after_init. Many variables which are marked __read_mostly should have been __ro_after_init from day 1.
Also, mark some stuff as "const" and "__init" while I'm at it.
[akpm@linux-foundation.org: revert sysctl_nr_open_min, sysctl_nr_open_max changes due to arm warning] [akpm@linux-foundation.org: coding-style cleanups] Link: https://lkml.kernel.org/r/4f6bb9c0-abba-4ee4-a7aa-89265e886817@p183
Signed-off-by: Alexey Dobriyan adobriyan@gmail.com
Signed-off-by: Andrew Morton akpm@linux-foundation.org
(cherry picked from commit 68279f9)
Signed-off-by: Wentao Guan guanwentao@uniontech.com
Summary by Sourcery
Marks several kernel variables and data structures as read-only after initialization using the
__ro_after_initmacro. This change enhances memory protection and security by preventing unintended modifications to these variables after the initialization phase. Additionally, some variables are marked asconstand the__initmacro is used where appropriate.Enhancements:
__ro_after_initinstead of__read_mostly, indicating that they are read-only after initialization. This provides better memory protection and potentially improves security by preventing unintended modifications after the initialization phase.constand uses the__initmacro where appropriate.