Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1378805lqb; Thu, 30 May 2024 08:30:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVhTPvNRVZQycxOTIZ0ZSTVKYXt2aURnCNhg6wLUEBlaWYK/f8DUF80HuMPk/PVyOPaSuX9/yrLn9UKyotrsA0t/jX7C2IdkXYDcH/RIA== X-Google-Smtp-Source: AGHT+IHoZ4ZWGYSmM8ck4/Yitp7wsWGKOBEwhd3hxjsMTJczI3QmLUF/3Jcfyf888cQL+26CYUAx X-Received: by 2002:a05:6870:fba4:b0:24c:535d:9b2d with SMTP id 586e51a60fabf-25060bfe9b2mr3469804fac.32.1717083048752; Thu, 30 May 2024 08:30:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717083048; cv=pass; d=google.com; s=arc-20160816; b=LBNevR8SHcSiMPuqIxtRsg6KsXftGbjgRKXUtzpsedmiJ41ODiEvR00FaijVcJYgb7 y8shU+g8pY56g8+RNaMwpYsvttb3zrROR+zqQfKoR0Xwrrkz0XSznw8UFuegXN47C9t+ y8kEF4AbuS0oolvyYY0wPSCXM8NpZL+vzxUVGbLddDHEfY//+VtL5BuUlOLhkHGyzmqe gLNYLlr7PBqtzSHoWNm+9jVrcmG1xLpmFm0SbGo1z8p2C6IgLjGLdC/hQWjU5+Z9lY8C LnyeWBAAVzHR+W1CjX2gjUJq678USzv+saHGNlGzyTi26ifXa8R/n3GMyFm7QERfnonQ dqrg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=XeX6WqMXI5fca0ZxojJEQYByhD/51ohiIhi7Q0cyItA=; fh=NxG/QNXZMeQK7+DR7iD9/cLDYuxcj8obtd2iRMZ/6lg=; b=jWD4eOj6vgXRK5V8f6+FrgSr1i7Qshi7IJRki1cW/H45n8V+czE+MK+9pyWTGgQ+0M B9amGaQLZTK/KC0G8tXYfDbkRZhb8bhrztVLCFhOHHfN/TftsVBY4iSc8w6dA7oHjjm0 fhIuOEBPByMM5V2aCS5QpBaD//TZAEWiEDaKC4S84SZIRJ1FfMKijFuk/wvv8XQsRzXN T2AWWdfl+pHeOYYFe8I9lkg/xtvNS9VvFBNBK3if7HzZSakc+HdqzQenlNjeA4Q3qMDS Gilh2WISW49KHGTfAOoZkGrktIQ17XlzxTCvD+5S7XG1qR6r/BdR3eRSTfDAGP5GU1Kv CCcQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gentwo.org header.s=default header.b=eAjtpJHp; arc=pass (i=1 spf=pass spfdomain=gentwo.org dkim=pass dkdomain=gentwo.org dmarc=pass fromdomain=gentwo.org); spf=pass (google.com: domain of linux-kernel+bounces-195601-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195601-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=gentwo.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a1e0cc1a2514c-80ac6796991si640008241.138.2024.05.30.08.30.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 08:30:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195601-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gentwo.org header.s=default header.b=eAjtpJHp; arc=pass (i=1 spf=pass spfdomain=gentwo.org dkim=pass dkdomain=gentwo.org dmarc=pass fromdomain=gentwo.org); spf=pass (google.com: domain of linux-kernel+bounces-195601-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195601-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=gentwo.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 40FBB1C24914 for ; Thu, 30 May 2024 15:30:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDF1C182D00; Thu, 30 May 2024 15:30:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=gentwo.org header.i=@gentwo.org header.b="eAjtpJHp" 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 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.