]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
kernel/acct.c: use dedicated helper to access rlimit values
authorYang Yang <yang.yang29@zte.com.cn>
Wed, 8 Sep 2021 02:58:18 +0000 (19:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:47:34 +0000 (12:47 +0100)
[ Upstream commit 3c91dda97eea704ac257ddb138d1154adab8db62 ]

Use rlimit() helper instead of manually writing whole chain from
task to rlimit value. See patch "posix-cpu-timers: Use dedicated
helper to access rlimit values".

Link: https://lkml.kernel.org/r/20210728030822.524789-1-yang.yang29@zte.com.cn
Signed-off-by: Yang Yang <yang.yang29@zte.com.cn>
Reported-by: Zeal Robot <zealci@zte.com.cn>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: sh_def@163.com <sh_def@163.com>
Cc: Yang Yang <yang.yang29@zte.com.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Stable-dep-of: 56d5f3eba3f5 ("acct: perform last write from workqueue")
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/acct.c

index a7e29ca8f3591d02b28a693cbd293a7e92e978e7..2b2224b7ae55a7e1f9b0cff071ea87c284fbd8ac 100644 (file)
@@ -494,7 +494,7 @@ static void do_acct_process(struct bsd_acct_struct *acct)
        /*
         * Accounting records are not subject to resource limits.
         */
-       flim = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;
+       flim = rlimit(RLIMIT_FSIZE);
        current->signal->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
        /* Perform file operations on behalf of whoever enabled accounting */
        orig_cred = override_creds(file->f_cred);