Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752759AbdDCOME (ORCPT ); Mon, 3 Apr 2017 10:12:04 -0400 Received: from resqmta-ch2-06v.sys.comcast.net ([69.252.207.38]:53420 "EHLO resqmta-ch2-06v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752023AbdDCOMC (ORCPT ); Mon, 3 Apr 2017 10:12:02 -0400 X-Greylist: delayed 488 seconds by postgrey-1.27 at vger.kernel.org; Mon, 03 Apr 2017 10:12:02 EDT Date: Mon, 3 Apr 2017 09:03:50 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@east.gentwo.org To: Michael Ellerman cc: Kees Cook , Andrew Morton , Pekka Enberg , David Rientjes , Joonsoo Kim , Linux-MM , LKML Subject: Re: [PATCH] mm: Add additional consistency check In-Reply-To: <874ly6gnuo.fsf@concordia.ellerman.id.au> Message-ID: References: <20170331164028.GA118828@beast> <20170331143317.3865149a6b6112f0d1a63499@linux-foundation.org> <874ly6gnuo.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfPmFSZosoTHc2ec5Cg4lF6w2C4rLgPWr13u/qcLUNx9jokMN1LXPsND7g3RUpqjFQ4H4aVD2zthhV7ztomilAHvNh2MzgA4RSyCQgm4RaliRAT2HdfGh p/xX6J9OVhNZqV4hukfuGE7yO+uFZXXpNeT417GoYENmXATSOmZwI+4O+kpQTQFYO91T+L9/3DPUCHUt/1QwCGk6jLzba5qTOglUERRV9Uwxpd+hD730kD7N XEYUsKiYi1ae3JvLwIT7BXXsMiNDr6Vpyk2gWD4wSUZIz++RcI18Nu1yQu21goKyR/rdIGsYGLwg8632KANIcgLfu1ORssCIERdQJM7+Cxxy7sruJZjAjMID jYR1JPAtbmQJ8k/pQGGnFyaJ0fT54ql5QGqBAZz0XTNQQEMSAeg= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 379 Lines: 9 On Mon, 3 Apr 2017, Michael Ellerman wrote: > At least in slab.c it seems that would allow you to "free" an object > from one kmem_cache onto the array_cache of another kmem_cache, which > seems fishy. But maybe there's a check somewhere I'm missing? kfree can be used to free any object from any slab cache. kmem_cache_free() checks if the object belongs to the cache given.