public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nikita Danilov <Nikita@Namesys.COM>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, ltp-list@lists.sourceforge.net,
	error27@email.com
Subject: Re: [Announce] Strace Test
Date: Thu, 19 Feb 2004 13:51:19 +0300	[thread overview]
Message-ID: <16436.38183.533759.45718@laputa.namesys.com> (raw)
In-Reply-To: <20040219023813.2d4b0ced.akpm@osdl.org>

Andrew Morton writes:
 > Nikita Danilov <Nikita@Namesys.COM> wrote:
 > >
 > >  > Strace Test uses a modified version of strace 4.5.1.  
 > >   > Instead of printing out information about system calls, 
 > >   > the modified version calls the syscalls with improper 
 > >   > values.
 > > 
 > >  It immediately DoSes kernel by calling sys_sysctl() with huge nlen:
 > >  printk() consumes all CPU.
 > 
 > Something like this?

On slow console (serial kgdb) this still would be problematic. I think
printk_ratelimit() is needed. But why this loop is needed at all? It
seems strange that syscall prints its arguments instead of just
returning -EINVAL.

 > 
 > --- 25/kernel/sysctl.c~sysctl-nlen-check	2004-02-19 02:36:20.000000000 -0800
 > +++ 25-akpm/kernel/sysctl.c	2004-02-19 02:37:40.000000000 -0800
 > @@ -913,6 +913,9 @@ asmlinkage long sys_sysctl(struct __sysc
 >  
 >  	if (copy_from_user(&tmp, args, sizeof(tmp)))
 >  		return -EFAULT;
 > +
 > +	if (tmp.nlen < 0 || tmp.nlen > CTL_MAXNAME)
 > +		return -EINVAL;
 >  	
 >  	if (tmp.nlen != 2 || copy_from_user(name, tmp.name, sizeof(name)) ||
 >  	    name[0] != CTL_KERN || name[1] != KERN_VERSION) { 

Nikita.

 > 
 > _
 > 

  reply	other threads:[~2004-02-19 10:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-16  5:22 [Announce] Strace Test dan carpenter
2004-02-16  6:59 ` Anton Blanchard
2004-03-11  9:53   ` Chris Wedgwood
2004-02-16 15:46 ` [LTP] " Robert Williamson
2004-02-19 10:07 ` Nikita Danilov
2004-02-19 10:38   ` Andrew Morton
2004-02-19 10:51     ` Nikita Danilov [this message]
2004-02-19 10:59       ` Andrew Morton
2004-02-19 10:29 ` David Weinehall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16436.38183.533759.45718@laputa.namesys.com \
    --to=nikita@namesys.com \
    --cc=akpm@osdl.org \
    --cc=error27@email.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ltp-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox