Repository navigation
Commit 0f05406
qed: Fix use after free in qed_chain_free
commit 8063f76 upstream.
The qed_chain data structure was modified in
commit 1a4a697 ("qed: Chain support for external PBL") to support
receiving an external pbl (due to iWARP FW requirements).
The pages pointed to by the pbl are allocated in qed_chain_alloc
and their virtual address are stored in an virtual addresses array to
enable accessing and freeing the data. The physical addresses however
weren't stored and were accessed directly from the external-pbl
during free.
Destroy-qp flow, leads to freeing the external pbl before the chain is
freed, when the chain is freed it tries accessing the already freed
external pbl, leading to a use-after-free. Therefore we need to store
the physical addresses in additional to the virtual addresses in a
new data structure.
Fixes: 1a4a697 ("qed: Chain support for external PBL")
Signed-off-by: Michal Kalderon <mkalderon@marvell.com>
Signed-off-by: Yuval Bason <ybason@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 9779f8d commit 0f05406
2 files changed
Lines changed: 31 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4691 | 4691 | | |
4692 | 4692 | | |
4693 | 4693 | | |
4694 | | - | |
| 4694 | + | |
4695 | 4695 | | |
4696 | | - | |
4697 | 4696 | | |
4698 | | - | |
| 4697 | + | |
4699 | 4698 | | |
4700 | 4699 | | |
4701 | | - | |
4702 | | - | |
4703 | | - | |
4704 | 4700 | | |
4705 | | - | |
| 4701 | + | |
4706 | 4702 | | |
4707 | 4703 | | |
4708 | 4704 | | |
4709 | 4705 | | |
4710 | | - | |
4711 | | - | |
4712 | | - | |
4713 | | - | |
| 4706 | + | |
| 4707 | + | |
4714 | 4708 | | |
4715 | 4709 | | |
4716 | 4710 | | |
| |||
4720 | 4714 | | |
4721 | 4715 | | |
4722 | 4716 | | |
4723 | | - | |
4724 | | - | |
4725 | | - | |
| 4717 | + | |
| 4718 | + | |
| 4719 | + | |
4726 | 4720 | | |
4727 | 4721 | | |
4728 | 4722 | | |
| |||
4823 | 4817 | | |
4824 | 4818 | | |
4825 | 4819 | | |
4826 | | - | |
| 4820 | + | |
4827 | 4821 | | |
4828 | 4822 | | |
4829 | 4823 | | |
4830 | | - | |
4831 | | - | |
4832 | | - | |
| 4824 | + | |
| 4825 | + | |
| 4826 | + | |
4833 | 4827 | | |
4834 | 4828 | | |
4835 | 4829 | | |
4836 | 4830 | | |
4837 | 4831 | | |
4838 | | - | |
| 4832 | + | |
4839 | 4833 | | |
4840 | 4834 | | |
4841 | 4835 | | |
| |||
4849 | 4843 | | |
4850 | 4844 | | |
4851 | 4845 | | |
4852 | | - | |
4853 | | - | |
| 4846 | + | |
4854 | 4847 | | |
4855 | 4848 | | |
4856 | 4849 | | |
| |||
4869 | 4862 | | |
4870 | 4863 | | |
4871 | 4864 | | |
4872 | | - | |
| 4865 | + | |
| 4866 | + | |
4873 | 4867 | | |
4874 | 4868 | | |
4875 | 4869 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
| |||
107 | 112 | | |
108 | 113 | | |
109 | 114 | | |
110 | | - | |
111 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
112 | 118 | | |
113 | | - | |
| 119 | + | |
114 | 120 | | |
115 | 121 | | |
116 | 122 | | |
| |||
287 | 293 | | |
288 | 294 | | |
289 | 295 | | |
290 | | - | |
| 296 | + | |
291 | 297 | | |
292 | 298 | | |
293 | 299 | | |
| |||
537 | 543 | | |
538 | 544 | | |
539 | 545 | | |
540 | | - | |
| 546 | + | |
541 | 547 | | |
542 | 548 | | |
543 | 549 | | |
| |||
575 | 581 | | |
576 | 582 | | |
577 | 583 | | |
578 | | - | |
| 584 | + | |
579 | 585 | | |
580 | 586 | | |
581 | 587 | | |
582 | | - | |
| 588 | + | |
583 | 589 | | |
584 | 590 | | |
585 | 591 | | |
| |||
644 | 650 | | |
645 | 651 | | |
646 | 652 | | |
647 | | - | |
| 653 | + | |
648 | 654 | | |
649 | 655 | | |
650 | 656 | | |
| |||
716 | 722 | | |
717 | 723 | | |
718 | 724 | | |
719 | | - | |
| 725 | + | |
720 | 726 | | |
721 | 727 | | |
722 | 728 | | |
| |||
0 commit comments