Commit 61182c7
committed
SUNRPC: kmap() the xdr pages during decode
If the pages are in HIGHMEM then we need to make sure they're mapped
before trying to read data off of them, otherwise we could end up with a
NULL pointer dereference.
The downside to this is that we need an extra cleanup step at the end of
decode to kunmap() the last page. I introduced an xdr_finish_decode()
function to do this. Right now this function only calls the
unmap_current_page() function, but other generic cleanup steps could be
added in the future if we come across anything else.
Reported-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>1 parent 303a780 commit 61182c7
4 files changed
Lines changed: 31 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
| |||
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
| 259 | + | |
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2602 | 2602 | | |
2603 | 2603 | | |
2604 | 2604 | | |
| 2605 | + | |
2605 | 2606 | | |
2606 | 2607 | | |
2607 | 2608 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1370 | 1370 | | |
1371 | 1371 | | |
1372 | 1372 | | |
| 1373 | + | |
| 1374 | + | |
1373 | 1375 | | |
1374 | 1376 | | |
1375 | 1377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1288 | 1288 | | |
1289 | 1289 | | |
1290 | 1290 | | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
1291 | 1299 | | |
1292 | 1300 | | |
1293 | 1301 | | |
| |||
1305 | 1313 | | |
1306 | 1314 | | |
1307 | 1315 | | |
| 1316 | + | |
1308 | 1317 | | |
1309 | 1318 | | |
1310 | 1319 | | |
1311 | 1320 | | |
1312 | 1321 | | |
1313 | | - | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
1314 | 1328 | | |
1315 | 1329 | | |
1316 | 1330 | | |
| |||
1364 | 1378 | | |
1365 | 1379 | | |
1366 | 1380 | | |
| 1381 | + | |
1367 | 1382 | | |
1368 | 1383 | | |
1369 | 1384 | | |
| |||
1396 | 1411 | | |
1397 | 1412 | | |
1398 | 1413 | | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
1399 | 1424 | | |
1400 | 1425 | | |
1401 | 1426 | | |
| |||
0 commit comments