Re: [patch] x86, microcode, AMD: use after free in free_cache()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 05, 2012 at 03:20:57PM +0200, Borislav Petkov wrote:
> On Wed, Sep 05, 2012 at 03:30:42PM +0300, Dan Carpenter wrote:
> > list_for_each_entry_reverse() dereferences the iterator, but we already
> > freed it.
> 
> Wait a sec, we assign the iterator in each iteration of the loop, right?
> 
> And if so, I don't see a problem: we derefence a new element each time
> and *then* free it...

The dereference happens inside the assignment.  That's actually the
reason why we have the the _safe() version of the macro.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux