mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Giorgio Dal Molin <giorgio.nicole@arcor.de>, barebox@lists.infradead.org
Subject: Re: NULL pointer deref crash on barebox 2020.08.0
Date: Thu, 20 Aug 2020 14:21:46 +0200	[thread overview]
Message-ID: <3254031d-0a9d-42c5-2e26-b41095d52227@pengutronix.de> (raw)
In-Reply-To: <1196968959.8187.1597925911899@mail.vodafone.de>

Hello Giorgio,

On 8/20/20 2:18 PM, Giorgio Dal Molin wrote:
> Hi,
> 
> I've tried the current barebox v2020.08.0 on my imx7d module and it crashes
> while executing the command:
> 
> imx7d: / cp /mnt/boot/kernel.img /dev/mmc1.fw_update
> unable to handle NULL pointer dereference at address 0x00000000
> pc : [<ffe6c2dc>]    lr : [<ffe6c2c0>]
> sp : fffefcd0  ip : fffefcd0  fp : c00f8850
> r10: ffe981ef  r9 : 00000000  r8 : ffe981ef
> r7 : ffe98dcb  r6 : ffea60a8  r5 : ffe98dbd  r4 : c00ef1e8
> r3 : 00000000  r2 : bfefb8e0  r1 : ffe98dbd  r0 : 00028888
> Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> 
> no stack data available
> 
> 
> I could track the problem down to a call to list_del(&inode->i_sb_list); in
> fs/fs.c:iput(struct inode *inode):
> 
> void iput(struct inode *inode)
> {
> 	if (!inode)
> 		return;
> 
> 	inode->i_count--;
> 
> 	if (!inode->i_count) {
> 		list_del(&inode->i_sb_list);        <== this call segfaults
> 		destroy_inode(inode);
> 	}
> }
> 
> I've checked that the struct list_head inode->i_sb_list has its .prev pointer NULL
> and that's the immediate reason why I get a segfault (at WRITE_ONCE(prev->next, next)
> in __list_del(prev, next); what I don't know is whether a NULL .prev is OK and the error
> is a missing test in __list_del() or if a NULL .prev is already wrong.

What kind of file system is mounted at /mnt/boot?

> 
> giorgio
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2020-08-20 12:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20 12:18 Giorgio Dal Molin
2020-08-20 12:21 ` Ahmad Fatoum [this message]
2020-08-20 12:26   ` Giorgio Dal Molin
2020-08-20 12:28     ` Ahmad Fatoum
2020-08-20 12:50       ` Giorgio Dal Molin
2020-08-20 12:57         ` Sascha Hauer
2020-08-20 13:06           ` Giorgio Dal Molin
2020-08-20 13:26           ` Giorgio Dal Molin
2020-08-21  4:37             ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3254031d-0a9d-42c5-2e26-b41095d52227@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=giorgio.nicole@arcor.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox