Re: pvbus: pass M_ZERO properly

2022-12-21 Thread Michael Knudsen
On Wed, Dec 21, 2022 at 01:08:14PM +0100, Claudio Jeker wrote: > In general I think finding such errors quickly would be nice. > Is there a way to make this a compile time error? I guess that requires > some ugly macro magic. I agree a compile time check would be better but I don't have a good ide

Re: pvbus: pass M_ZERO properly

2022-12-21 Thread Claudio Jeker
On Tue, Dec 13, 2022 at 12:33:03AM +0100, Michael Knudsen wrote: > We can detect this class of error by redefining the flags to > use the high bits instead of the low ones. This way the malloc() > KMEMSTAT value check triggers because 0x1000 is greater than > the maximum type value. > > I tes

Re: pvbus: pass M_ZERO properly

2022-12-12 Thread Michael Knudsen
We can detect this class of error by redefining the flags to use the high bits instead of the low ones. This way the malloc() KMEMSTAT value check triggers because 0x1000 is greater than the maximum type value. I tested the following, and it boots fine, and when I moved M_ZERO to the type fie

Re: pvbus: pass M_ZERO properly

2022-12-07 Thread Theo de Raadt
Yes YASUOKA Masahiko wrote: > This is obvious. M_ZERO must be for 3rd argument. > > ok? > > Index: sys/dev/pv/pvbus.c > === > RCS file: /cvs/src/sys/dev/pv/pvbus.c,v > retrieving revision 1.25 > diff -u -p -r1.25 pvbus.c > --- sy

Re: pvbus: pass M_ZERO properly

2022-12-07 Thread Masato Asou
ok asou@ From: YASUOKA Masahiko Date: Thu, 08 Dec 2022 11:35:33 +0900 (JST) > This is obvious. M_ZERO must be for 3rd argument. > > ok? > > Index: sys/dev/pv/pvbus.c > === > RCS file: /cvs/src/sys/dev/pv/pvbus.c,v > retrieving re

Re: pvbus: pass M_ZERO properly

2022-12-07 Thread Vitaliy Makkoveev
ok mvs@ > On 8 Dec 2022, at 05:35, YASUOKA Masahiko wrote: > > This is obvious. M_ZERO must be for 3rd argument. > > ok? > > Index: sys/dev/pv/pvbus.c > === > RCS file: /cvs/src/sys/dev/pv/pvbus.c,v > retrieving revision 1.25 > d

Re: pvbus: pass M_ZERO properly

2022-12-07 Thread Mike Larkin
On Thu, Dec 08, 2022 at 11:35:33AM +0900, YASUOKA Masahiko wrote: > This is obvious. M_ZERO must be for 3rd argument. > > ok? > > Index: sys/dev/pv/pvbus.c > === > RCS file: /cvs/src/sys/dev/pv/pvbus.c,v > retrieving revision 1.25 >

pvbus: pass M_ZERO properly

2022-12-07 Thread YASUOKA Masahiko
This is obvious. M_ZERO must be for 3rd argument. ok? Index: sys/dev/pv/pvbus.c === RCS file: /cvs/src/sys/dev/pv/pvbus.c,v retrieving revision 1.25 diff -u -p -r1.25 pvbus.c --- sys/dev/pv/pvbus.c 25 Aug 2022 17:38:16 - 1