semop()/semtimedop() sembuf argument printing in strace

Jakub Bogusz qboosh at pld-linux.org
Thu Oct 8 14:27:22 UTC 2009


On Thu, Oct 08, 2009 at 03:07:33AM +0400, Dmitry V. Levin wrote:
> Hi,
> 
> On Wed, Oct 07, 2009 at 10:25:10PM +0200, Jakub Bogusz wrote:
> [...]
> > OK, updated patch attached.
> 
> There are two issues remained which should be addressed.
> 
> First, redundancy should be avoided.
> You patch introduces 4 very similar copies of sembuf parser.
> 
> Second, user input should not be trusted at all.
> Please try your patch with the following example:
> 
> $ cat semop.c
> #include <sys/sem.h>
> int main(void) {
> 	return semop(-1, (struct sembuf *) main, 0x1000000) < 0;
> }
> 
> I pushed a fix on top of your patch to
> http://strace.git.sourceforge.net/git/gitweb.cgi?p=strace/strace;a=shortlog;h=ldv/sembuf
> Please test.

Seems to work properly, thanks.


-- 
Jakub Bogusz    http://qboosh.pl/




More information about the Strace-devel mailing list