Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2473024lqb; Tue, 28 May 2024 00:18:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX3sWOG9fqoYp62OrQrgJYLd9rGbhZSV8Rt4I3HyliCp7Yl52NLfM+YxtsMD7jPzQWXDXYwhiGlA0oUDVQA07LNdu8Ofov0EtJTdVycuA== X-Google-Smtp-Source: AGHT+IH8H/FXFL42P74kGJO4eWG/PTMIaGLyYSbDc3WjRijsBSpcdQ1Cuh0+wMkZxRb1xjZEEaIg X-Received: by 2002:ac8:7d54:0:b0:43a:f0f0:38a6 with SMTP id d75a77b69052e-43fb0ef0e1fmr112395141cf.58.1716880695527; Tue, 28 May 2024 00:18:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716880695; cv=pass; d=google.com; s=arc-20160816; b=PYTqX/ZZmAnCqp1KUIXvCGhAMw8HLmVlQi1Y/ALWAt+rdLZpFIsb5laSbf9IGfFIbV gb0jRf5zdGPo7KkKzfpqmb9WaCdWdDySn22V7FPN97FsQkOGuPBu6MNE0Bg9tYPOfrRF b4ca8poiQHzRcJf/7S3hPXojYNjecrRf/cZ2FmLrJIXhpteh7tLezYA70keUbCtTFo0z /0nK+fdxeerTlDxpU5GSDzQ2brizCAslnd6DzhtEpLKvglPVj2EmHAQcCc2nmGbfY5bb 1IaaB2LFZT/Ra6XfyrPnFFWnScNe6vwq4z/YYxi1u3YFUTVIVbu32Y0SO0mAi1mrFHKu KT4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=CMaSIU7JsGNs76Hq+XgMuzCoHf1FVSkJsmdl8eAubO4=; fh=aAcHoaoscyWZDK/c0LWwA/7SqDW92Zbn0KNW0yzusYI=; b=b59TYicA24NuwKwzKP9GV9/kn0zSejCSWMS6jPBJPtPeuPuGKHNtiNxtAqmr54PRaD tDRF0I6oikFs6uwCB3x+t66JSHr4CwTk2KU3p13cATaiCleYaM291OoaO1ir5/vINMmL N74FG/A6HnOYtUrXCgM+ZEOiuJJ2C8wpOAuYu8RS6imTrYC6dmd/lK1yx7aKwwCQMHsj +rzqCVMQywSEltMeZI3NFihyi/vcK6lkowvb2v8ID8Mmlz24zCu1ks3KPIu8F2oCm3Dv fijT55TYYBapMCaNDnXf5ywI8y2aXDCvr8O+admQstSVyQ3jGx/KmmzocZUrOZbXMG/V zGxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=WeqnOlZv; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-191857-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191857-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43fb18ca631si95061701cf.701.2024.05.28.00.18.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 00:18:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191857-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=@linux.dev header.s=key1 header.b=WeqnOlZv; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-191857-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191857-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 45FB31C216CF for ; Tue, 28 May 2024 07:18:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5265D6D1C7; Tue, 28 May 2024 07:18:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="WeqnOlZv" Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (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 D554A71750 for ; Tue, 28 May 2024 07:17:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716880679; cv=none; b=braezDNJI2EHQhWEUyyu/0Va5tgCdaNVbAK27Tui3qP+UZaOcuj07V86AgpAIP6whNsQYyIJuIJOK3GaOu5hyC016NkMnB4jv14qpn4NuI5JZSzy5NH4Xqk3J3UDVnpBU9u857GVUW62YT0olKs2ZC6fr9Q695nSji8QgYKzDWY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716880679; c=relaxed/simple; bh=rHIF8qKq64R0lpw1VUx1Im5wOBmo7sC3YG3g7WqN2W4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IdRThPGb4q6mMkRh6kojNv+jGpp2cgavC63VM7mRPNJHl7TG/cTtbKNFcWHqNakokaZaj47pZblhUYk4opJkXIrHZ3UuyJuvHVWallzzaVWz6sKD0/W/sk0sM5j/lwnCn8MphkXT6A6tXtPPhC3PIpf7BhnhQIKwUAf4uj5shVU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=WeqnOlZv; arc=none smtp.client-ip=95.215.58.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: vbabka@suse.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1716880675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CMaSIU7JsGNs76Hq+XgMuzCoHf1FVSkJsmdl8eAubO4=; b=WeqnOlZv3cipOkQLZEMYBJArodWtyhIDRCTMWRq0PRFeDjk3ZR1BdAluGReAhpv4Ay2tWP ogZI+JWC1KW9+PFe5Un8C2lv+0ZmAJDJIXH4E808ZgEWP/yNaAFb5Wy2toIcXbf6D72iZj ccazgpEZSopK0HkDfZbGPibChtZ7Vng= X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: roman.gushchin@linux.dev X-Envelope-To: 42.hyeyoo@gmail.com X-Envelope-To: iamjoonsoo.kim@lge.com X-Envelope-To: linux-mm@kvack.org X-Envelope-To: rientjes@google.com X-Envelope-To: zhouchengming@bytedance.com X-Envelope-To: penberg@kernel.org X-Envelope-To: akpm@linux-foundation.org X-Envelope-To: feng.tang@intel.com X-Envelope-To: cl@linux.com X-Envelope-To: chengming.zhou@linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou Date: Tue, 28 May 2024 15:16:46 +0800 Subject: [PATCH 1/3] slab: check the return value of check_bytes_and_report() 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="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240528-b4-slab-debug-v1-1-8694ef4802df@linux.dev> References: <20240528-b4-slab-debug-v1-0-8694ef4802df@linux.dev> In-Reply-To: <20240528-b4-slab-debug-v1-0-8694ef4802df@linux.dev> To: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Feng Tang Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, zhouchengming@bytedance.com, Chengming Zhou X-Developer-Signature: v=1; a=ed25519-sha256; t=1716880668; l=849; i=chengming.zhou@linux.dev; s=20240508; h=from:subject:message-id; bh=rHIF8qKq64R0lpw1VUx1Im5wOBmo7sC3YG3g7WqN2W4=; b=KJKqsIabP6pZlL1NYn7OTAWboJRqdoyJ8ZW0qMpjhV9mc2wAbh48bk+//KvkAukAJAN2//aQ+ /iKLywB2qyNCAETzun7+8brQxfX5pTJ4TN3Sfo0EQwOhRl5cMfyQGAf X-Developer-Key: i=chengming.zhou@linux.dev; a=ed25519; pk=kx40VUetZeR6MuiqrM7kPCcGakk1md0Az5qHwb6gBdU= X-Migadu-Flow: FLOW_OUT All check_bytes_and_report() callers have checked its return value except for this one. We should also check its return value here obviously, so fix it. Signed-off-by: Chengming Zhou --- mm/slub.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } } -- 2.45.1