Prev: [PATCHv3] USB: f_mass_storage: dynamic buffers for better alignment
Next: [PATCH 0/4] Some typo fixing
From: Andrew Morton on 15 Mar 2010 16:50 On Mon, 15 Mar 2010 11:26:56 +0300 Dan Carpenter <error27(a)gmail.com> wrote: > adpt_i2o_delete_hba() calls kfree() so we have to save "pHba->next" > before calling it. Also inside adpt_i2o_delete_hba() itself, there > was another use after free bug which I fixed by moving the kfree() > down a line. erk. This code should be crashing most gruesomely. I wonder why it doesn't. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: James Bottomley on 15 Mar 2010 18:50
On Mon, 2010-03-15 at 13:45 -0700, Andrew Morton wrote: > On Mon, 15 Mar 2010 11:26:56 +0300 > Dan Carpenter <error27(a)gmail.com> wrote: > > > adpt_i2o_delete_hba() calls kfree() so we have to save "pHba->next" > > before calling it. Also inside adpt_i2o_delete_hba() itself, there > > was another use after free bug which I fixed by moving the kfree() > > down a line. > > erk. This code should be crashing most gruesomely. I wonder why it > doesn't. I'm tempted to say because we have no users, but actually, for this driver, I know we do. So I think it works because most people don't have poisoning turned on in a running system and there's no sleep between the free and the use, so no opportunity to reuse the area on the percpu hot list even in an smp system. I'll add it to -rc fixes ... when I get the current misc tree broken apart. James -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |