From nobody Thu Oct 31 00:18:24 2024 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 10CB01E2109; Wed, 7 Aug 2024 10:51:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723027919; cv=none; b=gHm3twtmU7w5NAhbS/QCipcM3IuG6IpAKyy853gqDzaMCX0iPx0FRpmuzcZ6o9Q90BnWGSZC45Z79ak5VEVEjQMlE2nKxBV5+darU1irWVdjeylnpOg95A7VJ3TPW71SHVb6SiS1fUF//IP90aIzUgDS4S3qvMCSiJzZi4dWKyo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723027919; c=relaxed/simple; bh=gPsC2UlLxBw3BL0age7vpz8KLTHMKYLe4B9EaxN7Zfk=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=j9WrGMdmg2Naa3Jb5v+/bAg0hnTy+FcSW6HvuHYHvKnG3tQyNh8j6GH6/s+ZVh1p+5TUKI6snmVxLJES2N9rMM+1wDPKGDN2LtIFdNkrksd11oxQdo1WvXhbNwJKJMs+KVH3CZFOrPDfttYenYlTpFe3kgFiCb/OdFNz4FKkxjM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=M2KgKfpv; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=jWxsZwPF; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="M2KgKfpv"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="jWxsZwPF" Date: Wed, 07 Aug 2024 10:51:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1723027915; h=from:from:sender:sender:reply-to: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=3H/sP3bZnw6J72GIcKs+xcMiUcE+F2F9IcVC7hpl2HE=; b=M2KgKfpviE8CAOez+kBtIZfgpxcbSYJxwH+EiycgxZtrgCgfVh7Ikz5VUk7nx33URdfqm4 dMLIjCrMCHz+LVoTn7rHDR+8MMOpiCYy2OG3fFNB2XaofdYXmLClXbpYRyEUtTdm/wXJ4U JVd3nWqouQQYT6CC7cbbuDiMFGvfU83AS/tl4E4pR57DJ2qGwaoBbX1hlWChqk6PsxKRwl R/FdFyTdmdgHoft+gpHpPrOQB7FOKMthqgT4TjF/vE+3UIuxGc9WzDDafwGr3G81bndeZ7 j7CqwlCYRTVjywgXWxNT3AqL1gKKOcN5Bcymg1G2RGU7o94BlKZ/6i426NILIA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1723027915; h=from:from:sender:sender:reply-to: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=3H/sP3bZnw6J72GIcKs+xcMiUcE+F2F9IcVC7hpl2HE=; b=jWxsZwPF4cwkLeP6k+VVWW4UFk6dplc7MUEEnhmA+ST1sFexbomZSoU3v1RGOyrQOz0aAA gzKAmjylIEZTyPCg== From: "tip-bot2 for Dan Carpenter" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/debug: Fix fair_server_period_max value Cc: Linux Kernel Functional Testing , Arnd Bergmann , Stephen Rothwell , Dan Carpenter , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <172302791517.2215.9583140780460140951.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the sched/core branch of tip: Commit-ID: 4ae0c2b91110dab6f4291c2c7f99dde60ecc97d8 Gitweb: https://git.kernel.org/tip/4ae0c2b91110dab6f4291c2c7f99dde60= ecc97d8 Author: Dan Carpenter AuthorDate: Thu, 01 Aug 2024 10:44:03 -05:00 Committer: Peter Zijlstra CommitterDate: Wed, 07 Aug 2024 12:44:16 +02:00 sched/debug: Fix fair_server_period_max value This code has an integer overflow or sign extension bug which was caught by gcc-13: kernel/sched/debug.c:341:57: error: integer overflow in expression of type 'long int' results in '-100663296' [-Werror=3Doverflow] 341 | static unsigned long fair_server_period_max =3D (1 << 22) * NSEC_= PER_USEC; /* ~4 seconds */ The result is that "fair_server_period_max" is set to 0xfffffffffa000000 (585 years) instead of instead of 0xfa000000 (4 seconds) that was intended. Fix this by changing the type to shift from (1 << 22) to (1UL << 22). Closes: https://lore.kernel.org/all/CA+G9fYtE2GAbeqU+AOCffgo2oH0RTJUxU+=3DP= i3cFn4di_KgBAQ@mail.gmail.com/ Fixes: d741f297bcea ("sched/fair: Fair server interface") Reported-by: Linux Kernel Functional Testing Reported-by: Arnd Bergmann Reported-by: Stephen Rothwell Signed-off-by: Dan Carpenter Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/a936b991-e464-4bdf-94ab-08e25d364986@stanle= y.mountain --- kernel/sched/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index e75914e..831a77a 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -338,7 +338,7 @@ enum dl_param { DL_PERIOD, }; =20 -static unsigned long fair_server_period_max =3D (1 << 22) * NSEC_PER_USEC;= /* ~4 seconds */ +static unsigned long fair_server_period_max =3D (1UL << 22) * NSEC_PER_USE= C; /* ~4 seconds */ static unsigned long fair_server_period_min =3D (100) * NSEC_PER_USEC; = /* 100 us */ =20 static ssize_t sched_fair_server_write(struct file *filp, const char __use= r *ubuf,