From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Weinberger Date: Mon, 25 Jun 2018 22:47:28 +0200 Subject: [U-Boot] [PATCH] ubifs: avoid memory corruption during ubifsmount In-Reply-To: <1529927652-29344-1-git-send-email-patrice.chotard@st.com> References: <1529927652-29344-1-git-send-email-patrice.chotard@st.com> Message-ID: <1770221.hggCJ2Af2R@blindfold> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Patrice, Am Montag, 25. Juni 2018, 13:54:12 CEST schrieb Patrice Chotard: > Sometimes, at boot time, following issue appears: > Error reading superblock on volume 'ubi0:boot' errno=-22! > > This error is coming from wrong ubi_num and wrong ubi_id in the superblock. > (ubi_num = -1 and vol_id = -1). > It appears that following line in sget function: > hlist_add_head(&s->s_instances, &type->fs_supers); > corrupts the superblock structure. Hmm, how can hlist_add_head() corrupt the structure? This seems fishy to me, I fear that this is not the root cause of the problem you are facing. > By checking ubifs source code, s_instances parameter is not used anymore. > So, by setting this parameter and the associated source code under > __UBOOT__ compilation switch solves this issue. Yes, we can clean up this. But as I said, we need to dig deeper to explain the corruption you see. Thanks, //richard