Linux-Development-Sys Digest #778, Volume #8 Fri, 8 Jun 01 11:13:10 EDT
Contents:
module_(un)register_chrdev() (Stefan Newbold)
Re: Matt Blaze's CFS on Linux - readdir problem. (Nate Eldredge)
Re: Linux-2.4.5 ("D. Stimits")
Re: Matt Blaze's CFS on Linux - readdir problem. ("Binesh Bannerjee")
Re: how can I get a change to "official" linux? (John Reiser)
Re: module_(un)register_chrdev() (Paul Fulghum)
Re: mmap+/dev/zero+madvise(WILLNEED) fails? (M.)
What's the meaning of "A t T r R d D b B" in System.map (weining gu)
Re: Matt Blaze's CFS on Linux - readdir problem. ("Binesh Bannerjee")
Re: information (Josef Moellers)
Re: What's the meaning of "A t T r R d D b B" in System.map (Josef Moellers)
Re: information (=?iso-8859-1?Q?Andr=E9?= David)
barrier() ("Slawek Grajewski")
Re: accept freezes ("Nils O. Sel�sdal")
Re: barrier() ("Slawek Grajewski")
Re: Matt Blaze's CFS on Linux - readdir problem. (Kevin Buhr)
----------------------------------------------------------------------------
From: Stefan Newbold <[EMAIL PROTECTED]>
Subject: module_(un)register_chrdev()
Date: Thu, 07 Jun 2001 16:12:19 -0500
I am writing a character based kernel module with redhat 7.1, kernel
version 2.4-2. My current problem is as follows:
I keep getting a linker error when I try to use the
module_register_chrdev() or module_unregister_chrdev() functions.
I've been "surfing" for advice. A site at the Worcester Polytechnic
Institute says that these two functions are defined in
<linux/wrapper.h>. The wrapper.h I have is very short and doesn't seem
to have anything at all to do with these functions.
Do I have a bad "wrapper.h"?
Thanks
Stefan Newbold
University of Nebraska
------------------------------
From: Nate Eldredge <[EMAIL PROTECTED]>
Crossposted-To:
comp.os.linux.security,comp.os.linux.misc,comp.os.linux.development.apps
Subject: Re: Matt Blaze's CFS on Linux - readdir problem.
Date: 07 Jun 2001 15:11:40 -0700
"Binesh Bannerjee" <[EMAIL PROTECTED]> writes:
> Hi.
> First of all, I've been trying to subscribe to the mail list,
> and have as of yet been unsuccessful. Is it still up?
>
> Now, to the real problem:
> I hacked at the CFS source, till I got it to work, and it works...
> _basically_... I haven't lost any files, and all the files md5 sum the same,
> but, I noticed that when in large CFS'd directories, command completion and
> shell metacharacter expansion wasn't working, but ls and friends did work
> (I'm running CFS-1.4.1 on Linux 2.4.5 with the out of the box NFS from
> RedHat 6.2) I tracked it down to this:
> if you read a large CFS directory with readdir it doesn't get
> all of the files, but readdir64 will work... Has anyone else
> had this problem, and if so, how do I go about fixing it?
How large? There's a reason readdir64 exists, you know.
--
Nate Eldredge
[EMAIL PROTECTED]
------------------------------
Date: Thu, 07 Jun 2001 16:16:14 -0600
From: "D. Stimits" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: Linux-2.4.5
Jerry Peters wrote:
>
> D. Stimits <[EMAIL PROTECTED]> wrote:
> > [EMAIL PROTECTED] wrote:
> >>
> >> I have been trying to upgrade from RH2.2.12-20 to kernel 2.4.5. I am
> >> running an AMD-K6-2 processor with 64mb ram, a CreativeLabs PCI 512 sound
> >> card, and a Lynksys NIC. The kernel freezes at boot. It only gets as for as
> >> Uncompressing linux.... Ok boot. This not verbatum but close. I tried 2.4.3
> >> previously with the same problem. The pathes were unsuccessful.
> >>
> >> B.M. Richard
> >>
> >> --
> >> Posted via CNET Help.com
> >> http://www.help.com/
>
> > There are several bugs that might do this (I found one on my machine,
> > despite the cockroach poison), which are corrected in Alan Cox's ac
> > series of patches. Try patching with:
> > ftp://zeus.kernel.org/pub/linux/kernel/people/alan/2.4/patch-2.4.5-ac9.bz2
>
> > D. Stimits, [EMAIL PROTECTED]
>
> What processor did you build it for? The default for 2.4.x is P3.
>
> Jerry
I didn't, he did. But it is a good point, I've heard of several people
with Athlon failing to boot because their kernel was compiled for PIII.
D. Stimits, [EMAIL PROTECTED]
------------------------------
From: "Binesh Bannerjee" <[EMAIL PROTECTED]>
Crossposted-To:
comp.os.linux.security,comp.os.linux.misc,comp.os.linux.development.apps
Subject: Re: Matt Blaze's CFS on Linux - readdir problem.
Date: 7 Jun 2001 22:32:37 GMT
In comp.os.linux.security Nate Eldredge <[EMAIL PROTECTED]> wrote:
: "Binesh Bannerjee" <[EMAIL PROTECTED]> writes:
:> (I'm running CFS-1.4.1 on Linux 2.4.5 with the out of the box NFS from
:> RedHat 6.2) I tracked it down to this:
:> if you read a large CFS directory with readdir it doesn't get
:> all of the files, but readdir64 will work... Has anyone else
:> had this problem, and if so, how do I go about fixing it?
: How large? There's a reason readdir64 exists, you know.
I'm sure, tho I'm not clear on what it's for... (No man pages for it
at least on my box... From the question, it would seem that you imply
that the 64 bitness of readdir is meant to address directories greater
than 2 (4?) GB in length. No, the directory is nowhere _near_ that huge...
I have only at _most_ a hundred or so entries... Even if it's for
filesize, I don't have anything that is greater than 2GB (not even close)
What is the rational for readdir64? Only other thing I can think of is for
inode sizes... It probably is, since I see __ino64_t defined in various
places of /usr/include/bits...
Anyway, I think this whole bit is a red herring, tho, because, readdir64
returns me a certain subset, and readdir returns me a different subset,
_neither_ of which, apparently gives me the complete directory listing,
and I'm at a loss as to how to figure out where the problem is...
I've recompiled cfs with -D_FILE_OFFSET_BITS=64 and I still have the
same problem...
In reading the docs for CFS, I get the feeling, that it wasn't meant
to do the things that I want it for... I want to encrypt my entire
home directory (The _whole_ directory is about 1.5GB total distributed
over about 2027 directories, 542 links and 26636 files...
I don't think any of what I have would bump into any 32 bit limits...
If it wasn't for the fact that it's crypto, and my experience with it is
limited, I'd tear into the code, -Wall -Werror everything, and attempt
to figure it out...
Here are some other things I've done:
I cattach -l 'd the directory, so it wouldn't create it's
.pvector_<encrypted_file> -> IV links, and, then I get another interesting
problem... Which is, that then, after I put _some_ files on there, it
makes the directory look invisible (???)... All the files and directories
are _there_, and I can cd to them, if I know what I'm looking for, but
ls doesn't show it... (the real one, and one made with readdir and readdir64)
*shrug*
It's important enough to me, that I _am_ tearing into the code anyway,
I am just hoping someone has already been through this, or maybe that
there's something stupid that I'm doing that will solve my problem...
Thanks...
Binesh Bannerjee
: --
: Nate Eldredge
: [EMAIL PROTECTED]
------------------------------
From: John Reiser <[EMAIL PROTECTED]>
Subject: Re: how can I get a change to "official" linux?
Date: Thu, 07 Jun 2001 16:31:15 -0700
Being able to set the base address to start the search for a region
of addresses to use when a process calls mmap(0, ...) has merit.
Forcing every new process in the system to use the same settable value
sounds like trouble.
Have you considered making the base address part of ulimit()?
This would protect other processes from interference, yet provide
an inheritable paramter for selected process trees.
--
John Reiser, [EMAIL PROTECTED]
------------------------------
From: Paul Fulghum <[EMAIL PROTECTED]>
Subject: Re: module_(un)register_chrdev()
Date: Fri, 08 Jun 2001 00:04:12 GMT
Stefan Newbold wrote:
> I am writing a character based kernel module with redhat 7.1, kernel
> version 2.4-2. My current problem is as follows:
>
> I keep getting a linker error when I try to use the
> module_register_chrdev() or module_unregister_chrdev() functions.
>
> I've been "surfing" for advice. A site at the Worcester Polytechnic
> Institute says that these two functions are defined in
> <linux/wrapper.h>. The wrapper.h I have is very short and doesn't seem
> to have anything at all to do with these functions.
>
> Do I have a bad "wrapper.h"?
>
> Thanks
>
> Stefan Newbold
> University of Nebraska
>
>
It should be just [un]register_chrdev().
Paul Fulghum
[EMAIL PROTECTED]
------------------------------
From: [EMAIL PROTECTED] (M.)
Subject: Re: mmap+/dev/zero+madvise(WILLNEED) fails?
Date: 7 Jun 2001 19:07:45 -0700
[EMAIL PROTECTED] (Zeljko Vrba) wrote in message
news:<[EMAIL PROTECTED]>...
> It seems to work :) You completely misunderstood the semantics of madvise.
> From the Solaris manpage about the WILNEED option:
>
> Tells the system that a certain address range is
> definitely needed so the kernel will start reading the
> specified range into memory. This can benefit programs
> wanting to minimize the time needed to access memory
> the first time, as the kernel would need to read in
> from the file.
>
> Notice how there is no mention of keeping those pages in memory?
Actually, my intention is not to keep the pages in memory but only
to minimize the number of times my application page faults by simply
advising the OS that I will need (let's say) 50 pages in the near
future. I doesn't make too much of a different for me if the OS
starts evicting those pages to swap/secondary storage. The note
above from the man page of Solaris says "access memory the first
time" and this is exactly what I want. If you will be accessing
memory the first time then pages will be loaded from /dev/zero
(which is a file full of null bytes) not from swap file since I
haven't dirtied any pages yet.
>
> So the only thing WILLNEED does is to prefetch the data from secondary
> storage into memory. Since there is no secondary storage associated with
> /dev/zero there is nothing to prefetch and error return is perfectly logical
> on Linux (EIO).. I guess Solaris is less fussy and interprets your request
> another way: there is no storage, so nothing has to be done and no error can
> happen..
Ok, so that means, on Linux, if I started dirtying some pages
and it happens that those pages got evicted to swap, and I
advised the OS with WILLNEED for those pages, then I won't get
EIO any more since those pages are in swap. I will give this
a try and see what happens.
> So setuid your program to root and drop your privileges when you lock into
> memory the pages you need. BTW, why would you want to lock some pages in
> memory? Performance can't be the reason..
I think I used the term "lock" loosely in my previous posting.
I should have said minimizing my page faults for data pages that
I need. My first try at this was to use malloc to allocate many
OS pages and then use madvise on those pages. But madvise off
course fails because malloc mmaps ANONYmous memory.
Now that I am thinking more about this, is there a way to know if
certain pages of the virtual address space of the process are in
swap or in memory?
Thanks,
M.
------------------------------
From: weining gu <[EMAIL PROTECTED]>
Subject: What's the meaning of "A t T r R d D b B" in System.map
Date: Thu, 7 Jun 2001 22:26:50 -0500
System.map includes all kernel global symbols, and is a
very usefull file. I'm just curious what's the specific
meaning inside System.map: A t T r ? R d D b B
Sounds like t for text section, r for register, d for data...
But how about T, R, A, B, b, ?...
Thanks.
------------------------------
From: "Binesh Bannerjee" <[EMAIL PROTECTED]>
Crossposted-To:
comp.os.linux.security,comp.os.linux.misc,comp.os.linux.development.apps
Subject: Re: Matt Blaze's CFS on Linux - readdir problem.
Date: 8 Jun 2001 05:07:55 GMT
In comp.os.linux.security Binesh Bannerjee <[EMAIL PROTECTED]> wrote:
: [ All this stuff about CFS 1.4.1 which can be found at
: http://www.crypto.com/software/cfs-1.4.1.tar.gz ]
: It's important enough to me, that I _am_ tearing into the code anyway,
: I am just hoping someone has already been through this, or maybe that
: there's something stupid that I'm doing that will solve my problem...
Now, I've been ripping through the source, I've put -Wall -Werror
(actually, I just cut and pasted _all_ the warnings from gcc), and I'm
going through... Eventually, I'll post the result here, so others
can point out all the places where I screwed up... Anyhow,
Here's my question, hopefully, someone can answer...
If you download the source, and look in esm.c, line 193
it calls cipherinit()... That's great, but the definition of
cipherinit() is actually cipherinit(int master) and it does
something different based on that variable... Which one do we
think Matt meant to do? The definition is in esm_cipher.c line 54
You can grep through the source, to see if there's any other
definition of cipherinit, there doesn't seem to be...
*sigh*... This particular piece isn't that important to
me, since it's just esm, not the cfs encryption, but...
Binesh
: : --
: : Nate Eldredge
: : [EMAIL PROTECTED]
------------------------------
From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: information
Date: Fri, 08 Jun 2001 08:05:14 +0200
Andr=E9 David wrote:
> =
> Lew Pitcher wrote:
> >
> > On Wed, 06 Jun 2001 19:30:13 -0000, garibaldi <[EMAIL PROTECTED]>
> > wrote:
> >
> > > I=A8m looking for the progam of Vicent Larsen (autorun.exe)
> > > anybody know where can I find it?. It=A8s a very good pwl.crack=
> > > progam.
> >
> > And this has what to do with Linux system development?
> =
> As if Linux programmers would waste time cracking NT ... tsc tsc
=2E.. by using a .exe file ;))))
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: What's the meaning of "A t T r R d D b B" in System.map
Date: Fri, 08 Jun 2001 08:09:02 +0200
weining gu wrote:
> =
> System.map includes all kernel global symbols, and is a
> very usefull file. I'm just curious what's the specific
> meaning inside System.map: A t T r ? R d D b B
> Sounds like t for text section, r for register, d for data...
> But how about T, R, A, B, b, ?...
> =
> Thanks.
Upper case letters denote global (external) symbols, lower case letters
denote local (static?) symbols.
info nm
will tell you more.
=
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
From: =?iso-8859-1?Q?Andr=E9?= David <[EMAIL PROTECTED]>
Subject: Re: information
Date: Fri, 08 Jun 2001 11:18:32 +0200
This is a multi-part message in MIME format.
==============E946567E2BAB47DC989B12E1
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Josef Moellers wrote:
>
> Andr� David wrote:
> >
> > Lew Pitcher wrote:
> > >
> > > On Wed, 06 Jun 2001 19:30:13 -0000, garibaldi <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > > I�m looking for the progam of Vicent Larsen (autorun.exe)
> > > > anybody know where can I find it?. It�s a very good pwl.crack
> > > > progam.
> > >
> > > And this has what to do with Linux system development?
> >
> > As if Linux programmers would waste time cracking NT ... tsc tsc
>
> ... by using a .exe file ;))))
Well, some browsers need this extension to get the file in binary format
8-)
--
"Share the code. If you hide it ain't good."
Popular knowledge
==============E946567E2BAB47DC989B12E1
Content-Type: text/x-vcard; charset=us-ascii;
name="Andre.David.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Andr� David
Content-Disposition: attachment;
filename="Andre.David.vcf"
begin:vcard
n:David;Andr�
tel;cell:+41792013849
tel;work:+41227676147
x-mozilla-html:FALSE
org:CERN - European Centre for Nuclear Research;EP/NA60
adr:;;;;;;
version:2.1
email;internet:[EMAIL PROTECTED]
note:Geneva, Switzerland
x-mozilla-cpt:;-16000
fn:Andr� David
end:vcard
==============E946567E2BAB47DC989B12E1==
------------------------------
From: "Slawek Grajewski" <[EMAIL PROTECTED]>
Subject: barrier()
Date: Fri, 8 Jun 2001 12:18:06 +0200
Hello,
Can someone explain to me what barrier() function does?
TIA,
Slawek
------------------------------
From: "Nils O. Sel�sdal" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: accept freezes
Date: Fri, 8 Jun 2001 13:28:59 +0200
"Christophe Dore" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hi,
>
> I have a multithreaded small http server that has the following
> problem :
> after a big bunch of accept (around 400,000), accept freezes.
>
> I mean that you can telnet the server, send a line or two, but the
> accept function does not returns, (so the data transfer socket is not
> treated by the server). furthermore, what is strange is that when I
do
> "netstat" on the server side, I see the data transfer socket in
> ESTABLISHED state...
>
> It seems that the operating system has accepted the connection, but
> has not provided it to the process....
>
> Any idea of can lead to this ?
> Any idea, hint, ... is welcome !! :-)
You do remember to close the socket when the client is done ?
you can check the /proc/<pid of progam> filesystem to see iif you have
filedescriptor leaks.
------------------------------
From: "Slawek Grajewski" <[EMAIL PROTECTED]>
Subject: Re: barrier()
Date: Fri, 8 Jun 2001 14:31:37 +0200
OK. I found the explanation, so disregard my qurey
"It tells the compiler that memory was, or is about to be, modified.
Therefore, the complier must put back into memory anything it
was caching, and after the barrier, it must re-read anything it
uses from memory. It, itself, generates no code, but the compiler
will usually spew out some 'extra' instructions as a result of
this, so it isn't a "nop".
"
"Slawek Grajewski" <[EMAIL PROTECTED]> wrote in message
news:9fq8p1$[EMAIL PROTECTED]...
> Hello,
>
> Can someone explain to me what barrier() function does?
>
> TIA,
> Slawek
>
>
------------------------------
From: [EMAIL PROTECTED] (Kevin Buhr)
Crossposted-To:
comp.os.linux.security,comp.os.linux.misc,comp.os.linux.development.apps
Subject: Re: Matt Blaze's CFS on Linux - readdir problem.
Date: 08 Jun 2001 09:10:33 -0500
"Binesh Bannerjee" <[EMAIL PROTECTED]> writes:
>
> if you read a large CFS directory with readdir it doesn't get
> all of the files, but readdir64 will work... Has anyone else
> had this problem, and if so, how do I go about fixing it?
It's a kernel/C-library bug that's difficult to fix completely. The C
library does some fancy double-buffering in getdents(2) and so must
occassionally lseek on directories behind the scenes. When reading
from NFS filesystems whose files have large (>0x8000000) NFS cookies,
it will occassionally issue directory lseeks to negative offsets
without checking for an error return value. This is highly dependent
on internal C library buffer sizes, and will result in silently
disappearing files that vary from application to application. For
NFSv2, you can fix this particular problem by having the C library
llseek in this situation; for NFSv3---where the cookies are 64 bits,
it'll still be broken
Note that this isn't normally a data-destroying bug---your files are
still there; it's just that some applications won't "see" some files.
"rm -rf" might give you a mysterious "directory not empty"; or after a
"mv * elsewhere", you might be surprised to discover the current
directory is still full of files that were missed on the first pass.
There's more on this in a "linux-kernel" thread with subject:
negative NFS cookies: bad C library or bad kernel?
dated December 2, 2000.
The easiest fix is to modify CFS to use small NFS cookies. CFS
actually uses small host-endian cookies that, on little-endian
architectures, become large cookies in NFS space. This isn't a CFS
*bug*: cookies are supposed to be arbitrary. However, it just happens
to tickle this Linux bug, and we can "fix" it by having CFS convert
cookie values to network byte order.
I've enclosed a patch against Debian CFS 1.3.3-9; it will apply
against vanilla CFS 1.3.3 with some fuzz. Note that this modification
won't introduce any compatibility problems with existing or new CFS
directories---it only changes the values of the temporary cookies
passed between the CFS server and the kernel, not anything to do with
the CFS storage format. As always, test on a trash CFS directory
before trying it on your pr0n collection or anti-government tract
archive.
Kevin <[EMAIL PROTECTED]>
* * *
diff -ru cfs-1.3.3/cfs_nfs.c cfs-1.3.3-new/cfs_nfs.c
--- cfs-1.3.3/cfs_nfs.c Wed Jun 6 00:37:40 2001
+++ cfs-1.3.3-new/cfs_nfs.c Wed Jun 6 00:34:34 2001
@@ -873,7 +873,7 @@
ne=0;
prev= &ret.readdirres_u.reply.entries;
*prev=NULL;
- bcopy(ap->cookie,&cookie,sizeof(cookie));
+ cookie = ntohl(*(unsigned long*)(ap->cookie));
eof=TRUE;
key=keyof(h);
@@ -910,7 +910,7 @@
else if (strcmp(s,"..")==0) /* parent */
entrytab[ne].fileid=fhpid(h);
else entrytab[ne].fileid=dent->d_fileno;
- bcopy(&cookie,entrytab[ne].cookie,sizeof(long));
+ *(unsigned long*)entrytab[ne].cookie = htonl(cookie);
*prev = &entrytab[ne];
prev = &entrytab[ne].nextentry;
entrytab[ne].nextentry=NULL;
@@ -1127,7 +1127,7 @@
ne=0;
prev= &ret.readdirres_u.reply.entries;
*prev=NULL;
- bcopy(ap->cookie,&cookie,sizeof(long));
+ cookie = ntohl(*(unsigned long*)(ap->cookie));
eof=1;
ret.status=NFS_OK;
@@ -1146,7 +1146,7 @@
else entrytab[ne].fileid=dent->d_fileno;
cookie=dent->d_reclen; /* may not work everywhere */
*prev = &entrytab[ne];
- bcopy(&cookie,entrytab[ne].cookie,sizeof(long));
+ *(unsigned long*)entrytab[ne].cookie = htonl(cookie);
prev = &entrytab[ne].nextentry;
entrytab[ne].nextentry=NULL;
ne++;
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list by posting to the
comp.os.linux.development.system newsgroup.
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Development-System Digest
******************************