Commit f11a74b
committed
efi: efivars: Fix variable writes with unsupported query_variable_store()
Commit 8a254d9 ("efi: efivars: Fix variable writes without
query_variable_store()") addressed an issue that was introduced during
the EFI variable store refactor, where alternative implementations of
the efivars layer that lacked query_variable_store() would no longer
work.
Unfortunately, there is another case to consider here, which was missed:
if the efivars layer is backed by the EFI runtime services as usual, but
the EFI implementation predates the introduction of QueryVariableInfo(),
we will return EFI_UNSUPPORTED, and this is no longer being dealt with
correctly.
So let's fix this, and while at it, clean up the code a bit, by merging
the check_var_size() routines as well as their callers.
Cc: <[email protected]> # v6.0
Fixes: bbc6d2c ("efi: vars: Switch to new wrapper layer")
Signed-off-by: Ard Biesheuvel <[email protected]>
Tested-by: Aditya Garg <[email protected]>1 parent 7d866e3 commit f11a74b
1 file changed
+20
-48
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 24 | + | |
| 25 | + | |
38 | 26 | | |
39 | 27 | | |
| 28 | + | |
40 | 29 | | |
41 | 30 | | |
42 | 31 | | |
43 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
44 | 38 | | |
45 | | - | |
46 | | - | |
| 39 | + | |
47 | 40 | | |
48 | 41 | | |
49 | 42 | | |
| |||
195 | 188 | | |
196 | 189 | | |
197 | 190 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | 191 | | |
219 | 192 | | |
220 | 193 | | |
| |||
228 | 201 | | |
229 | 202 | | |
230 | 203 | | |
231 | | - | |
232 | | - | |
233 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
234 | 210 | | |
235 | 211 | | |
236 | 212 | | |
237 | 213 | | |
238 | 214 | | |
239 | | - | |
240 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
241 | 218 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | 219 | | |
249 | 220 | | |
250 | 221 | | |
| |||
264 | 235 | | |
265 | 236 | | |
266 | 237 | | |
267 | | - | |
| 238 | + | |
| 239 | + | |
268 | 240 | | |
269 | 241 | | |
270 | 242 | | |
| |||
0 commit comments