Repository navigation
Commit af5eb74
NTFS: Fix invalid pointer dereference in ntfs_mft_record_alloc().
In ntfs_mft_record_alloc() when mapping the new extent mft record with
map_extent_mft_record() we overwrite @m with the return value and on
error, we then try to use the old @m but that is no longer there as @m
now contains an error code instead so we crash when dereferencing the
error code as if it were a pointer.
The simple fix is to use a temporary variable to store the return value
thus preserving the original @m for later use. This is a backport from
the commercial Tuxera-NTFS driver and is well tested...
Thanks go to Julia Lawall for pointing this out (whilst I had fixed it
in the commercial driver I had failed to fix it in the Linux kernel).
Signed-off-by: Anton Altaparmakov <anton@tuxera.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent 9fbf0c0 commit af5eb74
2 files changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
| 463 | + | |
| 464 | + | |
463 | 465 | | |
464 | 466 | | |
465 | 467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
2576 | 2576 | | |
2577 | 2577 | | |
2578 | 2578 | | |
| 2579 | + | |
| 2580 | + | |
2579 | 2581 | | |
2580 | 2582 | | |
2581 | 2583 | | |
| |||
2588 | 2590 | | |
2589 | 2591 | | |
2590 | 2592 | | |
2591 | | - | |
2592 | | - | |
| 2593 | + | |
| 2594 | + | |
2593 | 2595 | | |
2594 | 2596 | | |
2595 | | - | |
| 2597 | + | |
2596 | 2598 | | |
2597 | 2599 | | |
2598 | 2600 | | |
| |||
2603 | 2605 | | |
2604 | 2606 | | |
2605 | 2607 | | |
| 2608 | + | |
2606 | 2609 | | |
2607 | 2610 | | |
2608 | 2611 | | |
| |||
0 commit comments