Commit d3b6372
committed
xen/gntalloc: don't use gnttab_query_foreign_access()
Using gnttab_query_foreign_access() is unsafe, as it is racy by design.
The use case in the gntalloc driver is not needed at all. While at it
replace the call of gnttab_end_foreign_access_ref() with a call of
gnttab_end_foreign_access(), which is what is really wanted there. In
case the grant wasn't used due to an allocation failure, just free the
grant via gnttab_free_grant_reference().
This is CVE-2022-23039 / part of XSA-396.
Reported-by: Demi Marie Obenour <demi@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
V3:
- fix __del_gref() (Jan Beulich)1 parent 33172ab commit d3b6372
1 file changed
Lines changed: 7 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | 172 | | |
181 | 173 | | |
182 | 174 | | |
183 | 175 | | |
184 | 176 | | |
185 | 177 | | |
| 178 | + | |
| 179 | + | |
186 | 180 | | |
187 | 181 | | |
188 | 182 | | |
| |||
196 | 190 | | |
197 | 191 | | |
198 | 192 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
206 | 198 | | |
207 | 199 | | |
208 | 200 | | |
209 | 201 | | |
210 | 202 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | 203 | | |
215 | 204 | | |
216 | 205 | | |
| |||
0 commit comments