Commit 2f2d6fd
committed
bnxt: prevent skb UAF after handing over to PTP worker
jira VULN-8012
cve CVE-2022-48637
commit-author Jakub Kicinski <kuba@kernel.org>
commit c31f26c
When reading the timestamp is required bnxt_tx_int() hands
over the ownership of the completed skb to the PTP worker.
The skb should not be used afterwards, as the worker may
run before the rest of our code and free the skb, leading
to a use-after-free.
Since dev_kfree_skb_any() accepts NULL make the loss of
ownership more obvious and set skb to NULL.
Fixes: 83bb623 ("bnxt_en: Transmit and retrieve packet timestamps")
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/20220921201005.335390-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit c31f26c)
Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>1 parent 39feb83 commit 2f2d6fd
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
659 | 659 | | |
660 | 660 | | |
661 | 661 | | |
662 | | - | |
663 | 662 | | |
664 | 663 | | |
665 | 664 | | |
| |||
668 | 667 | | |
669 | 668 | | |
670 | 669 | | |
| 670 | + | |
| 671 | + | |
671 | 672 | | |
672 | 673 | | |
673 | 674 | | |
| |||
688 | 689 | | |
689 | 690 | | |
690 | 691 | | |
| 692 | + | |
691 | 693 | | |
692 | | - | |
| 694 | + | |
693 | 695 | | |
694 | 696 | | |
695 | 697 | | |
| |||
698 | 700 | | |
699 | 701 | | |
700 | 702 | | |
701 | | - | |
702 | | - | |
703 | | - | |
| 703 | + | |
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
| |||
0 commit comments