<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:40:13 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-4161] e2image -I has malloc corruption in write_bitmaps</title>
                <link>https://jira.whamcloud.com/browse/LU-4161</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;For &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-3542&quot; title=&quot;deleted/unused inodes not actually cleared by e2fsck&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-3542&quot;&gt;&lt;del&gt;LU-3542&lt;/del&gt;&lt;/a&gt; I was trying to use e2image to get the sparse image of some OSTs, but was still having issues with the size of the files. I tried moving the sparse image to another machine and expanding it on a loopback device, but got malloc corruption when using -I. I tracked it down to a buffer overflow in write_bitmaps:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;...
		retval = io_channel_alloc_buf(fs-&amp;gt;io, 0, &amp;amp;block_buf);
		&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (retval)
			&lt;span class=&quot;code-keyword&quot;&gt;goto&lt;/span&gt; errout;
		memset(block_buf, 0xff, fs-&amp;gt;blocksize);
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Basically, the io-&amp;gt;block_size is 1024, so alloc_buf creates a 1k buffer but then memset writes out 4k. I changed it to:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;                retval = io_channel_alloc_buf(fs-&amp;gt;io, fs-&amp;gt;blocksize / fs-&amp;gt;io-&amp;gt;block_size, &amp;amp;block_buf);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;e2image -I still doesn&apos;t work for me for some reason, but it doesn&apos;t hit the malloc&lt;/p&gt;</description>
                <environment>Centos 5</environment>
        <key id="21676">LU-4161</key>
            <summary>e2image -I has malloc corruption in write_bitmaps</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="5" iconUrl="https://jira.whamcloud.com/images/icons/priorities/trivial.svg">Trivial</priority>
                        <status id="5" iconUrl="https://jira.whamcloud.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="niu">Niu Yawei</assignee>
                                    <reporter username="kitwestneat">Kit Westneat</reporter>
                        <labels>
                    </labels>
                <created>Mon, 28 Oct 2013 19:42:51 +0000</created>
                <updated>Mon, 10 Feb 2014 02:35:20 +0000</updated>
                            <resolved>Mon, 10 Feb 2014 02:35:20 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="70072" author="kitwestneat" created="Mon, 28 Oct 2013 19:52:20 +0000"  >&lt;p&gt;I got it working I think, there were corresponding changes that needed to be made to the calls to io_channel_write_blk64. &lt;/p&gt;

&lt;p&gt;I&apos;ll try to get a patch together.&lt;/p&gt;</comment>
                            <comment id="70074" author="pjones" created="Mon, 28 Oct 2013 19:56:09 +0000"  >&lt;p&gt;That&apos;s great Kit!&lt;/p&gt;

&lt;p&gt;Niu&lt;/p&gt;

&lt;p&gt;Could you please help out with this one?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="70075" author="kitwestneat" created="Mon, 28 Oct 2013 20:03:03 +0000"  >&lt;p&gt;I spoke too soon, I still am having issues with -I correctly writing out an fs image.&lt;/p&gt;</comment>
                            <comment id="70077" author="adilger" created="Mon, 28 Oct 2013 20:15:39 +0000"  >&lt;p&gt;I suspect the first problem is that e2image incorrectly thinks the blocksize is 1024, when it should really be 4096 to match the filesystem image?&lt;/p&gt;</comment>
                            <comment id="70082" author="kitwestneat" created="Mon, 28 Oct 2013 21:25:45 +0000"  >&lt;p&gt;it looks like ext2fs_rewrite_to_io is resetting the fs-&amp;gt;io to be the IO channel of the new device, but that is still using the default blocksize of 1k. Should ext2fs_rewrite_to_io copy the block size?&lt;/p&gt;</comment>
                            <comment id="70099" author="adilger" created="Tue, 29 Oct 2013 09:23:43 +0000"  >&lt;p&gt;I can&apos;t think of any good reason that the blocksize would not be the same...&lt;/p&gt;</comment>
                            <comment id="70129" author="kitwestneat" created="Tue, 29 Oct 2013 16:40:28 +0000"  >&lt;p&gt;Ok, I pushed a patch:&lt;br/&gt;
&lt;a href=&quot;http://review.whamcloud.com/#/c/8095&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/#/c/8095&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="70231" author="adilger" created="Wed, 30 Oct 2013 05:53:58 +0000"  >&lt;p&gt;I saw in the patch comment that you are using &quot;e2image -I image&quot; to install the image on a new device.  I was using &quot;&lt;tt&gt;e2image -Q /dev/XXX image.qcow&lt;/tt&gt;&quot; to generate a packed image, and then &quot;e2image -r image.qcow image.raw&quot; to convert it into a raw image for testing.  I didn&apos;t use the &quot;-I&quot; image, so didn&apos;t see any problems.&lt;/p&gt;</comment>
                            <comment id="76500" author="ihara" created="Fri, 7 Feb 2014 19:35:47 +0000"  >&lt;p&gt;The pathes should be landed in master of e2fsprogs. So, we can close it.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzw71j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>11285</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10060" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Severity</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>