sgan81 / apfs-fuse

FUSE driver for APFS (Apple File System)
GNU General Public License v2.0
1.74k stars 164 forks source link

Segmentation fault #179

Open montao opened 1 year ago

montao commented 1 year ago
$ sudo apfsutil /dev/sdb2 
Volume 1 9E890136-A96F-470A-8328-77AB43353FE6
---------------------------------------------
Role:               Backup
Name:               fivetb (Case-sensitive)
Capacity Consumed:  4726479761408 Bytes
FileVault:          Yes
Snapshots:
    100024 : 'com.apple.TimeMachine.2022-08-06-143031.backup'
    102106 : 'com.apple.TimeMachine.2022-08-13-185520.backup'
    105981 : 'com.apple.TimeMachine.2022-08-29-121105.backup'
    111010 : 'com.apple.TimeMachine.2022-09-14-214559.backup'
    127942 : 'com.apple.TimeMachine.2022-09-22-225350.backup'
    184927 : 'com.apple.TimeMachine.2022-10-04-091627.backup'
    232475 : 'com.apple.TimeMachine.2022-10-18-152529.backup'
...

After the "disk not ejected properly" stream of error messages the external hardware will not mount, regardless of the operating system trying to mount it. Since I am an Apple customer, I paid for a system that damaged by equipment and now I must work for free to guess how to solve the damage I paid for. It results in a segmentation fault which might be interesting to debug if it is some array out of bounds:


$ sudo apfs-fuse -d 4 -v 1 /dev/sdb2 /media/mac_apfs/
Volume fivetb is encrypted.
Hint: ...EsFo
Enter Password: 
Segmentation fault

$ sudo apfs-fuse -d 16 -o snap=102106 -v 1 -l /dev/sdb2 /media/mac_apfs/
starting LoadKeybag @ 9e0176
 all blocks verified
Volume fivetb is encrypted.
starting LoadKeybag @ 9e0175
 all blocks verified
Hint: ...EsFo
Enter Password: 
Dumping Keybag (keys)

Version : 0002
Keys    : 0002
Bytes   : 000000E0

Key 0:
UUID    : 9E890136-A96F-470A-8328-77AB43353FE6
Type    : 0003 [Keybag Ref]
Length  : 0010
Block   : 00000000009E0175
Count   : 0000000000000001

Key 1:
UUID    : 9E890136-A96F-470A-8328-77AB43353FE6
Type    : 0002 [VEK]
Length  : 007C
2000000000000010 007A
  8000000000000000 0001 : 00
  8000000000000001 0020 : B5BDBC7A3750F74B3727CAAE4F7E886A58DD6CC0AC14212687F57F299F597129
  8000000000000002 0008 : BECA2A902A11C83A
  A000000000000003 0049
    8000000000000000 0001 : 00
    8000000000000001 0010 : 9E890136A96F470A832877AB43353FE6
    8000000000000002 0008 : 0000000001001A5D
    8000000000000003 0028 : 262C1FD6CCAFD44B23EBCA7E1B4BA8EB7B311B41580FC11140BF31E9DC768C2FFBDEC4FF376BFA07

starting LoadKeybag @ 9E0175
 all blocks verified
Dumping Keybag (recs)

Version : 0002
Keys    : 0002
Bytes   : 000000E0

Key 0:
UUID    : 9E890136-A96F-470A-8328-77AB43353FE6
Type    : 0003 [KEK]
Length  : 0094
2000000000000010 0091
  8000000000000000 0001 : 00
  8000000000000001 0020 : 314FF83525D218E0309E35D52289917EFA852EAEE5D6BE38DFECC01C5E687A67
  8000000000000002 0008 : 34A873F50964694A
  A000000000000003 0060
    8000000000000000 0001 : 00
    8000000000000001 0010 : 9E890136A96F470A832877AB43353FE6
    8000000000000002 0008 : 0000000002001A5D
    8000000000000003 0028 : EA06BF89F50B84125A81133812DC882B4EE7EF04EFC88E19D5F637949908B34B0DCFB40C351860FC
    8000000000000004 0003 : 0186A0
    8000000000000005 0010 : BF3DDE7177F70B9B91BF409103591062

Key 1:
UUID    : 9E890136-A96F-470A-8328-77AB43353FE6
Type    : 0004 [Password Hint]
Length  : 0007

Segmentation fault