Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp141689lqz; Fri, 29 Mar 2024 11:08:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUYfG/COJSlT1Hxu8QH2Qt9jgp+nOHOQPB2Wv70R+VuMiuV9xxn9PLfkwg+gN/hIfo6YtisS1gFi3nrs2xvpbdQGszc/rkutM9mQ3QwoQ== X-Google-Smtp-Source: AGHT+IF6kOr14ANZ3LqPYpYuK4fSHlpe2yURFGvSPxhwrg+5Sbpx3YDTk6n3lDkbVw02IYW50ZRE X-Received: by 2002:a05:6512:b91:b0:515:d325:1cbf with SMTP id b17-20020a0565120b9100b00515d3251cbfmr1059484lfv.31.1711735686930; Fri, 29 Mar 2024 11:08:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711735686; cv=pass; d=google.com; s=arc-20160816; b=JjkmyDVCOXnuwhzvgykYnZh5JL6DbZzas9/zWrBRE0srSeAY+vWB6qNXi4JWjfR94M Dkkszax5qyTWeRzGh/TDPsc8ax7U4SnZEOXOVrYYFzufiTgoTgLHJzqiNPbJX7WpC2PC xCKewG4ONwrf1Zq3nU6W0K5XxPVXZYXFPFYSN0adrXQDrlBxwRfWl1o1QMDE68cqcj1S jxfX4SnZINY9HC+5RvIt0X8X83+JWGFW3STo0gZa7USe81VGOFRA65PLshorrfDJLTOx 2+g5COKGJhCtQUfzfe+xk0Ytf1OCGNiTIx3SzO4N8Yg2W1ysS4K4dVfMNY60JXjpqrlI WLHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=jrat3ry5MhEQ7PAXPWccjIhRfsAax5tU0xKfOTRN+kg=; fh=/+W2UJHzvk04nMcMQXJSsIf50eqroMAzYc+4iXXdrL0=; b=uGJUJFafl1iQitiUN419Hr595xlZsVbThP+kQBMcCmBAZTBQtkkp5uWz8/+m0hzVXy pYaLhJoGEAIEX/I5i9nUlRg3t867g7l3NH+kiStaAYAMbwANtYM+BKLpJ+MPVTCf8BuG uSKslL5ppYzRXhlgqwlCTyzO5Xx4OYQwjimHyPiKqgHsAErShz1sbIBwKVErDQIDwKYf 5RLL4D9LZuMohxHVobdxQpqGDf8o/fCcwuTnVZeO27IwsB8/zFo0C/VYx2xdMIxaQRS4 Frxt63zSZvblnXiVDnt/IshWUU0i9dcqVDPcUMyoPv7OFoK+LfqzRjf2Af6J7gh0kZk/ FdYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=ancud.ru); spf=pass (google.com: domain of linux-kernel+bounces-125272-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125272-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id kn19-20020a170906aa5300b00a4e388ef8f4si707490ejb.477.2024.03.29.11.08.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 11:08:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-125272-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=ancud.ru); spf=pass (google.com: domain of linux-kernel+bounces-125272-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125272-linux.lists.archive=gmail.com@vger.kernel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id A27791F231F9 for ; Fri, 29 Mar 2024 18:08:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87938137742; Fri, 29 Mar 2024 18:07:59 +0000 (UTC) Received: from relay163.nicmail.ru (relay163.nicmail.ru [91.189.117.7]) (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 3F7F11C0DC2; Fri, 29 Mar 2024 18:07:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.189.117.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711735679; cv=none; b=mxnGZfIb6z9l4mo1uIEjfE6/8K614KCuBd+sQQX45CBkpRl97DYWDrseMzo6ZkqhlqCSCJ2Oh6h75ZrxmEEwp++kdD8EKibht1c5faE9jjLitEHhuxylNPlJ7eKtSFZScWQzpFa2S+WW8MJ7nnIPFQH2JVxnKL8kLpv2HD5aGOc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711735679; c=relaxed/simple; bh=ppBkloHHT+Aybl1NsacD70/lnYVpAG0Gn8A6J+takWM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oKX3sajgA2lcPuh1yGL0snARYKKU5LnICu7zh0TAzy8BUI+N3VCsBfSnjLL85QmQ2aAUT/B81f0bAoLUUKqOEkDojnmXGyLlvwHL2Dq8GYWz5zMO6LJV7OkGm/IDBEKF15tDn0YXInnuwxsIOAPHWX40Xkn2Sm+OthBXi8DxQhI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ancud.ru; spf=pass smtp.mailfrom=ancud.ru; arc=none smtp.client-ip=91.189.117.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ancud.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ancud.ru Received: from [10.28.138.151] (port=11284 helo=[192.168.95.111]) by relay.hosting.mail.nic.ru with esmtp (Exim 5.55) (envelope-from ) id 1rqGSh-0008QS-9o; Fri, 29 Mar 2024 20:56:19 +0300 Received: from [87.245.155.195] (account kiryushin@ancud.ru HELO [192.168.95.111]) by incarp1103.mail.hosting.nic.ru (Exim 5.55) with id 1rqGSg-002CSg-36; Fri, 29 Mar 2024 20:56:19 +0300 Message-ID: Date: Fri, 29 Mar 2024 20:56:16 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] rcu: Fix buffer overlow in print_cpu_stall_info() To: paulmck@kernel.org Cc: Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , rcu@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org References: <20240328181914.869332-1-kiryushin@ancud.ru> Content-Language: en-US From: Nikita Kiryushin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-MS-Exchange-Organization-SCL: -1 Thank you for the feedback! > would you like to resend keeping the buffer-overflow fix but leaving > out the signed-to-unsigned conversion? > I will make a second version of the patch, without conversion as it is intentional. > However, the signed output is intentional. The idea is that if the > timekeeping code is confused enough to run the jiffies counter backwards, > we see a small negative number rather than a huge positive number. > For example, -132 is immediately obvious, while the 64-bit unsigned > equivalent of 18446744073709551484 might not be. I had suspicions that was the case, however, I did not find the pointers in the code or in the commit message, that it was intentional, so I assumed a mistake. Maybe, it would be a good idea for me to add a comment with intent clarification, to reduce possibility of the same confusion in the future, while I am at it? If so, should I do it in the same patch, or make a separate one?