Commit 3fb4601
crypto: qat - Fix ADF_DEV_RESET_SYNC memory leak
commit d3b17c6 upstream.
Using completion_done to determine whether the caller has gone
away only works after a complete call. Furthermore it's still
possible that the caller has not yet called wait_for_completion,
resulting in another potential UAF.
Fix this by making the caller use cancel_work_sync and then freeing
the memory safely.
Fixes: 7d42e09 ("crypto: qat - resolve race condition during AER recovery")
Cc: <stable@vger.kernel.org> starfive-tech#6.8+
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 8287a9d commit 3fb4601
1 file changed
+5
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
| 98 | + | |
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
106 | 105 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 106 | + | |
| 107 | + | |
117 | 108 | | |
118 | 109 | | |
119 | 110 | | |
| |||
148 | 139 | | |
149 | 140 | | |
150 | 141 | | |
| 142 | + | |
151 | 143 | | |
152 | | - | |
153 | | - | |
154 | 144 | | |
| 145 | + | |
155 | 146 | | |
156 | 147 | | |
157 | 148 | | |
| |||
0 commit comments