NetBSD Problem Report #60780
From www@netbsd.org Wed Sep 23 20:50:04 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 406DC1A923B
for <gnats-bugs@gnats.NetBSD.org>; Wed, 23 Sep 2026 20:50:04 +0000 (UTC)
Message-Id: <20260923205002.F3F321A923E@mollari.NetBSD.org>
Date: Wed, 23 Sep 2026 20:50:02 +0000 (UTC)
From: als@thangorodrim.ch
Reply-To: als@thangorodrim.ch
To: gnats-bugs@NetBSD.org
Subject: UBSan complains about left-shifting outside of int type range
X-Send-Pr-Version: www-1.0
X-From4GNATS: "als@thangorodrim.ch via gnats" <gnats-admin@NetBSD.org>
>Number: 60780
>Category: port-mips
>Synopsis: UBSan complains about left-shifting outside of int type range
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: port-mips-maintainer
>State: needs-pullups
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Sep 23 20:55:00 +0000 2026
>Closed-Date:
>Last-Modified: Thu Oct 15 12:32:34 +0000 2026
>Originator: Alexander Schreiber
>Release: HEAD/20260919024529Z
>Organization:
Not Much
>Environment:
Currently not available, but uname reports as evbmips 11.99.8
>Description:
HEAD/20260919024529Z configured with all available debug/diag options starts
spitting out complains from UBSan:
[ 1.0000000] UBSan: Undefined Behavior in /usr/build/HEAD_20260919024529Z/usr/src/sys/arch/mips/mips/mips_machdep.c:1117:20, left shift of 55 by 26 places cannot be represented in type 'int'
[ 1.0000000] UBSan: Undefined Behavior in /usr/build/HEAD_20260919024529Z/usr/src/sys/arch/mips/mips/mips_fixup.c:481:2, left shift of negative value -8
[ 1.0000000] UBSan: Undefined Behavior in /usr/build/HEAD_20260919024529Z/usr/src/sys/arch/mips/mips/mips_fixup.c:491:46, left shift of negative value -8
>How-To-Repeat:
HEAD/20260919024529Z configured with all available debug/diag options:
----------------------- cut here -----------------------
--- OCTEON 2026-07-07 08:14:15.000000000 +0000
+++ ERLITE3 2026-09-21 20:42:03.269928587 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: OCTEON,v 1.19 2026/07/07 08:14:15 kbowling Exp $
+# $NetBSD: OCTEON,v 1.14 2024/01/29 18:27:11 christos Exp $
include "arch/mips/conf/std.octeon"
include "arch/evbmips/conf/files.octeon"
@@ -12,6 +12,31 @@
options FDT
options FDT_DEFAULT_STDOUT_PATH="\"uart0:115200n8\""
+
+
+# MP
+options MULTIPROCESSOR
+
+# Kernel Undefined Behavior Sanitizer (kUBSan).
+options KUBSAN # mandatory
+#options UBSAN_ALWAYS_FATAL # optional: panic on all kUBSan reports
+
+# Kernel Code Coverage Driver.
+makeoptions KCOV=1
+options KCOV
+
+# Heartbeat checks
+options HEARTBEAT
+options HEARTBEAT_MAX_PERIOD_DEFAULT=15
+
+
+
+
+
+
+# config
+options INCLUDE_CONFIG_FILE
+
# Options for necessary to use MD
#options MEMORY_DISK_HOOKS
#options MEMORY_DISK_IS_ROOT # force root on memory disk
@@ -34,10 +59,10 @@
# Debugging options
options DIAGNOSTIC # extra kernel sanity checking
-#options DEBUG # extra kernel debugging support
+options DEBUG # extra kernel debugging support
+options LOCKDEBUG # expensive locking checks/support
#options USERCONF # userconf(4) support
-#options SYSCTL_INCLUDE_DESCR # Include sysctl descriptions in kernel
-#options PMAP_DEBUG
+options SYSCTL_INCLUDE_DESCR # Include sysctl descriptions in kernel
options DDB # kernel dynamic debugger
options DDB_HISTORY_SIZE=100 # enable history editing in DDB
makeoptions DEBUG="-g" # compile full symbol table
----------------------- cut here -----------------------
Build and run on Ubiquiti Edgerouter Lite (Erlite3).
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: port-evbarm-maintainer->port-mips-maintainer
Responsible-Changed-By: riastradh@NetBSD.org
Responsible-Changed-When: Wed, 23 Sep 2026 21:06:45 +0000
Responsible-Changed-Why:
I know Cavium eventually got into the Arm business after the Marvell
acquisition, but I suspect this category was a mistake!
From: Alexander Schreiber <als@thangorodrim.ch>
To: gnats-bugs@netbsd.org
Cc: port-mips-maintainer@netbsd.org, port-evbarm-maintainer@netbsd.org,
netbsd-bugs@netbsd.org, gnats-admin@netbsd.org,
riastradh@netbsd.org
Subject: Re: port-mips/60780 (UBSan complains about left-shifting outside of
int type range)
Date: Wed, 23 Sep 2026 23:34:35 +0200
On Wed, Sep 23, 2026 at 09:06:46PM +0000, riastradh@NetBSD.org wrote:
> Synopsis: UBSan complains about left-shifting outside of int type range
>
> Responsible-Changed-From-To: port-evbarm-maintainer->port-mips-maintainer
> Responsible-Changed-By: riastradh@NetBSD.org
> Responsible-Changed-When: Wed, 23 Sep 2026 21:06:45 +0000
> Responsible-Changed-Why:
> I know Cavium eventually got into the Arm business after the Marvell
> acquisition, but I suspect this category was a mistake!
*ouch* Sorry for that, yes, it is actually port-evbmips, I misclicked.
Kind regards,
Alex.
--
"Opportunity is missed by most people because it is dressed in overalls and
looks like work." -- Thomas A. Edison
From: "Nick Hudson" <skrll@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/60780 CVS commit: src/sys/arch/mips/mips
Date: Thu, 24 Sep 2026 06:08:36 +0000
Module Name: src
Committed By: skrll
Date: Thu Sep 24 06:08:36 UTC 2026
Modified Files:
src/sys/arch/mips/mips: mips_fixup.c
Log Message:
mips: address some UB in mips_fixup.c (part 1)
PR/60780 (UBSan complains about left-shifting outside of int type range)
To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/mips/mips/mips_fixup.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Nick Hudson" <skrll@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/60780 CVS commit: src/sys/arch/mips/mips
Date: Thu, 24 Sep 2026 08:10:15 +0000
Module Name: src
Committed By: skrll
Date: Thu Sep 24 08:10:15 UTC 2026
Modified Files:
src/sys/arch/mips/mips: mips_fixup.c
Log Message:
mips: address some UB in mips_fixup.c (part 2)
PR/60780 (UBSan complains about left-shifting outside of int type range)
To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/mips/mips/mips_fixup.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Nick Hudson" <skrll@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/60780 CVS commit: src/sys/arch/mips/mips
Date: Thu, 24 Sep 2026 14:20:38 +0000
Module Name: src
Committed By: skrll
Date: Thu Sep 24 14:20:38 UTC 2026
Modified Files:
src/sys/arch/mips/mips: mips_fixup.c
Log Message:
Fix previous and make it less ugly in the process
PR/60780 (UBSan complains about left-shifting outside of int type range)
To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/mips/mips/mips_fixup.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->pending-pullups
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Fri, 25 Sep 2026 06:30:38 +0000
State-Changed-Why:
[pullup-11 #497] PR/60780 (UBSan complains about left-shifting outside of int type range)
From: Alexander Schreiber <als@thangorodrim.ch>
To: gnats-bugs@netbsd.org
Cc: port-mips-maintainer@netbsd.org, netbsd-bugs@netbsd.org,
gnats-admin@netbsd.org, skrll@netbsd.org
Subject: Re: port-mips/60780 (UBSan complains about left-shifting outside of
int type range)
Date: Sun, 27 Sep 2026 00:02:50 +0200
On Fri, Sep 25, 2026 at 06:30:38AM +0000, skrll@NetBSD.org wrote:
> Synopsis: UBSan complains about left-shifting outside of int type range
>
> State-Changed-From-To: open->pending-pullups
> State-Changed-By: skrll@NetBSD.org
> State-Changed-When: Fri, 25 Sep 2026 06:30:38 +0000
> State-Changed-Why:
> [pullup-11 #497] PR/60780 (UBSan complains about left-shifting outside of int type range)
I build a new kernel from HEAD/20260925044118Z and found a few more of those:
[ 1.0000000] UBSan: Undefined Behavior in /usr/build/HEAD_20260925044118Z/usr/src/sys/lib/libkern/../../../common/lib/libc/string/memset2.c:104:15, left shift of 4294967295 by 32 places cannot be represented in type 'long int'
[ 1.0000000] UBSan: Undefined Behavior in /usr/build/HEAD_20260925044118Z/usr/src/sys/external/bsd/dwc2/dist/dwc2_core.c:560:22, left shift of 1 by 31 places cannot be represented in type 'int'
[ 1.0000000] UBSan: Undefined Behavior in /usr/build/HEAD_20260925044118Z/usr/src/sys/external/bsd/dwc2/dist/dwc2_core.c:3312:46, left shift of 65535 by 16 places cannot be represented in type 'int'
[ 1.0000000] UBSan: Undefined Behavior in /usr/build/HEAD_20260925044118Z/usr/src/sys/external/bsd/dwc2/dist/dwc2_core.c:3314:44, left shift of 65535 by 16 places cannot be represented in type 'int'
[ 1.0000000] UBSan: Undefined Behavior in /usr/build/HEAD_20260925044118Z/usr/src/sys/external/bsd/dwc2/dist/dwc2_core.c:3435:34, left shift of 65535 by 16 places cannot be represented in type 'int'
[ 1.0000000] UBSan: Undefined Behavior in /usr/build/HEAD_20260925044118Z/usr/src/sys/external/bsd/dwc2/dist/dwc2_core.c:458:12, left shift of 1 by 31 places cannot be represented in type 'int'
[ 1.0000000] UBSan: Undefined Behavior in /usr/build/HEAD_20260925044118Z/usr/src/sys/external/bsd/dwc2/dist/dwc2_core.c:1737:15, left shift of 262143 by 14 places cannot be represented in type 'int'
[ 1.0000000] UBSan: Undefined Behavior in /usr/build/HEAD_20260925044118Z/usr/src/sys/external/bsd/dwc2/dist/dwc2_core.c:1144:29, left shift of 65535 by 16 places cannot be represented in type 'int'
[ 1.0000000] UBSan: Undefined Behavior in /usr/build/HEAD_20260925044118Z/usr/src/sys/external/bsd/dwc2/dist/dwc2_core.c:1155:29, left shift of 65535 by 16 places cannot be represented in type 'int'
[ 1.0000000] UBSan: Undefined Behavior in /usr/build/HEAD_20260925044118Z/usr/src/sys/external/bsd/dwc2/dist/dwc2_core.c:1263:15, left shift of 1 by 31 places cannot be represented in type 'int'
[ 1.0000000] UBSan: Undefined Behavior in /usr/build/HEAD_20260925044118Z/usr/src/sys/external/bsd/dwc2/dist/dwc2_core.c:1274:14, left shift of 1 by 31 places cannot be represented in type 'int'
[ 1.0000000] UBSan: Undefined Behavior in /usr/build/HEAD_20260925044118Z/usr/src/sys/external/bsd/dwc2/dist/dwc2_core.c:1288:22, left shift of 1 by 31 places cannot be represented in type 'int'
[ 1.0000030] UBSan: Undefined Behavior in /usr/build/HEAD_20260925044118Z/usr/src/sys/external/bsd/dwc2/dist/dwc2_coreintr.c:508:23, left shift of 1 by 31 places cannot be represented in type 'int'
[ 1.0000030] UBSan: Undefined Behavior in /usr/build/HEAD_20260925044118Z/usr/src/sys/external/bsd/dwc2/dist/dwc2_coreintr.c:565:16, left shift of 1 by 31 places cannot be represented in type 'int'
[ 1.5800090] UBSan: Undefined Behavior in /usr/build/HEAD_20260925044118Z/usr/src/sys/external/bsd/dwc2/dist/dwc2_core.c:1476:15, left shift of 262143 by 14 places cannot be represented in type 'int'
[ 1.6000090] UBSan: Undefined Behavior in /usr/build/HEAD_20260925044118Z/usr/src/sys/external/bsd/dwc2/dist/dwc2_core.c:2055:12, left shift of 1 by 31 places cannot be represented in type 'int'
Kind regards,
Alex.
--
"Opportunity is missed by most people because it is dressed in overalls and
looks like work." -- Thomas A. Edison
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/60780 CVS commit: src/sys/external/bsd/dwc2/dist
Date: Sat, 26 Sep 2026 22:21:16 +0000
Module Name: src
Committed By: riastradh
Date: Sat Sep 26 22:21:16 UTC 2026
Modified Files:
src/sys/external/bsd/dwc2/dist: dwc2_hw.h
Log Message:
dwc2: Minimal change to avoid shifty UB.
PR port-mips/60780: UBSan complains about left-shifting outside of int
type range
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/dwc2/dist/dwc2_hw.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/60780 CVS commit: [netbsd-11] src/sys/arch/mips/mips
Date: Fri, 2 Oct 2026 10:15:59 +0000
Module Name: src
Committed By: martin
Date: Fri Oct 2 10:15:59 UTC 2026
Modified Files:
src/sys/arch/mips/mips [netbsd-11]: mips_fixup.c
Log Message:
Pull up following revision(s) (requested by skrll in ticket #497):
sys/arch/mips/mips/mips_fixup.c: revision 1.27
sys/arch/mips/mips/mips_fixup.c: revision 1.28
sys/arch/mips/mips/mips_fixup.c: revision 1.29
mips: address some UB in mips_fixup.c (part 1)
PR/60780 (UBSan complains about left-shifting outside of int type range)
mips: address some UB in mips_fixup.c (part 2)
PR/60780 (UBSan complains about left-shifting outside of int type range)
Fix previous and make it less ugly in the process
PR/60780 (UBSan complains about left-shifting outside of int type range)
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.2.1 src/sys/arch/mips/mips/mips_fixup.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Alexander Schreiber <als@thangorodrim.ch>
To: gnats-bugs@netbsd.org
Cc: port-mips-maintainer@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: port-mips/60780 (UBSan complains about left-shifting outside of
int type range)
Date: Sat, 3 Oct 2026 00:30:41 +0200
And after about a day of uptime on the Edgerouter4 with HEAD/20260930062955Z
I got another UBSan complaint on the console:
login: [ 41529.7835478] UBSan: Undefined Behavior in /usr/build/HEAD_20260930062955Z/usr/src/sys/kern/kern_ntptime.c:663:3, left shift of negative value -110853
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/60780 CVS commit: src/sys/kern
Date: Sat, 3 Oct 2026 00:13:34 +0000
Module Name: src
Committed By: riastradh
Date: Sat Oct 3 00:13:33 UTC 2026
Modified Files:
src/sys/kern: kern_ntptime.c
Log Message:
ntp(9): Avoid more left shift of negative UB.
This logic is, presumably, intended to compute integer arithmetic, so
just write it as *16 instead of <<4. If there's an advantage to
using a machine shift instruction to get the same semantics, the
compiler can do that for us.
Also avoid arithmetic overflow. If set a few lines above,
time_monitor can lie anywhere in the interval [-MAXPHASE,MAXPHASE] =
[-500e6,500e6]. Multiplying by sixteen can therefore overflow the
bounds [-2.2e9,2.2e9] of long on LP32 platforms by a factor of four.
But mtemp >= 256 here, so even if time_monitor*16 overflows the
signed 32-bit range, the result (time_monitor*16)/mtemp will not.
Hence: cast to int64_t for the intermediate computation of
time_monitor*16.
This isn't the end of the analysis: time_monitor can also be set in
hardpps(9) to something else whose bounds aren't as clear to me, but
that only applies under `options PPS_SYNC' which is usually not set.
Perhaps we need to enforce bounds on that too.
PR port-mips/60780: UBSan complains about left-shifting outside of
int type range
To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/kern/kern_ntptime.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Alexander Schreiber <als@thangorodrim.ch>
To: gnats-bugs@netbsd.org
Cc: port-mips-maintainer@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: port-mips/60780 (UBSan complains about left-shifting outside of
int type range)
Date: Sun, 4 Oct 2026 18:51:38 +0200
just built and booted from HEAD/20261002154359Z and during bootup there
is one remaining UBSan complaint about integer shifting on the EdgeRouter4:
[ 1.000000] UBSan: Undefined Behavior in /usr/build/HEAD_20261002154359Z/usr/src/sys/lib/libkern/../../../common/lib/libc/string/memset2.c:104:15, left shift of 4294967295 by 32 places cannot be represented in type 'long int'
(The kern_ntptime.c complaint is also still there, but that's because the
snapshot I used predates the patch for it, so I'm ignoring that one.)
From: Robert Elz <kre@munnari.OZ.AU>
To: Alexander Schreiber <als@thangorodrim.ch>
Cc: gnats-bugs@netbsd.org, port-mips-maintainer@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: port-mips/60780 (UBSan complains about left-shifting outside of int type range)
Date: Mon, 05 Oct 2026 02:59:13 +0700
Date: Sun, 4 Oct 2026 18:51:38 +0200
From: Alexander Schreiber <als@thangorodrim.ch>
Message-ID: <asKEGjZEnL3Q11ak@mordor.angband.thangorodrim.de>
| just built and booted from HEAD/20261002154359Z and during bootup there
| is one remaining UBSan complaint about integer shifting on the EdgeRouter4:
|
| [ 1.000000] UBSan: Undefined Behavior in /usr/build/HEAD_20261002154359Z/usr/src/sys/lib/libkern/../../../common/lib/libc/string/memset2.c:104:15, left shift of 4294967295 by 32 places cannot be represented in type 'long int'
This one is an easy fix (I believe) - I am testing a build now.
The data type is (according to the comments) intended to be unsigned,
but it is relying upon __register_t being unsigned to achieve that.
That may once have been a valid assumption (I have no idea) but it
certainly is not any more.
kre
From: "Robert Elz" <kre@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/60780 CVS commit: src/common/lib/libc/string
Date: Mon, 5 Oct 2026 05:12:46 +0000
Module Name: src
Committed By: kre
Date: Mon Oct 5 05:12:46 UTC 2026
Modified Files:
src/common/lib/libc/string: memset2.c
Log Message:
PR port-mips/60780 UBSan: long int << fix (src/common/lib/libc/string/memset2.c)
The comments say that memword_t is intended to be unsigned, but
presume that __register_t will provide that attribute. It usually
doesn't, so we need an unsigned type for building the fill value.
Thanks to Alexander Schreiber for running the UBSan built system
and reporting this (and others), and hopefully, in advance for
testing that this one is now fixed.
XXX - pullup -11 -10 (probably, it cannot possibly hurt)
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/common/lib/libc/string/memset2.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: pending-pullups->needs-pullups
State-Changed-By: kre@NetBSD.org
State-Changed-When: Tue, 13 Oct 2026 09:17:14 +0000
State-Changed-Why:
Pullup #497 was done. More pullups are needed however.
State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: kre@NetBSD.org
State-Changed-When: Tue, 13 Oct 2026 09:20:05 +0000
State-Changed-Why:
[pullup-11 #523] - this is for the common/libc/memset2.c fix
There will need to be more pullups for this PR after this one.
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/60780 CVS commit: [netbsd-11] src/common/lib/libc/string
Date: Wed, 14 Oct 2026 17:48:24 +0000
Module Name: src
Committed By: martin
Date: Wed Oct 14 17:48:24 UTC 2026
Modified Files:
src/common/lib/libc/string [netbsd-11]: memset2.c
Log Message:
Pull up following revision(s) (requested by kre in ticket #523):
common/lib/libc/string/memset2.c: revision 1.12
PR port-mips/60780 UBSan: long int << fix (src/common/lib/libc/string/memset2.c)
The comments say that memword_t is intended to be unsigned, but
presume that __register_t will provide that attribute. It usually
doesn't, so we need an unsigned type for building the fill value.
Thanks to Alexander Schreiber for running the UBSan built system
and reporting this (and others), and hopefully, in advance for
testing that this one is now fixed.
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.10.1 src/common/lib/libc/string/memset2.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: pending-pullups->needs-pullups
State-Changed-By: kre@NetBSD.org
State-Changed-When: Wed, 14 Oct 2026 18:32:02 +0000
State-Changed-Why:
Current request pullups complete, more are probably needed.
State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: kre@NetBSD.org
State-Changed-When: Wed, 14 Oct 2026 18:46:58 +0000
State-Changed-Why:
[pullup-10 #1364]
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/60780 CVS commit: [netbsd-10] src/common/lib/libc/string
Date: Thu, 15 Oct 2026 07:50:57 +0000
Module Name: src
Committed By: martin
Date: Thu Oct 15 07:50:57 UTC 2026
Modified Files:
src/common/lib/libc/string [netbsd-10]: memset2.c
Log Message:
Pull up following revision(s) (requested by kre in ticket #1364):
common/lib/libc/string/memset2.c: revision 1.12
PR port-mips/60780 UBSan: long int << fix (src/common/lib/libc/string/memset2.c)
The comments say that memword_t is intended to be unsigned, but
presume that __register_t will provide that attribute. It usually
doesn't, so we need an unsigned type for building the fill value.
Thanks to Alexander Schreiber for running the UBSan built system
and reporting this (and others), and hopefully, in advance for
testing that this one is now fixed.
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.2.1 src/common/lib/libc/string/memset2.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: pending-pullups->needs-pullups
State-Changed-By: kre@NetBSD.org
State-Changed-When: Thu, 15 Oct 2026 12:32:34 +0000
State-Changed-Why:
pullup -10 #1364 completed
More pullups of other changes probably required
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.