From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gentwo.org (gentwo.org [62.72.0.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A68917F504 for ; Thu, 30 May 2024 15:30:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.72.0.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717083043; cv=none; b=FPf1wNqnVXCgc7Wd6DXNP57XUQ2UhvknZF1WY6pjvjPt2t28UoshtS2BEe90P8QDuobz+2AkM9JpGAOtr6dxkmHHwx90AmvjE0ZkTL5yX8sWEUAzJpClED8YqbECONSVt8pcaiyH0aewlth6QhPVaKADbbDlwphb9r2gOPcLLm4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717083043; c=relaxed/simple; bh=PhD8vfWQu0fzYUGcN9chnT6h1Jccukmikqwpa2qBXcI=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=tTgZ6fJgjQ/fHvI6lATEPfMBUh+s61aIISDxgxQuI/yNWscM/xmlDdBaRqZXnRm3ouqoKgxKZUWU6zsfDJKjmioxb2nEpvvdBkkgonmA/gMY8qC+EbgbcHPJSWpz+/0xW+zi+HuRJeM3Agnma3s/rmMA+lgDX2uaxsMH5F1JEWA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=gentwo.org; spf=pass smtp.mailfrom=gentwo.org; dkim=pass (1024-bit key) header.d=gentwo.org header.i=@gentwo.org header.b=eAjtpJHp; arc=none smtp.client-ip=62.72.0.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=gentwo.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gentwo.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=gentwo.org header.i=@gentwo.org header.b="eAjtpJHp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gentwo.org; s=default; t=1717082428; bh=PhD8vfWQu0fzYUGcN9chnT6h1Jccukmikqwpa2qBXcI=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=eAjtpJHpJYbnCqofA59amrPyn/YQpj9C/4aetzSjTKpYPvskNwTir9HyzdZeaQx1B i21UfQmlqJ19Z4Bc4L0++cvGtJ2ZZ7Q3OiLvuuMUp0tz3KZ7IHkpu6KlrlE53OfD+Q b0YjszmZ3lxw6gKLDrGPev9L7nCmauH82W3TH4bM= Received: by gentwo.org (Postfix, from userid 1003) id 41E0E40A77; Thu, 30 May 2024 08:20:28 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 41008401D5; Thu, 30 May 2024 08:20:28 -0700 (PDT) Date: Thu, 30 May 2024 08:20:28 -0700 (PDT) From: "Christoph Lameter (Ampere)" To: Chengming Zhou cc: Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Feng Tang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, zhouchengming@bytedance.com Subject: Re: [PATCH 1/3] slab: check the return value of check_bytes_and_report() In-Reply-To: <20240528-b4-slab-debug-v1-1-8694ef4802df@linux.dev> Message-ID: <4e4d45b5-c684-2d93-49d2-b179a088c2d5@gentwo.org> References: <20240528-b4-slab-debug-v1-0-8694ef4802df@linux.dev> <20240528-b4-slab-debug-v1-1-8694ef4802df@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Tue, 28 May 2024, Chengming Zhou wrote: > diff --git a/mm/slub.c b/mm/slub.c > index 0809760cf789..de57512734ac 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -1324,9 +1324,10 @@ static int check_object(struct kmem_cache *s, struct slab *slab, > } > } else { > if ((s->flags & SLAB_POISON) && s->object_size < s->inuse) { > - check_bytes_and_report(s, slab, p, "Alignment padding", > + if (!check_bytes_and_report(s, slab, p, "Alignment padding", > endobject, POISON_INUSE, > - s->inuse - s->object_size); > + s->inuse - s->object_size)) > + return 0; > } > } This change means we will then skip the rest of the checks in check_object() such as the poison check.