From 2b51125dd97d38ca02f5507ba4117f73e9c9aa7d Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Sun, 4 Feb 2024 11:10:11 +0900 Subject: [PATCH] ext2: add support to various inode sizes the script used for generating test inputs: for bsize in 1024 2048 4096; do for isize in 128 256 512 1024; do f=tests/files/bsize-${bsize}-isize-${isize}.ext2 dd if=/dev/zero of=$f bs=${bsize} count=128 mkfs.ext2 -I ${isize} -b ${bsize} $f mkdir -p __tmp__ sudo mount $f __tmp__ echo hello | sudo dd if=/dev/stdin of=__tmp__/source (cd __tmp__/; sudo ln -s source target) sudo umount __tmp__ done done Signed-off-by: Masatake YAMATO --- hachoir/parser/file_system/ext2.py | 10 ++++++++-- tests/files/bsize-1024-isize-1024.ext2 | Bin 0 -> 131072 bytes tests/files/bsize-1024-isize-128.ext2 | Bin 0 -> 131072 bytes tests/files/bsize-1024-isize-256.ext2 | Bin 0 -> 131072 bytes tests/files/bsize-1024-isize-512.ext2 | Bin 0 -> 131072 bytes tests/files/bsize-2048-isize-1024.ext2 | Bin 0 -> 262144 bytes tests/files/bsize-2048-isize-128.ext2 | Bin 0 -> 262144 bytes tests/files/bsize-2048-isize-256.ext2 | Bin 0 -> 262144 bytes tests/files/bsize-2048-isize-512.ext2 | Bin 0 -> 262144 bytes tests/files/bsize-4096-isize-1024.ext2 | Bin 0 -> 524288 bytes tests/files/bsize-4096-isize-128.ext2 | Bin 0 -> 524288 bytes tests/files/bsize-4096-isize-256.ext2 | Bin 0 -> 524288 bytes tests/files/bsize-4096-isize-512.ext2 | Bin 0 -> 524288 bytes tests/test_parser.py | 10 ++++++++++ 14 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tests/files/bsize-1024-isize-1024.ext2 create mode 100644 tests/files/bsize-1024-isize-128.ext2 create mode 100644 tests/files/bsize-1024-isize-256.ext2 create mode 100644 tests/files/bsize-1024-isize-512.ext2 create mode 100644 tests/files/bsize-2048-isize-1024.ext2 create mode 100644 tests/files/bsize-2048-isize-128.ext2 create mode 100644 tests/files/bsize-2048-isize-256.ext2 create mode 100644 tests/files/bsize-2048-isize-512.ext2 create mode 100644 tests/files/bsize-4096-isize-1024.ext2 create mode 100644 tests/files/bsize-4096-isize-128.ext2 create mode 100644 tests/files/bsize-4096-isize-256.ext2 create mode 100644 tests/files/bsize-4096-isize-512.ext2 diff --git a/hachoir/parser/file_system/ext2.py b/hachoir/parser/file_system/ext2.py index bd607fb4..44db6485 100644 --- a/hachoir/parser/file_system/ext2.py +++ b/hachoir/parser/file_system/ext2.py @@ -201,10 +201,13 @@ class Inode(FieldSet): 7: "Reserved group descriptors", 8: "EXT3 journal" } - static_size = (68 + 15 * 4) * 8 def __init__(self, parent, name, index): FieldSet.__init__(self, parent, name, None) + inode_size = self["/superblock/inode_size"].value + if inode_size == 0: + inode_size = 128 + self._size = inode_size * 8 self.uniq_id = 1 + index def createDescription(self): @@ -751,7 +754,10 @@ def validate(self): return "Invalid magic number" if not (0 <= self["superblock/log_block_size"].value <= 2): return "Invalid (log) block size" - if self["superblock/inode_size"].value not in (0, 128): + blocksize = (1 << 10) << self["superblock/log_block_size"].value + acceptable_inode_sizes = (s for s in [0, 128, 256, 512, 1024, 2048, 4096] + if s <= blocksize) + if self["superblock/inode_size"].value not in acceptable_inode_sizes: return "Unsupported inode size" return True diff --git a/tests/files/bsize-1024-isize-1024.ext2 b/tests/files/bsize-1024-isize-1024.ext2 new file mode 100644 index 0000000000000000000000000000000000000000..c402fe4789b6859aaa5479981ce9e2e44ee154c3 GIT binary patch literal 131072 zcmeI)zi%5=902gM6H*ZhDpD!oXIvy$5Os$NP+;i*3la-!CCg3SCY9r>9J?xAT9*D3 zU7+GGfJ)s^hYm3DV_;!KAk+#qLnS1Z@O^eJP8?OTj54J6dD1s`@7=rez0ch@mY>ef zGKBzvvI-oDfnSf9i#QW86H$rSF11*TNd3Ou_^x$3qLOWHe)h03=$G1J)1ValJ(Fs) zS@wP`suAg!$G`c#xpC+8y*pn%|JS?6e)uSwc9r@{z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*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs o0RjXF5FkK+009C72oNAZfB*pkdjwWm?RGxDr&$950woam4_{BQ#sB~S literal 0 HcmV?d00001 diff --git a/tests/files/bsize-1024-isize-128.ext2 b/tests/files/bsize-1024-isize-128.ext2 new file mode 100644 index 0000000000000000000000000000000000000000..79cf6b681abf31e727edf9a33cd478ad5ac2e3ac GIT binary patch literal 131072 zcmeI$zi%5=8~||p5|T72P)dhN9g2jIkPvkyRAmFHVuFQ@#d1@ZxN>}zV-pxqLnkH} zSXq$B!pI+hI+U#gQl-*`f1pxT2G+`aUmT~28%xLsfs;Q^`sVJvyL&%A_ue^om5M}w zz^n?KiGlA#EJU;-<|3*Q2kEugi%94F^vBQ56xGUL@X?d%-gzk>hxXFwx|PW7L|l%@ zB2u02ZQpyia`wYFZ~y-B+uwEXyc0!7Qf(vOY}P(+Y&Lp%?bAlLw$WJM$Xnf7z24ir zS+5^CdCJW8_BVHbT)OhXSNG??esE#&Y3lFk{kjg1W6J7}y=-JMesFobpyc_*lJ|dB zyPwwPe8dY8tyrnqUT#)3jGMr02@D1=A0F_p1Bn2E*%7!nJ3}>60tAii@m++{_K8xW%t&EO9$UiZvXJ}cPsCA*AKq*PN-}`@h|V+e|=K>6E0DF zLIUX?pRQE1OR*j9XW6C5q&a@BvYfT^t=?PL^M2>raL%8pEL2BxAQ+>=k%LEaRKYUxS<*dlvTj`FYBGtZvw>ytpDPMY9LTn0qei4cTT?v6c@1m ziyNweKv@N>|FYgW{U%Uc!1^z4s0IQA2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C7PF!H4*>2~{C*G_E2@oJafB=F2R3LklMf=r= z-)`Ps8Sl#C!o#^#_QwA4t!BH`>3=qUnmhpl|098ZXFcy+Z*`j2>ixC+>W$`luijnj SciN4s&2|*_*0xqtcmD!qRDAaU literal 0 HcmV?d00001 diff --git a/tests/files/bsize-1024-isize-256.ext2 b/tests/files/bsize-1024-isize-256.ext2 new file mode 100644 index 0000000000000000000000000000000000000000..72b90cf9e2b50b2c8ad0a2ec7667d29870f9cd49 GIT binary patch literal 131072 zcmeI&&ub%P7y#f&TDw?Rty*OfWOMQ4ve|ulgk?qc;K}%Y%}&##7HYLZnCFAHGvCaY$-K|ZJDFsfWf}nj zWffS9#CIcBB03RE5tWF8R*SiaH13<y`a`u(Z6i%5d8h9}la{7u_5HRM+ur@-_ZL#E?Oa+vi{Bw8S@=tU0D)P7 z-P_T>vbWH*GbPy9*=k;;>n2gT6 zt-1aDC*3<&-`P2Cd@WYId+FN?MWp>m^V9LwU(c<)yx)EC;le??yVV z@7>tywXZiu8~Nr3?bfi--x&3}&CP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001 diff --git a/tests/files/bsize-2048-isize-128.ext2 b/tests/files/bsize-2048-isize-128.ext2 new file mode 100644 index 0000000000000000000000000000000000000000..26855e6e887af44ce3e7d079444326a9763ec737 GIT binary patch literal 262144 zcmeI*y>Am|7y$6IQ^i1`4IvBaK$cFGaK|bW43%I;9g*tS(AkYiV^DxpxZv2-W{ zV=JbL5g~N|F)%YBrGEnwf}v7}3Yq6k;(QS=cBwe{J<=23d-nU0pU?MR{8~WhEO7E7WqYF zHF7HQ-`@I9{rt=GcYeM7$%F4^PsXl2QEwM3t@@A6m1eJ~f8XrZ+s&nRvD~dU8oiY( zjmDk_k6HNY_xmrO*3VtNe(%PUf39ACoW^@}tF7I?$C%9@SZ!#s|IXR{J4#+o$B!tV z!0`3?K@2^QSAR82TY>-q0t5&Uc$WnRgLHMi69Ykj009C72)z3Or?PlAPY@tLfB*pk z?~}mrFaP1%-kVwn8}_sR_SxCkb7*I6ai{;O?UjhMMqzzvznt=aA+UBWTKRfr{`KR( zvVHuG+t0`2R#fkQ6L^@;KW7d)|5UU2U8AVQcATcN!;wcK(`OvgX9tc&eiS)w+>YZf zo!bsN{!)J_()sWB#@2X0=5GCRb7n-?CP{{OqSIscbp@CHeM009C72#hZ< zTxc4<1vLo}AV7csfwBph|I7A_87~0>1PBnAT)_N4xuF&a5FkK+K-mP$|7Cl|jF$ib z0t5(5E@1wj+)xVy2oNAZplkx>|FS(}#!G+z0RjXj7cl=%Zm0zU1PBlyK!5-N0t5&U zAn;ZTRG+5r{i{T-U->zG9nhYrP5+g?`a1hGGTp!0>MZB|AND*(fdByl1PBm#I|Taq zQjuR?&Rdrn{e@!j+tyOA(Ou~0o#tYz6FYkgtDmQlwp*P}k^Z5DAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009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F5FkK+009C72oN|>;1#0dbo>AS literal 0 HcmV?d00001 diff --git a/tests/files/bsize-2048-isize-256.ext2 b/tests/files/bsize-2048-isize-256.ext2 new file mode 100644 index 0000000000000000000000000000000000000000..7058ab7bc4a82493fb48dc85bb7f20a2092d2c65 GIT binary patch literal 262144 zcmeI*zi%5=902gMgKQ`TLIDXF$PI;oN;LyQC{xSC4qFG~rY=e4A1JXAY^}Off|UVf z0wE^GG9e+5`X3Fay%emuYTvF_gG-bu+ai2#Aq zDv(FVZ${K2x)IMrq*OVG>{4VR@>qQP`}ge>m25P6=eNrKK6j%WoAy&WCZ)&IM-<+S zMKxk2;`5c~?wq^w_Rn9x``NwcZ@lnJteQ!U&3?Dt__)<=4f>4_TicDz*2ZRkYrD~G z4!R#Sn=?BvSonMQleO>uy1aJ#%HE%^tnHmo?LB)?*Zuuiu=+!X<)K!X%x^q5zv7se zA3f&nKdsF#&d)~zpc`j@HA^{(009C72oN~Q0;5rVrh6la009C72oN~=0&7`3&65Za zAV7csfzu>V{PCaWzltcys5+FceR^aBXD8ILw7uWvj^`|nq{>>h7^wQHu*fpQqXZrnf8x#o;c<2H@ zr2C&sS$6pRuV(pu-}YGK&qSnmyV5&TPeeQ!@l?cW#G)ymJMjNL|G$dsUwZfL@crNP z`j_ti{>%GX!#8So=ejv5=8^mKt#4i`BDEvsCp%=-y?X8S{o>09D|gzRt={mX=`R10 z8}>H(z3W@O_O<44y?^yadt=btULW>4t*h-$tQ@TGyp|3deevM_7uBZz@AQY;8Z`=o`{-^S^=5qT#{T?|21PBlyK!5-N0t5&UAV7cs0Rksa zAU)eVn^me8V>!-Os~4k?p7TDNovC*EJA(_?`@`O~@pIqRtX3(W1*T`f_v*F!ptb#e zdk_VQ009C72oN|H0^|AI>G=OgeLVgji^gjt0RjXF5FoI)Kv^%hFWw?Y5+Fc;009DJ z3mE^)7FIt20t5&USUv&c|MLANT10>V0RjZd7BK#oEv$Y51PBlyuzUi>|K7Vz`_wM8U-dXQ*AI>s~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k1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U nAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5;&BPH-R+$X4I literal 0 HcmV?d00001 diff --git a/tests/files/bsize-4096-isize-1024.ext2 b/tests/files/bsize-4096-isize-1024.ext2 new file mode 100644 index 0000000000000000000000000000000000000000..c4956cab84d7400614d92bdc95798338347cc3bc GIT binary patch literal 524288 zcmeI*&5K(_008jGt0bkZbPsFQdN7EBpfsgju};Y3fU-bzql2`S}cF|=a>2CF_yw$@Y)}xP#V?6WILpC3dhr* zheEgzlQhne7(clAcmKQJU%q+cogbch{fkeQW7Slstrwel?OJ2A(JN|iH#)WTMsvN` z=+x@<-sY8heX8-Ch32mfjZ009C72oNAZfB*pk z1SSIG&;HZ%uj4qblM*1X*aE-37}vKndA2`2-#=XOk#Kah^z@9-K|SAHjbs0G`g$eB z-Zv}19>jC_qh&}45FkK+009C72oNAZfB*pk1PDBE0$cCJCEr@x{%+6d>;I+yuK&%8 z^7u^0^nIJNp*mCH`rizQA^`#f2oNAZfB*pk1PBng3j(*&{Xc8N`+uhQ|5>Q+82^!& zKNaJnF+R4Ve!to3%mDWPGa!lt4p87my#AMd`zPJ^H;%)9H@W_o?*BWzk2$>h)sHXi z*1Z~Ec=x5{Y#h@ZQhw4t`=wG|Nk1VJo*7kk^VUYYe|6GCjsSrvfquJLv@dV8^Go&q zYH{(cyxFUFR{QN%<6_>5mA%#O+0my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BlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N T0t5&UAV7cs0RjXF3@z{rL|b7e literal 0 HcmV?d00001 diff --git a/tests/files/bsize-4096-isize-256.ext2 b/tests/files/bsize-4096-isize-256.ext2 new file mode 100644 index 0000000000000000000000000000000000000000..cba6cc9f49134c043d088358b2e75ec5cafd5a36 GIT binary patch literal 524288 z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FkK+009C72oNAZfB*pk1PBly xK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0tEJ_z&}GXl*j-8 literal 0 HcmV?d00001 diff --git a/tests/test_parser.py b/tests/test_parser.py index 11278b6e..db15f582 100755 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -348,6 +348,16 @@ def test_ext2_variety_inode_types(self): self.checkDesc(parser, "/group[0]/inode_table/inode[12]", "Inode 13: Symbolic link (-> XYZ), size=3 bytes, mode=lrwxrwxrwx") + def test_ext2_various_inode_sizes(self): + for bsize in [1024, 2048, 4096]: + for isize in [128, 256, 512, 1024]: + fname = "bsize-%d-isize-%d.ext2" % (bsize, isize) + parser = self.parse(fname) + self.checkValue(parser, "/superblock/inode_size", isize) + self.checkValue(parser, "/group[0]/inode_table/inode[11]/size", 6) + self.checkDesc(parser, "/group[0]/inode_table/inode[12]", + "Inode 13: Symbolic link (-> source), size=6 bytes, mode=lrwxrwxrwx") + def test_bmp2(self): parser = self.parse("article01.bmp") self.checkDisplay(parser, "/header/red_mask", '0x00ff0000')