[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3fdcb223-14c0-dd51-bbb8-d6f193482e87@linaro.org>
Date: Wed, 19 Apr 2023 10:27:19 +0200
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Anup Sharma <anupnewsmail@...il.com>, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
linma@....edu.cn, dvyukov@...gle.com
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: nfc: nci: fix for UBSAN: shift-out-of-bounds in
nci_activate_target
On 19/04/2023 03:16, Anup Sharma wrote:
> syzbot found UBSAN: shift-out-of-bounds in nci_activate_target [1],
> when nci_target->supported_protocols is bigger than UNIT_MAX,
> where supported_protocols is unsigned 32-bit interger type.
>
> 32 is the maximum allowed for supported_protocols. Added a check
> for it.
>
> [1] UBSAN: shift-out-of-bounds in net/nfc/nci/core.c:912:45
> shift exponent 4294967071 is too large for 32-bit type 'int'
> Call Trace:
> <TASK>
> __dump_stack lib/dump_stack.c:88 [inline]
> dump_stack_lvl+0x136/0x150 lib/dump_stack.c:106
> ubsan_epilogue lib/ubsan.c:217 [inline]
> __ubsan_handle_shift_out_of_bounds+0x221/0x5a0 lib/ubsan.c:387
> nci_activate_target.cold+0x1a/0x1f net/nfc/nci/core.c:912
> nfc_activate_target+0x1f8/0x4c0 net/nfc/core.c:420
> nfc_genl_activate_target+0x1f3/0x290 net/nfc/netlink.c:900
> genl_family_rcv_msg_doit.isra.0+0x1e6/0x2d0 net/netlink/genetlink.c:968
> genl_family_rcv_msg net/netlink/genetlink.c:1048 [inline]
>
> Reported-by: syzbot+0839b78e119aae1fec78@...kaller.appspotmail.com
> Link: https://syzkaller.appspot.com/bug?id=19cf2724120ef8c51c8d2566df0cc34617188433
>
> Signed-off-by: anupsharma <anupnewsmail@...il.com>
Also, no blank lines between tags.
Best regards,
Krzysztof
Powered by blists - more mailing lists