From nobody Mon Jun 8 08:43:54 2026 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 297893E5577 for ; Wed, 3 Jun 2026 16:24:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780503856; cv=none; b=amfRagq0til8+2TY7jllCMzk2bJ4eGXaZX9QbFTRU5ZCLI7fk5EKyV2GORsvEf5kI+yI3EbUhc0PtC2df2B2ZpML5kr3uSSZpWa+qiMA60mcR1GUQA9buvwiCiJnmN3R8WJYuA47Et8AKpuzshW8G8PqEsbrAuqWrYNh2iZ8Zi8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780503856; c=relaxed/simple; bh=yp4ciTApz1ViTYc7BAEO/7pIXSeFt9gT7hQJAu6HPBc=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=tH4F/noH7UNXYlE8vRMB53b1cHkpdG0GvBqqZY4JGYIyDMB7LfZvPC0zqx5M2GgsCdTJX+PnFgXsrVCvOYoRzBa6gvk6MF4FORH/KuCYGYoF2G96g/aIwOfSZOD32nG6OXlw0GjIVJ5Pe+RUDi4DJ54nqOU1LmDqByJ7bWLaTAA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=P8vqNAE/; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="P8vqNAE/" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-8423f1e2f8eso3076280b3a.1 for ; Wed, 03 Jun 2026 09:24:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780503854; x=1781108654; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=pZniL4gn/+6csOa48o24E1Ir6uU5QUrmx49YqPwA5Lc=; b=P8vqNAE/vwycy4J7WGzpR9P2N06WoJqX1v4ryvsrWi1DRJLY5PMjw9+qpRwisJ/C0t cQ1ejCSTckJLK29s7N+/L8nxObvUWQtp8fItwu2iwGxsvvCtCpQo9ecomWWTSTcJ8MAi sl1k1+MbgxMLRNlRVfPzB4UZWbHElytGOIEd9V9XU0NUGsF4JXsGWeMoHnWNgt4StCp7 R8oZYMTpD17Yai/wl3W9Dq4YxnUJum3SlDR3brvUKcUTkr75uLXFHoY9zkcKZj5jUNp0 H3ryRIt3PS/unaH6j7CcQ9s0K7PmNl8EhXFzMoq9DClohm3tSDpHnyls/1gxLhRQsA7p Rt0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780503854; x=1781108654; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pZniL4gn/+6csOa48o24E1Ir6uU5QUrmx49YqPwA5Lc=; b=n3Tp4jbQ0FDl7PY1exXMEZKVrRos6elt5O8q8EBw6Ifj488z6zSlUmU8tjqxxHrZUP sEWpYz/lhzbPPt66LLJOcswfHBMxtq/W2yHYtYIgW6SGkZTjSMVSDpATH4hLT2tAFuY0 4Pq/7kmJuRw2yX0yrkc73sAg+Y17ORiz8/hmndKmuNRcxfl7MYgKahHPEhm1t+HcizNC DD2PnVJx6Giq7flmfWXRUAZpAmxg7V7UulYl95RVyxEMJNfZziv5D8hiUZ5rPTI86TK9 zrisieLYPq5cez5moSIB+k4RgsY+jZO0AY4JtcBZ9jASErzx+Yir3PndiPCEY7Nk9zVR rYgQ== X-Forwarded-Encrypted: i=1; AFNElJ/Cxv7Q5iK6ZsI48sliDP67q3b1HtXWFnz2V36kL0GUxwEz5q/GerQm6Vy/6gM2pqCHwtiaqZ3Qx0a6evk=@vger.kernel.org X-Gm-Message-State: AOJu0YwqZIrncDnfN32zSa3EW/a/LnaSvCvV1zbFQJchCVOi4ypGEbcE 2Z6YAvbbutt3DYJIwEYoeFv7z2+67ZCYHlvZlmdEWtGregIzfNiV6K8Y X-Gm-Gg: Acq92OFK6WmZg3yrfLdY6/yDhUZxKqclLRhSbDBKQyE8F/9QFm1tZbuy/w9aLVMfuT0 1yO5/clvMZ4yVdvkInxmSig4//amBrSdawodjnk3Kc7JxdYmzFI7eb1ka+SO5spdjoluc8wSho3 quvL+CfVpT81PfC/7hTgm56UbpR7EiAj1Krfdl5Ak9P6KBM6nI04vx0lA7y2rldkXY5ERLwPqpA DjSQeFdOOUV2pipIcp7tiCugS9jeE1xktRjUP3qtg7vxoSS75DAI0FArKTNOWe394xiA4lJ5GVE Z/Iic0wiquVrGiIjLxZQUBNgx1pkHfgmhJ75LmeobwuW+bdmmVIpj19bMglmlEGZXPr/b9Ey3SJ f6HDdaDlWS21mUDfr0CVXI79LcSIfjZoKC6ajuGQqYFBFLVEnMr8OJvnsITIllxepA7/R42Mr9Q PSymIqdZFMHgFZKWbeilbLnjPV/XfIP5/vvl0= X-Received: by 2002:a05:6a00:2d8f:b0:842:3801:47b with SMTP id d2e1a72fcca58-84284e27c0cmr4094954b3a.18.1780503854282; Wed, 03 Jun 2026 09:24:14 -0700 (PDT) Received: from localhost ([2405:201:4027:a919:e2b2:8560:26ea:4d1]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84282372502sm3855246b3a.16.2026.06.03.09.24.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 09:24:13 -0700 (PDT) Date: Wed, 3 Jun 2026 21:54:11 +0530 From: Naveen Kumar Chaudhary To: mcgrof@kernel.org, petr.pavlu@suse.com, da.gomez@kernel.org, samitolvanen@google.com Cc: atomlin@atomlin.com, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] module: procfs: fix signed integer overflow in module_total_size() Message-ID: <2k7x7245kygzpa5wzssebsrt5ivpykvvoeiljb5at2yiwgp4fy@fqkcethe4hyx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" module_total_size() accumulates unsigned section sizes into a signed int before returning as unsigned int. If the total exceeds INT_MAX, this is signed integer overflow. Change the accumulator to unsigned int to match the return type. Signed-off-by: Naveen Kumar Chaudhary Reviewed-by: Sami Tolvanen --- kernel/module/procfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/module/procfs.c b/kernel/module/procfs.c index 0a4841e88adb..90712aa9dd13 100644 --- a/kernel/module/procfs.c +++ b/kernel/module/procfs.c @@ -64,7 +64,7 @@ static void m_stop(struct seq_file *m, void *p) =20 static unsigned int module_total_size(struct module *mod) { - int size =3D 0; + unsigned int size =3D 0; =20 for_each_mod_mem_type(type) size +=3D mod->mem[type].size; --=20 2.43.0