From nobody Fri Jul 29 03:03:18 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LvC5259Z8z4XqPf for ; Fri, 29 Jul 2022 03:03:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LvC523nqYz3CFy for ; Fri, 29 Jul 2022 03:03:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LvC522rzXzLF9 for ; Fri, 29 Jul 2022 03:03:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 26T33IS2034473 for ; Fri, 29 Jul 2022 03:03:18 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 26T33IJq034472 for bugs@FreeBSD.org; Fri, 29 Jul 2022 03:03:18 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 232914] kern/kern_resource: Integer overflow in function calcru1 Date: Fri, 29 Jul 2022 03:03:18 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.3-STABLE X-Bugzilla-Keywords: needs-qa X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: koobs@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? maintainer-feedback? maintainer-feedback? X-Bugzilla-Changed-Fields: flagtypes.name version cc see_also bug_severity bug_status short_desc keywords Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659063798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lO5Wmn2zpO2TKu6RE72ldl6hDTBaxI7Dg44c4q5PFyg=; b=tCAjl1Gu/8uvciRARulNVabqt0CEbvZM343Z5bc3MbFsR/HWqYewUAY3Gfylgkfj+VrONO 5CXt7ZDKXXq7mHtO3UvJ0tN65UOxWkSqkLWTWEHBegnF4EkR4WI+So1aUP0dHeZsQ8m+9H dGFD9OkNhPkAhaENZoRhDDlmqyjATNAF3OFMWXZy95H/hpXKNXeZEYK8D4QdKI99dbfzGe 7k2fnd5FhWf5Xf7elbcGZihYooHbivbmQ+eAZNusufF2x0//AbskqJe5C/ExSOUJdssX1S UppmD8sgSSwy76pAFuzyjXW48oJjh4rzjmoXUHq7cpIPKEebkaxQGMjyQup6uw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659063798; a=rsa-sha256; cv=none; b=un2q+l0ohVJXci33i33teod/M7Oze36BNJStQUMEBmRbLM3cATzpzfq2dMYUUQZpFs+vww yIG8480iviQmdkP1xIP4QmLoSGdDv13LeDrBXc7u91+Wi7mqElirVnluYEMsr3/AnutHWF cclcK5GYhSckm9Zhh4FZq0gxr4V3mvLVjo4V5HhEBzXhfwQlPtiRvoAO9sCmBbo/aVINss 2wq2KD+lVwxrfI+BuRYgUA911w4lIky0MFaqfkLJOm2JAc687bHuA2FazjJwCp1I+quvoC 9VBNDef71kyuHBic5pvKiCgBPnrirBQFtgJ3CDEETfMu8acc3FJCwwb6uydAVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D232914 Kubilay Kocak changed: What |Removed |Added ---------------------------------------------------------------------------- Flags| |maintainer-feedback?(sjg@Fr | |eeBSD.org), | |maintainer-feedback?(cem@fr | |eebsd.org), | |maintainer-feedback?(jhb@Fr | |eeBSD.org) Version|CURRENT |12.3-STABLE CC| |cem@freebsd.org, | |jhb@FreeBSD.org, | |sjg@FreeBSD.org See Also| |https://bugs.freebsd.org/bu | |gzilla/show_bug.cgi?id=3D7= 697 | |2 Severity|Affects Only Me |Affects Some People Status|New |Open Summary|Integer overflow in |kern/kern_resource: Integer |function calcru1 |overflow in function | |calcru1 Keywords| |needs-qa --- Comment #1 from Kubilay Kocak --- I believe I've reproduced this on a 12.3-RELEASE-p5 GENERIC amd64 virtualbox virtual machine. After suspending the guest and upgrading virtualbox (on host) and resuming,= the following was logged in /var/log/messages: Jul 28 00:34:10 123-RELEASE-p5-amd64-9e36 kernel: calcru: runtime went backwards from 5425487903787745 usec to 18518189771 usec for pid 11 (idle) Additionally, the following is observed in top output: PID JID USERNAME THR PRI NICE SIZE RES SWAP STATE C TIME= =20=20=20 WCPU COMMAND 11 0 root 2 155 ki31 0B 32K 0B RUN 0 ??? 199.70% [idle] Originally running `ps -p` on the idle process id showed time and system not changing: [koobs@123-RELEASE-p5-amd64-9e36:/usr/ports] ps -p 17087 -o comm,time,systi= me COMMAND TIME SYSTIME=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 [koobs@123-RELEASE-p5-amd64-9e36:/usr/ports] ps -p 11 -o comm,time,systime COMMAND TIME SYSTIME idle 90424922:45.67 90424922:45.67 [koobs@123-RELEASE-p5-amd64-9e36:/usr/ports] ps -p 11 -o comm,time,systime COMMAND TIME SYSTIME idle 90424922:45.67 90424922:45.67 [koobs@123-RELEASE-p5-amd64-9e36:/usr/ports] ps -p 11 -o comm,time,systime COMMAND TIME SYSTIME idle 90424922:45.67 90424922:45.67 [koobs@123-RELEASE-p5-amd64-9e36:/usr/ports] ps -p 11 -o comm,time,systime COMMAND TIME SYSTIME idle 90424922:45.67 90424922:45.67 [koobs@123-RELEASE-p5-amd64-9e36:/usr/ports] ps -p 11 -o comm,time,systime COMMAND TIME SYSTIME idle 90424922:45.67 90424922:45.67 But after a small period of time started changing again: [koobs@123-RELEASE-p5-amd64-9e36:/usr/ports] ps -p 11 -o comm,time,systime COMMAND TIME SYSTIME idle 90424939:04.68 90424939:04.68 [koobs@123-RELEASE-p5-amd64-9e36:/usr/ports] ps -p 11 -o comm,time,systime COMMAND TIME SYSTIME idle 90424939:05.76 90424939:05.76 [koobs@123-RELEASE-p5-amd64-9e36:/usr/ports] ps -p 11 -o comm,time,systime COMMAND TIME SYSTIME idle 90424939:06.43 90424939:06.43 Looking at kern/kern_resource history: 1) Conrad (cem) resolved a calcru1 overflow in base 23e5e43ccd0f via bug 76= 972 (Bruce followed up with base 23e5e43ccd0f) 2) Simon (sjg) disabled the message for virtual machines in base bacb140f31= aa via review D33902 (unsure whether this was eventually MFC'd or not, the com= mit didn't include MFC tag) There may be behaviour improvements possible in this case, particularly for= the '???' reported times in top. In particular: 1) Had the message been disabled in my (VM) case, I would not have been abl= e to correlate/isolate the cause via dmesg 2) What could we report for runtime in the event of overflow instead of '??= ?' What do other OS's do? With dynamic frequency/power scaling being the norm these days, increasing heterogeneity in system hardware (big.little etc) in the future, and given = this message appears to only be an (intended) 'report' or diagnostic message sol= ely to indicate the state change (and not a fatal error) ... 3) What other ways might FreeBSD more broadly/gracefully handle timing chan= ges going forward? ^Triage: Request feedback from Conrad re (remaining?) calcru1 overflow and Simon/John re virtual machine situation. --=20 You are receiving this mail because: You are the assignee for the bug.=