Commit 43a15b5
Eugenio Grosso
flasharray: tighten NVMe-TCP EUI-128 validation
Address the 2026-08-04 Copilot follow-up:
- FlashArrayVolume.getAddress() now requires the serial to match exactly 24
hexadecimal characters instead of merely rejecting shorter ones. The previous
form sliced serial[0:24], so two distinct serials sharing a 24-character
prefix would have produced the same EUI-128 and therefore the same volume
identity. Non-hex serials are now rejected as well.
- FlashArrayAdapter.getVolumeByAddress() validates the FlashArray EUI-128
layout before reversing it into a serial: 32 hexadecimal characters, a 00
prefix, and the Pure Storage OUI at offset 16. Previously any 32-character
string was accepted and deterministically mapped onto a volume serial, so a
malformed or tampered address could resolve to an unintended volume.
Verified against a real FlashArray namespace: EUI
006c1b16ce1c034d24a9371c05ab334a passes both checks and round-trips to serial
6C1B16CE1C034D1C05AB334A and back unchanged.
Signed-off-by: Eugenio Grosso <eugenio.grosso@gmail.com>1 parent ca9ca20 commit 43a15b5
2 files changed
Lines changed: 31 additions & 8 deletions
File tree
- plugins/storage/volume/flasharray/src/main/java/org/apache/cloudstack/storage/datastore/adapter/flasharray
Lines changed: 19 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
| |||
353 | 357 | | |
354 | 358 | | |
355 | 359 | | |
356 | | - | |
| 360 | + | |
357 | 361 | | |
358 | | - | |
| 362 | + | |
359 | 363 | | |
360 | 364 | | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
361 | 378 | | |
362 | 379 | | |
363 | 380 | | |
| |||
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
116 | 121 | | |
117 | 122 | | |
118 | 123 | | |
119 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
120 | 129 | | |
121 | | - | |
122 | | - | |
| 130 | + | |
| 131 | + | |
123 | 132 | | |
124 | 133 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | 134 | | |
129 | 135 | | |
130 | 136 | | |
| |||
0 commit comments