Commit 2c74e0a
dstack-util: bound LUKS2 keyslot area to the metadata region
The in-memory header validator pinned the cipher/KDF shape but never
checked the keyslot area.offset/size — the byte range the encrypted key
material is read from. A host with raw disk access could redirect it
inside an otherwise-conforming header.
cryptsetup's digest check already stops this from yielding a usable key,
so it isn't exploitable on its own, but the validator shouldn't accept a
header pointing its key material somewhere arbitrary. Bound the area to
[2 * hdr_size, PAYLOAD_OFFSET) and reject anything outside it.
Also note why salts stay unchecked (high-entropy KMS-derived passphrase,
per #552) so the gap doesn't read as an oversight next time.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 9bf8767 commit 2c74e0a
1 file changed
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2946 | 2946 | | |
2947 | 2947 | | |
2948 | 2948 | | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
2949 | 2959 | | |
2950 | 2960 | | |
2951 | 2961 | | |
| |||
2956 | 2966 | | |
2957 | 2967 | | |
2958 | 2968 | | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
2959 | 2972 | | |
2960 | 2973 | | |
2961 | 2974 | | |
| |||
3046 | 3059 | | |
3047 | 3060 | | |
3048 | 3061 | | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
| 3072 | + | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
3049 | 3086 | | |
3050 | 3087 | | |
3051 | 3088 | | |
| |||
0 commit comments