“cdec5634492ed088e8c0792aafbbc43de91f6692”上不存在“paddle/operators/nccl_op.h”
  • L
    locks: Fix UBSAN undefined behaviour in flock64_to_posix_lock · 16238415
    Luo Meng 提交于
    When the sum of fl->fl_start and l->l_len overflows,
    UBSAN shows the following warning:
    
    UBSAN: Undefined behaviour in fs/locks.c:482:29
    signed integer overflow: 2 + 9223372036854775806
    cannot be represented in type 'long long int'
    Call Trace:
     __dump_stack lib/dump_stack.c:77 [inline]
     dump_stack+0xe4/0x14e lib/dump_stack.c:118
     ubsan_epilogue+0xe/0x81 lib/ubsan.c:161
     handle_overflow+0x193/0x1e2 lib/ubsan.c:192
     flock64_to_posix_lock fs/locks.c:482 [inline]
     flock_to_posix_lock+0x595/0x690 fs/locks.c:515
     fcntl_setlk+0xf3/0xa90 fs/locks.c:2262
     do_fcntl+0x456/0xf60 fs/fcntl.c:387
     __do_sys_fcntl fs/fcntl.c:483 [inline]
     __se_sys_fcntl fs/fcntl.c:468 [inline]
     __x64_sys_fcntl+0x12d/0x180 fs/fcntl.c:468
     do_syscall_64+0xc8/0x5a0 arch/x86/entry/common.c:293
     entry_SYSCALL_64_after_hwframe+0x49/0xbe
    
    Fix it by parenthesizing 'l->l_len - 1'.
    Signed-off-by: NLuo Meng <luomeng12@huawei.com>
    Signed-off-by: NJeff Layton <jlayton@kernel.org>
    16238415
locks.c 79.9 KB