Kees Cook, ish-udhëheqësi i ekipit të sigurisë Ubuntu dhe ish-administrator kryesor i sistemit kernel.org, demonstroi mundësinë e krijimit të një komiti, identifikuesi i shkurtuar i të cilit përputhet me komitin, që ishte shtuar më parë në bërthamën Linux. Eksperimenti u krye si një konfirmim i vlefshmërisë së kalimit në identifikuesit e shkurtuar 16-shifrorë për komitetet në bërthamën Linux, që ishte diskutuar më parë në listën e postimeve të zhvilluesve, por nuk ishte miratuar nga Linus Torvalds.
Identifikuesit e shkurtuar të komiteteve formohen duke lënë 12 karakteret e para nga hash-i SHA-1 (48 bit nga 160 bit). Meqë numri i objekteve në bërthamë, që identifikohen përmes hash-it SHA-1, ka tejkaluar 13 milionë, ngjarja e kolizionit gjatë përdorimit të prefiksit 12-shifror ka qenë çështje kohe. Si shembuj janë treguar objekte tashmë të shtuar në bërthamë me identifikues të përbashkët me 11 karaktere. Për më tepër, u përmend se ishte regjistruar një rimbushje e identifikuesve 12-shifrorë në tetor, por gjatë dërgimit të patch-it u identifikua nga utilitarja checkpatch.
Identifikuesit e shkurtuar pĂ«rdoren pĂ«r publikimin e lidhjeve tĂ« shkurtra pĂ«r komitetet, si dhe janĂ« tĂ« dhĂ«na gjatĂ« dĂ«rgimit tĂ« ndryshimeve nĂ« etiketĂ«n âFixesâ, si njĂ« lidhje me komitin, problemi nĂ« tĂ« cilin u rregullua nĂ« patch-in e dĂ«rguar (pĂ«r shembull, âFixes: e21d2170f366â). Ngjarjet e kolizionit, ku disa ndryshime tĂ« ndryshme lidhen me njĂ« identifikues tĂ« shkurtuar, mund tĂ« çojnĂ« nĂ« probleme me mjetet pĂ«r analizĂ« dhe verifikim tĂ« ndryshimeve qĂ« marrin parasysh pĂ«rmbajtjen e etiketave âFixesâ. PĂ«r shembull, kĂ«to etiketa merren parasysh nĂ« pĂ«rpunuesin check_fixes, qĂ« aplikohet nĂ« degĂ«n linux-next, si dhe nĂ« skriptet e analizĂ«s sĂ« pĂ«rmirĂ«simeve pĂ«r ndjekjen e jetĂ«s sĂ« patch-ve.
Linus Torvalds was skeptical about the proposal to increase the minimum size of shortened identifiers, as the actual number of commits in the repository is significantly lower than the number of objects (about 1/8). Most likely, if random collisions occur, they will be between a commit and an object of some other type (for example, a blob or branch). In his opinion, shortened identifiers are shortened for the sake of being clear, readable, and easy to cite, and there are currently no objective reasons to increase their size.
One of the developers proposed to achieve size reduction by increasing the number of significant bits using a new format based on Base36 encoding (characters 0-9a-z) instead of hexadecimal digits. According to Linus, such a change would create more problems than it solves. For example, it would require adding support for the new format in existing utilities and introducing a format identifier to distinguish between the old and new formats.
To demonstrate that the issue with shortened identifiers is not theoretical and that its resolution should not be postponed, Kees Cook formed a documentation change for the kernel, whose shortened identifier (1da177e4c3f4) matched the commit ID for creating the kernel branch 2.6.12-rc2. The collision was found in 6 hours of computation on a system with an NVIDIA GeForce RTX 3080 GPU.
The matching was performed using the lucky-commit toolkit â random spaces were added to the target patch text until the 12-character SHA-1 prefix matched the existing commit prefixes in the kernel. In Kees's opinion, the problem lies not so much in random collisions but in the potential for manipulating shortened identifiers for malicious purposes, such as bypassing certain checks.
Burimi: opennet.ru
