Skip to content

Commit d61d2a1

Browse files
net: mac802154: Fix general protection fault
jira VULN-78138 cve CVE-2021-33033 commit-author Pavel Skripkin <paskripkin@gmail.com> commit 1165aff upstream-diff While there are no merge conflicts, according to RedHat's Bugzilla[2], two patches are necessary to resolve the CVE. They are ad5d07f ("cipso,calipso: resolve a number of problems with the DOI refcounts") and 1165aff ("net: mac802154: Fix general protection fault"). The commit ad5d07f ("cipso,calipso: resolve a number of problems with the DOI refcounts") has been backported in cherry-picking commit 3686810. Therefore, the only missing patch is being backported to resolve the CVE. [2] https://bugzilla.redhat.com/show_bug.cgi?id=1961300 syzbot found general protection fault in crypto_destroy_tfm()[1]. It was caused by wrong clean up loop in llsec_key_alloc(). If one of the tfm array members is in IS_ERR() range it will cause general protection fault in clean up function [1]. Call Trace: crypto_free_aead include/crypto/aead.h:191 [inline] [1] llsec_key_alloc net/mac802154/llsec.c:156 [inline] mac802154_llsec_key_add+0x9e0/0xcc0 net/mac802154/llsec.c:249 ieee802154_add_llsec_key+0x56/0x80 net/mac802154/cfg.c:338 rdev_add_llsec_key net/ieee802154/rdev-ops.h:260 [inline] nl802154_add_llsec_key+0x3d3/0x560 net/ieee802154/nl802154.c:1584 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:739 genl_family_rcv_msg net/netlink/genetlink.c:783 [inline] genl_rcv_msg+0x328/0x580 net/netlink/genetlink.c:800 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2502 genl_rcv+0x24/0x40 net/netlink/genetlink.c:811 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1927 sock_sendmsg_nosec net/socket.c:654 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:674 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2350 ___sys_sendmsg+0xf3/0x170 net/socket.c:2404 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2433 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Signed-off-by: Pavel Skripkin <paskripkin@gmail.com> Reported-by: syzbot+9ec037722d2603a9f52e@syzkaller.appspotmail.com Acked-by: Alexander Aring <aahringo@redhat.com> Link: https://lore.kernel.org/r/20210304152125.1052825-1-paskripkin@gmail.com Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org> (cherry picked from commit 1165aff) Signed-off-by: Pratham Patel <ppatel@ciq.com>
1 parent a827da9 commit d61d2a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/mac802154/llsec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ llsec_key_alloc(const struct ieee802154_llsec_key *template)
158158
crypto_free_blkcipher(key->tfm0);
159159
err_tfm:
160160
for (i = 0; i < ARRAY_SIZE(key->tfm); i++)
161-
if (key->tfm[i])
161+
if (!IS_ERR_OR_NULL(key->tfm[i]))
162162
crypto_free_aead(key->tfm[i]);
163163

164164
kzfree(key);

0 commit comments

Comments
 (0)