File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ static int loadpin_check(struct file *file, enum kernel_read_file_id id)
131
131
{
132
132
struct super_block * load_root ;
133
133
const char * origin = kernel_read_file_id_str (id );
134
+ bool first_root_pin = false;
134
135
bool load_root_writable ;
135
136
136
137
/* If the file id is excluded, ignore the pinning. */
@@ -162,18 +163,14 @@ static int loadpin_check(struct file *file, enum kernel_read_file_id id)
162
163
*/
163
164
if (!pinned_root ) {
164
165
pinned_root = load_root ;
165
- /*
166
- * Unlock now since it's only pinned_root we care about.
167
- * In the worst case, we will (correctly) report pinning
168
- * failures before we have announced that pinning is
169
- * enforcing. This would be purely cosmetic.
170
- */
171
- spin_unlock (& pinned_root_spinlock );
166
+ first_root_pin = true;
167
+ }
168
+ spin_unlock (& pinned_root_spinlock );
169
+
170
+ if (first_root_pin ) {
172
171
report_writable (pinned_root , load_root_writable );
173
172
set_sysctl (load_root_writable );
174
173
report_load (origin , file , "pinned" );
175
- } else {
176
- spin_unlock (& pinned_root_spinlock );
177
174
}
178
175
179
176
if (IS_ERR_OR_NULL (pinned_root ) ||
You can’t perform that action at this time.
0 commit comments