Re: Is it OK to pass non-acquired objects to kfree?

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

 



On Thu, Sep 10, 2015 at 8:13 PM, Christoph Lameter <cl@xxxxxxxxx> wrote:
> On Thu, 10 Sep 2015, Dmitry Vyukov wrote:
>
>> On Thu, Sep 10, 2015 at 8:01 PM, Christoph Lameter <cl@xxxxxxxxx> wrote:
>> > On Thu, 10 Sep 2015, Paul E. McKenney wrote:
>> >
>> >> The reason we poked at this was to see if any of SLxB touched the
>> >> memory being freed.  If none of them touched the memory being freed,
>> >> and if that was a policy, then the idiom above would be legal.  However,
>> >> one of them does touch the memory being freed, so, yes, the above code
>> >> needs to be fixed.
>> >
>> > The one that touches the object has a barrier() before it touches the
>> > memory.
>>
>> It does not change anything, right?
>
> It changes the first word of the object after the barrier. The first word
> is used in SLUB as the pointer to the next free object.

User can also write to this object after it is reallocated. It is
equivalent to kmalloc writing to the object.
And barrier is not the kind of barrier that would make it correct.
So I do not see how it is relevant.

-- 
Dmitry Vyukov, Software Engineer, dvyukov@xxxxxxxxxx
Google Germany GmbH, Dienerstraße 12, 80331, München
Geschäftsführer: Graham Law, Christine Elizabeth Flores
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat
sind, leiten Sie diese bitte nicht weiter, informieren Sie den
Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank.
This e-mail is confidential. If you are not the right addressee please
do not forward it, please inform the sender, and please erase this
e-mail including any attachments. Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]