NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/58425: negation of pid or pgid is UB for INT_MIN



The following reply was made to PR kern/58425; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: matthew green <mrg%eterna23.net@localhost>
Cc: netbsd-bugs%netbsd.org@localhost, gnats-bugs%netbsd.org@localhost
Subject: Re: kern/58425: negation of pid or pgid is UB for INT_MIN
Date: Sun, 14 Jul 2024 13:26:53 +0700

     Date:        Sun, 14 Jul 2024 14:57:10 +1000
     From:        matthew green <mrg%eterna23.net@localhost>
     Message-ID:  <22479.1720933030%splode.eterna23.net@localhost>
 
   | i recently was dealing with a trap related to exactly this.
   |
   | i was running atf on m68k virt68k qemu and it crashed the emulator
   | itself.  turns out -INT_MAX/-1 traps on x86.
 
 I think you mean INT_MIN / -1 (INT_MIN != -INT_MAX - which is the whole
 issue).
 
 That would be a different problem than the pid one, which is just
 taking -INT_MIN, no division, by anything, ever performed (I'm not
 sure what a half of a pid_t would represent).   Further, it should
 be fixed in the kernel now.
 
   | i have this uncommited/unsubmitted patch for qemu:
   |    https://www.netbsd.org/~mrg/patch-target_m68k_op_helper.c
 
 Looks reasonable to me.   Though I know nothing about qemu
 
 kre
 


Home | Main Index | Thread Index | Old Index