diff options
author | Colin Ian King <colin.king@canonical.com> | 2021-06-24 20:57:18 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-07-02 02:05:59 +0200 |
commit | 4ca041f919f13783b0b03894783deee00dbca19a (patch) | |
tree | e9a125b3be4a52f7bdb936c4d0f2c00ca52a485a /net/netfilter/nf_conntrack_proto_gre.c | |
parent | e15d4cdf27cb0c1e977270270b2cea12e0955edd (diff) | |
download | linux-4ca041f919f13783b0b03894783deee00dbca19a.tar.bz2 |
netfilter: nf_tables: Fix dereference of null pointer flow
In the case where chain->flags & NFT_CHAIN_HW_OFFLOAD is false then
nft_flow_rule_create is not called and flow is NULL. The subsequent
error handling execution via label err_destroy_flow_rule will lead
to a null pointer dereference on flow when calling nft_flow_rule_destroy.
Since the error path to err_destroy_flow_rule has to cater for null
and non-null flows, only call nft_flow_rule_destroy if flow is non-null
to fix this issue.
Addresses-Coverity: ("Explicity null dereference")
Fixes: 3c5e44622011 ("netfilter: nf_tables: memleak in hw offload abort path")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nf_conntrack_proto_gre.c')
0 files changed, 0 insertions, 0 deletions