lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20070825000513.GA9811@Krystal>
Date:	Fri, 24 Aug 2007 20:05:13 -0400
From:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Al Viro <viro@....linux.org.uk>, linux-kernel@...r.kernel.org,
	Martin Bligh <mbligh@...gle.com>,
	"Randy.Dunlap" <rdunlap@...otime.net>
Subject: Re: [PATCH] Sort module list - use ppos instead of m->private

* Andrew Morton (akpm@...ux-foundation.org) wrote:
> On Fri, 24 Aug 2007 11:39:33 -0400
> Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca> wrote:
> 
> > Sort modules list - use ppos instead of m->private
> > 
> > When reading the data by small chunks (i.e. byte by byte), the index (ppos) is
> > incremented by seq_read() directly and no "next" callback is called when going
> > to the next module.
> > 
> > Therefore, use ppos instead of m->private to deal with the fact that this index
> > is incremented directly to pass to the next module in seq_read() after the
> > buffer has been emptied.
> 
> Confused.  What problem is this patch fixing?  I'm guessing that something
> is going wrong when /proc/modules is read one-byte-at-a-time?
> 
> <tests that>
> 
> <nope>
> 
> Better changelogs, please.
> 

Ok, will append this in the changelog (I sent this to Rusty earlier
today):

Small test program for this:

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

#define BUFSIZE 1024

int main()
{
        int fd = open("/proc/modules", O_RDONLY);
        char buf[BUFSIZE];
        ssize_t size;

        do {
                size = read(fd, buf, 1);
                printf("%c", buf[0]);
                usleep(100000);
        } while(size > 0);

        close(fd);
        return 0;
}

Before fix, it prints the first module indefinitely. The patch fixes
this.

I will also append more detail to "Sort module list by pointer address
to get coherent sleepable seq_file iterators" changelog before the
2.6.23-rc3-mm1 repost.

Mathieu

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ