Re: passwd(1) does not need librpcsvc

2022-01-27 Thread Benjamin Baier
On Thu, 27 Jan 2022 15:17:01 + Miod Vallat wrote: > > Hi, > > > > linking with librpcsvc should be superfluous now. > > Then you should also update DPADD to remove $(LIBRPCSVC}... > Patch V2 Index: Makefile === RCS file:

passwd(1) does not need librpcsvc

2022-01-27 Thread Benjamin Baier
Hi, linking with librpcsvc should be superfluous now. Index: Makefile === RCS file: /var/cvs/src/usr.bin/passwd/Makefile,v retrieving revision 1.41 diff -u -p -r1.41 Makefile --- Makefile26 Nov 2015 19:01:47 - 1.41 +++

Re: possible memory leak in ipmi get_sdr

2022-01-14 Thread Benjamin Baier
On Fri, 14 Jan 2022 09:25:53 +0100 Moritz Buhl wrote: > I thought I'd walk through my understanding of the code > to make it easier to review. > > from sys/dev/ipmi.c: > > 1019 int > 1020 get_sdr(struct ipmi_softc *sc, u_int16_t recid, u_int16_t *nxtrec) > 1021 { > ... > 1046 psdr =

Re: update xf86-video-amdgpu to latest git

2021-07-31 Thread Benjamin Baier
On Thu, 8 Jul 2021 17:29:01 +1000 Jonathan Gray wrote: > The latest xf86-video-amdgpu release was in 2019. > > xf86-video-amdgpu-19.1.0..origin/master > > minus commits we already have > cb27a5b Handle NULL fb_ptr in pixmap_get_fb > e2cd67a Bail from amdgpu_pixmap_get_handle with ShadowFB >

Manpage fix: passwd.1

2021-04-14 Thread Benjamin Baier
Hi, don't mention _PASSWORD_LEN in passwd manpage. It's also no longer true, since Rev1.52, local_passwd.c uses 1024 bytes for the password array. Greetings Ben Index: passwd.1 === RCS file: /var/cvs/src/usr.bin/passwd/passwd.1,v

ksh vi.c: define CTRL locally

2021-03-11 Thread Benjamin Baier
Hi, lets's sync up vi.c with emacs.c and define CTRL locally. Makes the portable version work on FreeBSD https://github.com/ibara/oksh/issues/59 And as a bonus makes ksh -DSMALL compile with -DVI. Greetings Ben Index: vi.c === RCS

Re: ksh: [vi.c] "clear-screen" bug + patch

2021-03-09 Thread Benjamin Baier
Ping On Sat, 21 Nov 2020 18:59:25 +0200 Πάτερος Πέτρος wrote: > Hello everyone, > > I am sending this because of an issue I had with a ported version of > your ksh(1) on Linux (you can find the port at > https://github.com/ibara/oksh), but everything I say here are also > tested on a VM

Throttle inteldrm GPU when CPU is throttled (was [WIP] new sysctl hw.gpuperf)

2021-02-25 Thread Benjamin Baier
} return 0; } Index: kern/subr_gpuperf.c === RCS file: kern/subr_gpuperf.c diff -N kern/subr_gpuperf.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ kern/subr_gpuperf.c 18 Jul 2020 19:43:06 - @@ -0,0 +1,79 @@ +/* $Open

malloc.conf and pledge

2021-01-19 Thread Benjamin Baier
Hi, /etc/malloc.conf is long gone(6.5). Time to remove the special case? Xenocara is clean. Base only mentions malloc.conf in a comment in regress/usr.bin/ssh/connect-privsep.sh. Ports mention /etc/malloc.conf in an old and unused systrace policy. Ports with jemalloc should never use

Re: fix off by one in amdgpu_vm_handle_fault

2020-11-12 Thread Benjamin Baier
On Fri, 13 Nov 2020 00:16:12 +1100 Jonathan Gray wrote: > On Thu, Nov 12, 2020 at 01:48:05PM +0100, Benjamin Baier wrote: > > Hi > > > > this fixes the VM_L2_PROTECTION_FAULT_STATUS I was getting. > > (and maybe also some of the bug reports, rep

fix off by one in amdgpu_vm_handle_fault

2020-11-12 Thread Benjamin Baier
Hi this fixes the VM_L2_PROTECTION_FAULT_STATUS I was getting. (and maybe also some of the bug reports, reporting L2 protection faults) It was reproduceable by running piglit run quick -t "spec@glsl-1.30@execution@texelfetch fs sampler2d 1x281-501x281" out >

Fw: Hardware UUID discrepancies (dmidecode vs. sysctl) on amd64 multiboot system

2020-11-08 Thread Benjamin Baier
Forwarding to tech@ by request from Stuart Henderson This issue came up on misc@ https://marc.info/?l=openbsd-misc=160477082230840=2 Begin forwarded message: Date: Sat, 7 Nov 2020 22:30:44 +0100 From: Benjamin Baier To: Bruce Lilly Cc: m...@openbsd.org Subject: Re: Hardware UUID discrepancies

Adapt usbhidaction.1 example to sndio changes

2020-06-23 Thread Benjamin Baier
Hi, adapt usbhidaction.1 example to sndio changes. Greetings Ben Index: usbhidaction.1 === RCS file: /var/cvs/src/usr.bin/usbhidaction/usbhidaction.1,v retrieving revision 1.14 diff -u -p -r1.14 usbhidaction.1 --- usbhidaction.1

Re: Some redundant code lines in sys

2020-06-05 Thread Benjamin Baier
On Fri, 5 Jun 2020 12:56:21 +0200 "Prof. Dr. Steffen Wendzel" wrote: > Dear all: > > just in case this appears useful to you: I found some redundant code > lines in the following files. > > sys/net/pipex.h: >struct pipex_session *pipex_pppoe_lookup_session (struct mbuf *); >struct

Re: [patch] azalia: Intel 300 Series HD Audio

2020-05-31 Thread Benjamin Baier
On Fri, 29 May 2020 11:25:44 +0200 Bruno Flueckiger wrote: > Hi, > > My brand new laptop HP EliteBook 850 G6 comes with an Intel 300 Series > HD Audio device rev 0x11. The device shows up as not configured in the > dmesg. The PCI config space of the device identifies its subclass as >

Re: userland clock_gettime proof of concept

2020-05-13 Thread Benjamin Baier
On Wed, 13 May 2020 16:09:57 +0200 Robert Nagy wrote: > On 13/05/20 17:03 +0300, Paul Irofti wrote: > > Here is a stress test from robert@: > > > > robert@x202:/home/robert> time ./t && time ./t2 > > 0m00.11s real 0m00.12s user 0m00.00s system > > 0m09.99s real 0m02.64s user 0m03.36s system > >

pfkeyv2.c: Mem leak

2020-03-04 Thread Benjamin Baier
Hi, pfkeyv2.c:1091:pfkeyv2_send(struct socket *so, void *message, int len) leaks memory in the SADB_REGISTER case (line 1579). It reuses void *freeme multiple times to build up void *headers[]. headers[] are bcopy'ed to another buffer inside of pfkeyv2_sendmessage() (line 2064) so as the name

pfioctl needs to ignore unknown af

2020-01-08 Thread Benjamin Baier
Hi. pfioctl() needs to ignore unknown af supplied from userland (root only) which can lead to kernel panic. This fixes syzbot+92be143c2dd1746cf...@syzkaller.appspotmail.com https://syzkaller.appspot.com/bug?id=18bd5fa9e22c139d0a4c34dd6c7c1f3fd6eec42a -- Ben Index: pf_ioctl.c

Re: vmctl(8): uninitialized value

2020-01-02 Thread Benjamin Baier
On Thu, 2 Jan 2020 18:56:14 +0100 Klemens Nanni wrote: > On Thu, Jan 02, 2020 at 04:37:17PM +0100, Benjamin Baier wrote: > > "case CMD_SEND:" sets done=1 so ret will never be written to and > > the uninitialized value of ret is used to determine the return > >

vmctl(8): uninitialized value

2020-01-02 Thread Benjamin Baier
Hi. "case CMD_SEND:" sets done=1 so ret will never be written to and the uninitialized value of ret is used to determine the return value of the function vmmaction. -- Ben Index: main.c === RCS file:

kill VNDIOCGET60

2019-11-18 Thread Benjamin Baier
Hi, found this. -- Ben Index: vndioctl.h === RCS file: /cvs/src/sys/dev/vndioctl.h,v retrieving revision 1.10 diff -u -p -r1.10 vndioctl.h --- vndioctl.h 14 Dec 2016 18:59:12 - 1.10 +++ vndioctl.h 18 Nov 2019 20:11:50

Comment fix: No mcontext

2019-07-12 Thread Benjamin Baier
Hi, there is no mcontext, and since V1.2 of process_machdep.c struct reg and struct trapframe don't have to be closely synced. process_machdep.c no longer memcpy's one to the other. Greetings Ben Thu Jul 11 23:45:14 CEST 2019 /home/cvsgit/hellfish/src/sys/arch/amd64/include Index: reg.h

Re: [WIP] new sysctl hw.gpuperf

2019-06-28 Thread Benjamin Baier
On Mon, 24 Jun 2019 13:02:52 +0200 Benjamin Baier wrote: > Hi, > > this is wip for a new sysctl that implements gpu throttling. > Only implemented for inteldrm right now, and tested on a single amd64 > laptop. Helps to keep the GPU/CPU cooler and save some energy. >

[WIP] new sysctl hw.gpuperf

2019-06-24 Thread Benjamin Baier
(hw_vendor) Index: kern/subr_gpuperf.c === RCS file: kern/subr_gpuperf.c diff -N kern/subr_gpuperf.c --- /dev/null 1 Jan 1970 00:00:00 - +++ kern/subr_gpuperf.c 24 Jun 2019 10:04:35 - @@ -0,0 +1,86 @@ +/* $OpenBSD$

Re: cmdfile for config -ef

2019-05-11 Thread Benjamin Baier
On Sat, 11 May 2019 13:26:14 -0600 "Theo de Raadt" wrote: > Ted Unangst wrote: > > > Benjamin Baier wrote: > > > On Sat, 11 May 2019 11:18:02 -0400 > > > "Ted Unangst" wrote: > > > > > > > This adds a new option to config

Re: cmdfile for config -ef

2019-05-11 Thread Benjamin Baier
On Sat, 11 May 2019 11:18:02 -0400 "Ted Unangst" wrote: > This adds a new option to config, -c cmdfile, that allows reading commands > from a file instead of stdin. This makes it easier to script. Interesting. Can the cmdfile be /bsd ? So something like config -u but without the need of

Re: nm(1): return on malloc error

2019-03-02 Thread Benjamin Baier
Ping. On malloc error symtab is unmapped, so proceeding on will lead to a NULL pointer dereference. On Wed, 20 Feb 2019 17:55:08 +0100 Benjamin Baier wrote: > Hi. > > When malloc fails we should return like the MMAP case does. > > Greetings Ben

nm(1): return on malloc error

2019-02-20 Thread Benjamin Baier
Hi. When malloc fails we should return like the MMAP case does. Greetings Ben Index: nm.c === RCS file: /cvs/src/usr.bin/nm/nm.c,v retrieving revision 1.53 diff -u -p -u -C10 -r1.53 nm.c *** nm.c27 Oct 2017 16:47:08 -

Re: athn(4) hostap: mem leak

2018-12-05 Thread Benjamin Baier
7:11 Full dmesg below. On Sun, 2 Dec 2018 10:15:44 +0100 Benjamin Baier wrote: > On Sat, 1 Dec 2018 15:48:13 -0200 > Martin Pieuchot wrote: > > > On 30/11/18(Fri) 13:49, Benjamin Baier wrote: > > > Hi > > > > > > There is a leak of *arg in >

Re: athn(4) hostap: mem leak

2018-12-02 Thread Benjamin Baier
On Sat, 1 Dec 2018 15:48:13 -0200 Martin Pieuchot wrote: > On 30/11/18(Fri) 13:49, Benjamin Baier wrote: > > Hi > > > > There is a leak of *arg in > > dev/usb/if_athn_usb.c:athn_usb_newauth() line 1263 > > since Rev. 1.49 > > Because athn_usb_

Re: athn(4) hostap: mem leak

2018-12-01 Thread Benjamin Baier
On Fri, 30 Nov 2018 16:55:42 +0100 Alexandre Ratchov wrote: > On Fri, Nov 30, 2018 at 01:49:56PM +0100, Benjamin Baier wrote: > > Hi > > > > There is a leak of *arg in > > dev/usb/if_athn_usb.c:athn_usb_newauth() line 1263 > > since Rev. 1.49 > &g

athn(4) hostap: mem leak

2018-11-30 Thread Benjamin Baier
Hi There is a leak of *arg in dev/usb/if_athn_usb.c:athn_usb_newauth() line 1263 since Rev. 1.49 Because athn_usb_do_async() memcpy's the argument anyway. Found with llvm/scan-build. Instead of adding free(arg) I opted to make this function more like the other ones which call

Re: video(1): measure with mono clock (tester wanted)

2018-04-07 Thread Benjamin Baier
On Fri, 6 Apr 2018 09:28:54 -0500 Scott Cheloha wrote: > So that your stats stay correct if the system clock is changed. > > This is simple enough to suggest that it's correct at a glance, > but I have no hardware to test this with. Can anyone confirm that > this works?

Re: inteldrm(4) tests needed

2018-01-15 Thread Benjamin Baier
On Mon, 15 Jan 2018 01:02:58 +0100 (CET) Mark Kettenis wrote: > The diff below adopts more of the Linux code to manage i2c > transactions on hardware supported by inteldrm(4). The i2c stuff is > reponsible for detecting panels and monitors, so it is somewhat > important

Re: snapshot installs

2016-12-30 Thread Benjamin Baier
On Fri, 30 Dec 2016 11:30:10 -0700 Theo de Raadt wrote: > I'm wondering if anyone doing an install/upgrade has noticed any > behaviour changes in the last week... Did an auto_upgrade with pre-downloaded sets today. Got curious and did one normal/manual update again from a

Re: nologin(8) overhaul

2016-03-13 Thread Benjamin Baier
Ping? Also #include could be omitted, because it gets pulled in by unistd.h. On Sun, 6 Mar 2016 16:14:14 +0100 Benjamin Baier <program...@netzbasis.de> wrote: > A /usr/bin/false vs. /sbin/nologin argument led me to nologin(8) so > here are some suggestions. > > - de-lint

nologin(8) overhaul

2016-03-06 Thread Benjamin Baier
A /usr/bin/false vs. /sbin/nologin argument led me to nologin(8) so here are some suggestions. - de-lint - return instead of exit() - no need to tell an *possible evil* ssh user that pledge(2) failed - some more churn/clean up Greetings Ben Index: nologin.c

Re: I have a mirror testing program for you. - Mirror down

2016-01-20 Thread Benjamin Baier
Important thing first, the mirror http://openbsd.cs.fau.de/pub/OpenBSD/ seems to be down. On Tue, 19 Jan 2016 22:19:42 -0600 Luke Small wrote: > I have a 500 line program I wrote that reads openbsd.org.ftp.html and > scraps off the html and ftp mirrors, records them all

npppd(8): sync option parsing with other userland utils

2015-11-08 Thread Benjamin Baier
Hello tech@ This patch brings npppd(8)'s option parsing in sync with all the other userland utils that don't recognize -h for help/usage (except for some games, still). Also exit(3) at the end of the usage() function and mark it as __dead. Greetings Ben Index: npppd/npppd.8

remove superfluous case '?': from /sbin utils

2015-11-08 Thread Benjamin Baier
Hello tech@ I cleaned up and split up my former diff[0] for removing superfluous case '?': /*FALLTHROUGH*/ default: usage(); Also removes one unnecessary break; This is for /sbin, more to come if there are any takers? Greetings Ben [0]

Part2: remove superfluous case '?': from /usr/bin utils

2015-11-08 Thread Benjamin Baier
Hello tech@ Part 2 for /usr/bin Also adjust getopt(3)'s optstring in midiplay.c and usbhid.c Greetings Ben Index: biff/biff.c === RCS file: /cvs/src/usr.bin/biff/biff.c,v retrieving revision 1.13 diff -u -p -r1.13 biff.c ---

Part3: remove superfluous case '?': from /usr/sbin utils

2015-11-08 Thread Benjamin Baier
Hello tech@ Part 3 for /usr/sbin Also adjust getopt(3)'s optstring in usbdevs.c and remove some unnecessary break; Greetings Ben Index: ac/ac.c === RCS file: /cvs/src/usr.sbin/ac/ac.c,v retrieving revision 1.24 diff -u -p -r1.24

ahci.c memory leak in error path

2015-10-02 Thread Benjamin Baier
Fix memory leak in error path. Found by llvm/scan-build. Also port (sc->sc_ports[port]) was not assigned, so "goto freeport;" seems wrong. Index: ahci.c === RCS file: /cvs/src/sys/dev/ic/ahci.c,v retrieving revision 1.22 diff -u -p

clean the tree from superfluous case '?': /* FALLTHROUGH */

2015-06-09 Thread Benjamin Baier
Hello tech@ delete case '?': /* FALLTHROUGH */ where it is already handled by default: usage();. Rarely also adjust getopt(3)'s optstring. Index: bin/pax/options.c === RCS file: /cvs/src/bin/pax/options.c,v retrieving revision

Re: clean the tree from superfluous case '?': /* FALLTHROUGH */

2015-06-09 Thread Benjamin Baier
On Tue, 9 Jun 2015 14:01:01 -0700 patrick keshishian sids...@boxsoft.com wrote: Hi, On Tue, Jun 09, 2015 at 07:46:20PM +0200, Benjamin Baier wrote: Hello tech@ delete case '?': /* FALLTHROUGH */ where it is already handled by default: usage();. Not quite sure it is correct

[PATCH] libcrypto: initialize pointer

2015-05-29 Thread Benjamin Baier
Hello tech@ buf.data is not initialized up front, which may lead to free(3)'ing a garbage pointer. Found by llvm/scan-build. Also free(3) handles NULL. No need to check. Index: tasn_dec.c === RCS file:

[PATCH 2/3] fsck(8): no need to check for NULL before free(3)

2015-05-29 Thread Benjamin Baier
No need to check for NULL before free(3) Fri May 29 10:59:23 CEST 2015 /git/hellfish/src/sbin/fsck Index: fsck.c === RCS file: /cvs/src/sbin/fsck/fsck.c,v retrieving revision 1.35 diff -u -p -r1.35 fsck.c --- fsck.c 18 Apr 2015

[PATCH 1/3] fsck(8): adjust error logic for recent erealloc to ereallocarray switch

2015-05-29 Thread Benjamin Baier
Hello tech@ adjust error logic for zero sized allocations and the error messages for the recent erealloc to ereallocarray switch. A follow up diff will clean up all if (x) free(x); statements. Index: fsutil.c === RCS file:

[PATCH 3/3] fsck(8): no need to assign variable twice

2015-05-29 Thread Benjamin Baier
This got me looking at the code first. No need to assign argc and maxargc twice. Found by llvm/scan-build --- fsck.c.p1 Fri May 29 11:01:25 2015 +++ fsck.c Fri May 29 11:02:18 2015 @@ -449,9 +447,6 @@ mangle(char *opts, int *argcp, const cha char *p, *s; int argc = *argcp,

[PATCH] sync renice(8) with manpage and POSIX and other BSDs

2015-03-20 Thread Benjamin Baier
Hello tech@, this bugs me for a while now, so I'm sendig this diff in for consideration. Brings renice(8) manpage and code and POSIX definition more in sync by: - makeing the code increment the priority instead of setting it when -n is used. - documenting the backwards compatible set priority

Re: [PATCH] sync renice(8) with manpage and POSIX and other BSDs

2015-03-20 Thread Benjamin Baier
On Fri, 20 Mar 2015 10:35:07 -0600 Todd C. Miller todd.mil...@courtesan.com wrote: We do not typically document the historic usage. However, in this case we might make an exception since the old and new syntax are semantically different (absolute vs. increment). Up to you... The only thing i

[PATCH] double free in libkeynote

2015-02-04 Thread Benjamin Baier
don't free x after y = realloc(x, N) even if y != x found by llvm/scan-build Index: keynote.l === RCS file: /cvs/src/lib/libkeynote/keynote.l,v retrieving revision 1.20 diff -u -p -U17 -r1.20 keynote.l --- keynote.l 29 Nov 2013

[PATCH] potentional double free in route6d(8)

2015-02-04 Thread Benjamin Baier
potentional double free in do-while-loop. found by llvm/scan-build Index: route6d.c === RCS file: /cvs/src/usr.sbin/route6d/route6d.c,v retrieving revision 1.64 diff -u -p -r1.64 route6d.c --- route6d.c 16 Jan 2015 06:40:20 -

Re: [PATCH]unused NULL check before calling free

2014-07-31 Thread Benjamin Baier
On 07/31/14 12:39, Fritjof Bornebusch wrote: That's why there is no need, to use a condition like: if(ptr == NULL) errx(1, xfree: NULL pointer given as argument); Yes, there is. There is a big difference between free(NULL) and xfree(NULL).

[PATCH] sasyncd: malloc/memset = calloc

2014-07-04 Thread Benjamin Baier
i got a few easy ones left... Index: net.c === RCS file: /cvs/src/usr.sbin/sasyncd/net.c,v retrieving revision 1.20 diff -u -p -r1.20 net.c --- net.c 11 Mar 2013 17:40:11 - 1.20 +++ net.c 11 Jun 2014 17:28:28

[PATCH] rtsold: malloc/memset = calloc

2014-07-04 Thread Benjamin Baier
Index: rtsold.c === RCS file: /cvs/src/usr.sbin/rtsold/rtsold.c,v retrieving revision 1.50 diff -u -p -r1.50 rtsold.c --- rtsold.c21 Oct 2013 08:46:07 - 1.50 +++ rtsold.c11 Jun 2014 17:28:11 - @@ -324,12 +324,11

[PATCH] rdist: malloc/memset = calloc

2014-07-04 Thread Benjamin Baier
Index: child.c === RCS file: /cvs/src/usr.bin/rdist/child.c,v retrieving revision 1.16 diff -u -p -r1.16 child.c --- child.c 18 Apr 2011 12:29:59 - 1.16 +++ child.c 9 Jun 2014 18:33:28 - @@ -363,7 +363,6 @@

[PATCH] rtadvd malloc/memset = calloc

2014-07-04 Thread Benjamin Baier
Index: config.c === RCS file: /cvs/src/usr.sbin/rtadvd/config.c,v retrieving revision 1.40 diff -u -p -r1.40 config.c --- config.c17 Oct 2013 16:27:48 - 1.40 +++ config.c11 Jun 2014 17:27:47 - @@ -240,9 +240,8 @@

Re: [PATCH 8] aic7xxx: malloc/memset = calloc

2014-06-06 Thread Benjamin Baier
bump. anybody care enought to commit? On Sat, 31 May 2014 13:06:16 +0200 Benjamin Baier program...@netzbasis.de wrote: Index: aicasm.c === RCS file: /cvs/src/sys/dev/microcode/aic7xxx/aicasm.c,v retrieving revision 1.15 diff -u -p

Re: [PATCH 10] inetd: malloc/memset = calloc

2014-06-06 Thread Benjamin Baier
bump. anybody? On Sat, 31 May 2014 16:40:35 +0200 Benjamin Baier program...@netzbasis.de wrote: While here also stop casting {m,c}alloc return value. Index: inetd.c === RCS file: /cvs/src/usr.sbin/inetd/inetd.c,v retrieving

Re: [PATCH 9] installboot: malloc/memset = calloc

2014-06-06 Thread Benjamin Baier
bump. anybody? On Sat, 31 May 2014 20:29:42 +0200 Benjamin Baier program...@netzbasis.de wrote: On Sun, 1 Jun 2014 00:57:43 +1000 Joel Sing j...@sing.id.au wrote: In this case I think readability wins. I do not believe that there is a lot to gain from overflow protection given

Re: exp2(3) bug?

2014-06-02 Thread Benjamin Baier
You might want to read up on floating point arithmetic. (rounding and representation) On 06/02/14 05:13, Daniel Dickman wrote: I hit this problem while working with the numpy 1.8.1 regress suite which has some tests that are currently failing. Here is a reduced test case of the logaddexp2

Re: exp2(3) bug?

2014-06-02 Thread Benjamin Baier
Ok i might have been quick to judge, because i don't really trust floating point arithmetic. btw. exp2f works correct on i386. On 06/02/14 10:17, Mark Kettenis wrote: Date: Mon, 02 Jun 2014 09:34:20 +0200 From: Benjamin Baier program...@netzbasis.de You might want to read up on floating

[PATCH 8] aic7xxx: malloc/memset = calloc

2014-05-31 Thread Benjamin Baier
Index: aicasm.c === RCS file: /cvs/src/sys/dev/microcode/aic7xxx/aicasm.c,v retrieving revision 1.15 diff -u -p -r1.15 aicasm.c --- aicasm.c5 Dec 2012 23:20:19 - 1.15 +++ aicasm.c31 May 2014 11:01:21 - @@ -500,12

[PATCH 9] installboot: malloc/memset = calloc

2014-05-31 Thread Benjamin Baier
This one splits up the malloc parameter, taking full potential from calloc, hurting readability a bit. which one is preferred? more readable/maintainable or using the calloc overflow protection? Index: bootstrap.c === RCS file:

[PATCH 10] inetd: malloc/memset = calloc

2014-05-31 Thread Benjamin Baier
While here also stop casting {m,c}alloc return value. Index: inetd.c === RCS file: /cvs/src/usr.sbin/inetd/inetd.c,v retrieving revision 1.137 diff -u -p -r1.137 inetd.c --- inetd.c 23 Nov 2013 17:24:29 - 1.137 +++

Re: [PATCH 9] installboot: malloc/memset = calloc

2014-05-31 Thread Benjamin Baier
On Sun, 1 Jun 2014 00:57:43 +1000 Joel Sing j...@sing.id.au wrote: In this case I think readability wins. I do not believe that there is a lot to gain from overflow protection given the numbers used in these calculations are very small (and many are already bounds checked in some form or

[PATCH 3] ld.so: malloc/memset = calloc

2014-05-26 Thread Benjamin Baier
Index: prebind_path.c === RCS file: /cvs/src/libexec/ld.so/ldconfig/prebind_path.c,v retrieving revision 1.2 diff -u -p -r1.2 prebind_path.c --- prebind_path.c 13 Nov 2013 05:41:43 - 1.2 +++ prebind_path.c 25 May

[PATCH 5] regress videotest: malloc/memset = calloc

2014-05-26 Thread Benjamin Baier
Index: videotest.c === RCS file: /cvs/src/regress/sys/dev/video/videotest.c,v retrieving revision 1.3 diff -u -p -r1.3 videotest.c --- videotest.c 22 Jul 2010 11:58:03 - 1.3 +++ videotest.c 25 May 2014 08:30:04 - @@

Re: [PATCH 3] ld.so: malloc/memset = calloc

2014-05-26 Thread Benjamin Baier
Those are just suggestions... I'm going trough my list so in the future a simple NO and I'll stop tracking the patch and back off. On Mon, 26 May 2014 12:57:10 -0600 Theo de Raadt dera...@cvs.openbsd.org wrote: no no, please stay out of ld.so and subdirectories. I'm working on these kinds

[PATCH 4] config: malloc/memset = calloc

2014-05-26 Thread Benjamin Baier
Index: util.c === RCS file: /cvs/src/usr.sbin/config/util.c,v retrieving revision 1.14 diff -u -p -r1.14 util.c --- util.c 18 May 2014 09:29:54 - 1.14 +++ util.c 25 May 2014 11:38:40 - @@ -62,9 +62,8 @@

[PATCH 6] rcs: xmalloc/memset = xcalloc

2014-05-26 Thread Benjamin Baier
Yes, there is a xcalloc in xmalloc.h/.c. Index: rcsutil.c === RCS file: /cvs/src/usr.bin/rcs/rcsutil.c,v retrieving revision 1.39 diff -u -p -r1.39 rcsutil.c --- rcsutil.c 16 Apr 2013 20:24:45 - 1.39 +++ rcsutil.c 25 May

[PATCH 7] npppd: malloc/memset = calloc

2014-05-26 Thread Benjamin Baier
and a big one. Index: common/bytebuf.c === RCS file: /cvs/src/usr.sbin/npppd/common/bytebuf.c,v retrieving revision 1.5 diff -u -p -r1.5 bytebuf.c --- common/bytebuf.c8 May 2012 13:15:11 - 1.5 +++ common/bytebuf.c26

[PATCH SET] malloc + memset = calloc

2014-05-25 Thread Benjamin Baier
Hi tech@ I'm just geting into the OpenBSD source code, and what better way to learn than with real work... Some malloc/memset to calloc changes. More to come if this kind of work is appreciated. Index: answer.c === RCS file:

Re: [PATCH SET] malloc + memset = calloc

2014-05-25 Thread Benjamin Baier
Now with correct tabs... sorry. Hi tech@ I'm just geting into the OpenBSD source code, and what better way to learn than with real work... Some malloc/memset to calloc changes. More to come if this kind of work is appreciated. Index: answer.c

Re: [PATCH SET] malloc + memset = calloc

2014-05-25 Thread Benjamin Baier
On Sun, 25 May 2014 10:08:06 +0100 Stuart Henderson st...@openbsd.org wrote: There are a couple like this: - pre_comp = malloc(num_points * 17 * 3 * sizeof(felem)); + pre_comp = calloc(num_points * 17 * 3, sizeof(felem)); Wouldn't they be better like this?

[PATCH SET] libssl: malloc/memset = calloc

2014-05-25 Thread Benjamin Baier
Hi tech@ patch set for libssl Index: bn_blind.c === RCS file: /cvs/src/lib/libssl/src/crypto/bn/bn_blind.c,v retrieving revision 1.9 diff -u -p -r1.9 bn_blind.c --- bn_blind.c 8 May 2014 13:20:49 - 1.9 +++ bn_blind.c 24

[PATCH 2] libssl: malloc/memset = calloc

2014-05-25 Thread Benjamin Baier
This shortens the function quite a bit. Index: str_lib.c === RCS file: /cvs/src/lib/libssl/src/crypto/store/str_lib.c,v retrieving revision 1.4 diff -u -p -r1.4 str_lib.c --- str_lib.c 17 Apr 2014 21:32:37 - 1.4 +++

Re: [PATCH SET] libssl: malloc/memset = calloc

2014-05-25 Thread Benjamin Baier
I ran cvs diff on the individual files right in the subdirectory and piping the results to one file. Yes I now see how that can be a hurdle. I'll step it up. 05/25/14 22:32, Ted Unangst wrote: I didn't notice this before because everything was in different directories so I pulled it apart by

Re: [PATCH 2] libssl: malloc/memset = calloc

2014-05-25 Thread Benjamin Baier
On Sun, 25 May 2014 12:24:17 -0700 Philip Guenther guent...@gmail.com wrote: Just say no to casting the return value of malloc/calloc/realloc! I understand. fixed. Index: src/crypto/store/str_lib.c === RCS file:

Re: [PATCH 2] followup Speedstep bug

2014-05-22 Thread Benjamin Baier
, May 10, 2014 at 4:06 AM, Benjamin Baier program...@netzbasis.dewrote: After setting cpu clock to the minimum value in my BIOS, SpeedStep paniced on me. dmesg before and after patching at http://netzbasis.de/openbsd/speedstep/ The patch below works for me, tested on amd64. low == high == 800

[PATCH] Speedstep bug

2014-05-10 Thread Benjamin Baier
Hi tech@ After setting cpu clock to the minimum value in my BIOS, SpeedStep paniced on me. dmesg before and after patching at http://netzbasis.de/openbsd/speedstep/ The patch below works for me, tested on amd64. low == high == 800 cpuspeed == 798 (!) --- sys/arch/amd64/amd64/est.c.orig

Re: cpsw device timeouts

2014-04-17 Thread Benjamin Baier
root on sd0a (6a8ab8283a822f44.a) swap on sd0b dump on sd0b - Ben On 04/16/14 20:49, Benjamin Baier wrote: I patched this against (1st) the latest anoncvs tree and (2nd) against your cpsw patch from 04/12/14 (2). Both times it works (compile, boot) and so I tested the timeout bug described

Re: cpsw device timeouts

2014-04-16 Thread Benjamin Baier
I patched this against (1st) the latest anoncvs tree and (2nd) against your cpsw patch from 04/12/14 (2). Both times it works (compile, boot) and so I tested the timeout bug described at http://marc.info/?l=openbsd-bugsm=138275913126582w=2 First i can reproduce the timeout bug with the latest