Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753509AbdDCOzj (ORCPT ); Mon, 3 Apr 2017 10:55:39 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:59840 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752145AbdDCOxZ (ORCPT ); Mon, 3 Apr 2017 10:53:25 -0400 Date: Mon, 3 Apr 2017 07:53:20 -0700 From: Matthew Wilcox To: Christoph Lameter Cc: Michael Ellerman , Kees Cook , Andrew Morton , Pekka Enberg , David Rientjes , Joonsoo Kim , Linux-MM , LKML Subject: Re: [PATCH] mm: Add additional consistency check Message-ID: <20170403145320.GD30811@bombadil.infradead.org> References: <20170331164028.GA118828@beast> <20170331143317.3865149a6b6112f0d1a63499@linux-foundation.org> <874ly6gnuo.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 514 Lines: 11 On Mon, Apr 03, 2017 at 09:03:50AM -0500, Christoph Lameter wrote: > 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. Is that a guarantee? There's some wording in the RCU free code that seems to indicate we can't rely on that being true.