We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56d5f3e commit 890ed45Copy full SHA for 890ed45
kernel/acct.c
@@ -243,6 +243,20 @@ static int acct_on(struct filename *pathname)
243
return -EACCES;
244
}
245
246
+ /* Exclude kernel kernel internal filesystems. */
247
+ if (file_inode(file)->i_sb->s_flags & (SB_NOUSER | SB_KERNMOUNT)) {
248
+ kfree(acct);
249
+ filp_close(file, NULL);
250
+ return -EINVAL;
251
+ }
252
+
253
+ /* Exclude procfs and sysfs. */
254
+ if (file_inode(file)->i_sb->s_iflags & SB_I_USERNS_VISIBLE) {
255
256
257
258
259
260
if (!(file->f_mode & FMODE_CAN_WRITE)) {
261
kfree(acct);
262
filp_close(file, NULL);
0 commit comments