diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-28 21:48:16 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-28 21:48:16 +0100 |
commit | d4ab5487cc77a4053dc9070c5761ad94bf397825 (patch) | |
tree | cd69e85b7cc3f45f10c3cf402c8a497be8da3944 /kernel/ucount.c | |
parent | c2faf737abfb10f88f2d2612d573e9edc3c42c37 (diff) | |
parent | 7e57714cd0ad2d5bb90e50b5096a0e671dec1ef3 (diff) |
Merge 5.17-rc6 into tty-next
We need the tty/serial fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/ucount.c')
-rw-r--r-- | kernel/ucount.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/ucount.c b/kernel/ucount.c index 65b597431c86..06ea04d44685 100644 --- a/kernel/ucount.c +++ b/kernel/ucount.c @@ -350,7 +350,8 @@ bool is_ucounts_overlimit(struct ucounts *ucounts, enum ucount_type type, unsign if (rlimit > LONG_MAX) max = LONG_MAX; for (iter = ucounts; iter; iter = iter->ns->ucounts) { - if (get_ucounts_value(iter, type) > max) + long val = get_ucounts_value(iter, type); + if (val < 0 || val > max) return true; max = READ_ONCE(iter->ns->ucount_max[type]); } |