Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 26d11030 authored by Li Jinyue's avatar Li Jinyue Committed by Alexander Alexeev
Browse files

BACKPORT: futex: Prevent overflow by strengthen input validation



UBSAN reports signed integer overflow in kernel/futex.c:

 UBSAN: Undefined behaviour in kernel/futex.c:2041:18
 signed integer overflow:
 0 - -2147483648 cannot be represented in type 'int'

Add a sanity check to catch negative values of nr_wake and nr_requeue.

Signed-off-by: default avatarLi Jinyue <lijinyue@huawei.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarErick Reyes <erickreyes@google.com>
Signed-off-by: default avatarOleg Matcovschi <omatcovschi@google.com>
Cc: peterz@infradead.org
Cc: dvhart@infradead.org
Cc: stable@vger.kernel.org

Link: https://lkml.kernel.org/r/1513242294-31786-1-git-send-email-lijinyue@huawei.com
Cherry-picked from fbe0e839d1e22d88810f3ee3e2f1479be4c0aa4a

Bug: 76106267
Change-Id: I954cc2848678318b60ec3f103d0c15f87b4605a4
parent b21b869c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment