[patch] usr.bin/file: crash due to misplaced "strength" parameter

2021-10-30 Thread Maxim Pugachev
Hi, file(1) crashes if the magic file contains a misplaced "strength" parameter. A simple example to reproduce it: $ cat ~/.magic !:strength * 2 0 string \037\235 compress'd data Index: usr.bin/file/magic-load.c === RCS file: /cvs/

Re: [patch] sys_execve: clean up code that prepares args and env

2016-01-05 Thread Maxim Pugachev
Ping? On Wed, Dec 16, 2015 at 9:55 PM, Maxim Pugachev wrote: > Ping? > > On Sat, Dec 12, 2015 at 8:38 PM, Maxim Pugachev wrote: >> Hi, >> >> This patch removes copypasted code that prepares args and env in exec >> system call. >

Re: [patch] kern/exec_script: return error when the shell name is not specified

2016-01-05 Thread Maxim Pugachev
Ping? On Thu, Dec 17, 2015 at 8:18 PM, Ted Unangst wrote: > Maxim Pugachev wrote: >> Ping? >> >> On Sun, Dec 13, 2015 at 12:28 AM, Maxim Pugachev >> wrote: >> > Hi, >> > >> > In a case when the shell name is not specified (i.e. just &qu

Re: [patch] malloc: size that was passed to free() should land into the same bucket

2015-12-17 Thread Maxim Pugachev
On Thu, Dec 17, 2015 at 9:01 PM, Ted Unangst wrote: > Maxim Pugachev wrote: >> On Sun, Dec 13, 2015 at 10:38 PM, Ted Unangst wrote: >> > Maxim Pugachev wrote: >> >> Currently two checks in free() function confirm the correctness of >> >> freedsize argume

Re: Allocation type in kern/exec_elf.c

2015-12-17 Thread Maxim Pugachev
On Thu, Dec 17, 2015 at 8:21 PM, Ted Unangst wrote: > Maxim Pugachev wrote: >> Hey all, >> >> I'm wondering, why an allocation type in kern/exec_elf.c is equal to >> M_TEMP? For instance, kern/exec_script.c and kern/kern_exec.c allocate >> memory as M_EX

Re: [patch] kern/exec_script: avoid invalid free() in a case of error

2015-12-16 Thread Maxim Pugachev
Ping? On Sun, Dec 13, 2015 at 9:45 PM, Maxim Pugachev wrote: > Hi, > > In exec_script_makecmds function, when EXEC_HASFD flag was set, but > copystr/copyinstr returns an error, we need to set *tmpsap to NULL to > terminate a loop (under "fail" label) correct

Re: [patch] kern/exec_script: return error when the shell name is not specified

2015-12-16 Thread Maxim Pugachev
Ping? On Sun, Dec 13, 2015 at 12:28 AM, Maxim Pugachev wrote: > Hi, > > In a case when the shell name is not specified (i.e. just "#!" without > a path), don't run the heavy logic that checks shell, simply return > ENOENT. > > Also, as a tiny improvement: a

Re: [patch] sys_execve: clean up code that prepares args and env

2015-12-16 Thread Maxim Pugachev
Ping? On Sat, Dec 12, 2015 at 8:38 PM, Maxim Pugachev wrote: > Hi, > > This patch removes copypasted code that prepares args and env in exec > system call. > > > Index: sys/kern/kern_exec.c > === >

Allocation type in kern/exec_elf.c

2015-12-14 Thread Maxim Pugachev
Hey all, I'm wondering, why an allocation type in kern/exec_elf.c is equal to M_TEMP? For instance, kern/exec_script.c and kern/kern_exec.c allocate memory as M_EXEC, and it looks more reasonable to me. What's the reason for this? Thanks in advance.

Re: [patch] malloc: add info about the largest consumers of memory

2015-12-13 Thread Maxim Pugachev
>> Index: sys/kern/kern_malloc.c >> === >> RCS file: /cvs/src/sys/kern/kern_malloc.c,v >> retrieving revision 1.128 >> diff -u -p -r1.128 kern_malloc.c >> --- sys/kern/kern_malloc.c 14 Mar 2015 03:38:50 - 1.128 >> +++ sys

Re: [patch] malloc: size that was passed to free() should land into the same bucket

2015-12-13 Thread Maxim Pugachev
On Sun, Dec 13, 2015 at 10:38 PM, Ted Unangst wrote: > Maxim Pugachev wrote: >> Currently two checks in free() function confirm the correctness of >> freedsize argument. I think that it's better to check that provided >> freedsize fall into the same bucket that was recor

[patch] kern/exec_script: avoid invalid free() in a case of error

2015-12-13 Thread Maxim Pugachev
Hi, In exec_script_makecmds function, when EXEC_HASFD flag was set, but copystr/copyinstr returns an error, we need to set *tmpsap to NULL to terminate a loop (under "fail" label) correctly. Index: sys/kern/exec_script.c === RCS fil

Re: [patch] malloc: size that was passed to free() should land into the same bucket

2015-12-12 Thread Maxim Pugachev
>> Ping? > > You're not being ignored. I have pinged the tedu for you :) Great, thank you, Bob :)

Re: [patch] malloc: size that was passed to free() should land into the same bucket

2015-12-12 Thread Maxim Pugachev
On Wed, Dec 9, 2015 at 9:26 PM, Maxim Pugachev wrote: > Hi, > > Currently two checks in free() function confirm the correctness of > freedsize argument. I think that it's better to check that provided > freedsize fall into the same bucket that was recorded in kmemusage >

Re: [patch] malloc: add info about the largest consumers of memory

2015-12-12 Thread Maxim Pugachev
On Wed, Dec 9, 2015 at 8:03 PM, Maxim Pugachev wrote: > Hi, > > This patch adds additional informational to ddb's "show malloc" > command about the largest consumers of memory. Ping?

[patch] kern/exec_script: return error when the shell name is not specified

2015-12-12 Thread Maxim Pugachev
Hi, In a case when the shell name is not specified (i.e. just "#!" without a path), don't run the heavy logic that checks shell, simply return ENOENT. Also, as a tiny improvement: avoid a loop when calculating shell's args length. Index: sys/kern/exec_script.c ==

[patch] sys_execve: clean up code that prepares args and env

2015-12-12 Thread Maxim Pugachev
Hi, This patch removes copypasted code that prepares args and env in exec system call. Index: sys/kern/kern_exec.c === RCS file: /cvs/src/sys/kern/kern_exec.c,v retrieving revision 1.173 diff -u -p -r1.173 kern_exec.c --- sys/kern/k

[patch] malloc: size that was passed to free() should land into the same bucket

2015-12-09 Thread Maxim Pugachev
Hi, Currently two checks in free() function confirm the correctness of freedsize argument. I think that it's better to check that provided freedsize fall into the same bucket that was recorded in kmemusage struct: it covers both cases. Index: sys/kern/kern_malloc.c ==

[patch] malloc: add info about the largest consumers of memory

2015-12-09 Thread Maxim Pugachev
Hi, This patch adds additional informational to ddb's "show malloc" command about the largest consumers of memory. This is my first patch for OpenBSD, so I will be very grateful for any comments. Thanks in advance! Index: sys/kern/kern_malloc.c ==