]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
macsec: fix NULL deref in macsec_add_rxsa
authorSabrina Dubroca <sd@queasysnail.net>
Fri, 22 Jul 2022 09:16:27 +0000 (11:16 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 16 Sep 2022 08:53:44 +0000 (10:53 +0200)
commit254e2f10c951991063364d5c2a72a5e881766208
tree46cc366d358883d8dede762b9cc14707f9443d9f
parent637216ecf08e87dcf9b3a79be425831ebd07e7ce
macsec: fix NULL deref in macsec_add_rxsa

BugLink: https://bugs.launchpad.net/bugs/1989218
[ Upstream commit f46040eeaf2e523a4096199fd93a11e794818009 ]

Commit 48ef50fa866a added a test on tb_sa[MACSEC_SA_ATTR_PN], but
nothing guarantees that it's not NULL at this point. The same code was
added to macsec_add_txsa, but there it's not a problem because
validate_add_txsa checks that the MACSEC_SA_ATTR_PN attribute is
present.

Note: it's not possible to reproduce with iproute, because iproute
doesn't allow creating an SA without specifying the PN.

Fixes: 48ef50fa866a ("macsec: Netlink support of XPN cipher suites (IEEE 802.1AEbw)")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=208315
Reported-by: Frantisek Sumsal <fsumsal@redhat.com>
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/macsec.c