Re: 2.6.22-rc6(mm1) Unable to handle kernel NULL pointer dereference - git-bisect result

2007-07-08 Thread Ulrich Drepper
e is given. So, either the code was inconsistent already are these tests are really not needed. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGkSHa2ijCOnn/RHQRAp0RAJ9ouvOd52feTPuFurxj8LzHZuGZsACgwxA8 ybEo1xm

Re: 2.6.22-rc6(mm1) Unable to handle kernel NULL pointer dereference - git-bisect result

2007-07-08 Thread Ulrich Drepper
test can be skipped since the VFS isn't involved. We got the inode etc from a file descriptor. Signed-Off-By: Ulrich Drepper <[EMAIL PROTECTED]> diff --git a/fs/utimes.c b/fs/utimes.c index 480f7c8..873edcb 100644 - --- a/fs/utimes.c +++ b/fs/utimes.c @@ -106,7 +106,8 @@ long do_utimes(int d

Re: 2.6.22-rc6(mm1) Unable to handle kernel NULL pointer dereference - git-bisect result

2007-07-08 Thread Ulrich Drepper
be skipped since the VFS isn't involved. We got the inode etc from a file descriptor. Signed-Off-By: Ulrich Drepper [EMAIL PROTECTED] diff --git a/fs/utimes.c b/fs/utimes.c index 480f7c8..873edcb 100644 - --- a/fs/utimes.c +++ b/fs/utimes.c @@ -106,7 +106,8 @@ long do_utimes(int dfd, char __user

Re: 2.6.22-rc6(mm1) Unable to handle kernel NULL pointer dereference - git-bisect result

2007-07-08 Thread Ulrich Drepper
already are these tests are really not needed. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGkSHa2ijCOnn/RHQRAp0RAJ9ouvOd52feTPuFurxj8LzHZuGZsACgwxA8 ybEo1xmvakkKVenWc07PYhs= =5DBy -END PGP

Re: 2.6.22-rc6(mm1) Unable to handle kernel NULL pointer dereference - git-bisect result

2007-07-08 Thread Ulrich Drepper
)) { if (current-fsuid != inode-i_uid !capable(CAP_FOWNER)) goto error; } in inode_change_ok. This seems to me exactly like the check needed. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7

Re: [patch 0/6] sys_indirect RFC - sys_indirect introduction

2007-07-02 Thread Ulrich Drepper
On 7/2/07, Davide Libenzi <[EMAIL PROTECTED]> wrote: Never be usable? I made you a concrete example that is like 8 months old. And *that* could not have been cleanly handled with the flat structure idea. First of all, sigmasks are not widely needed. Second, why on earth shouldn't it be

Re: [patch 0/4] MAP_NOZERO v2 - VM_NOZERO/MAP_NOZERO early summer madness

2007-07-02 Thread Ulrich Drepper
On 7/2/07, Rik van Riel <[EMAIL PROTECTED]> wrote: That should not happen. The default SELinux configuration in Fedora (and Debian?) runs a few daemons in their own restricted modes and has most of the system running in unconfined_t, including the majority of user programs. This is the state

Re: [patch 0/6] sys_indirect RFC - sys_indirect introduction

2007-07-02 Thread Ulrich Drepper
On 7/1/07, Davide Libenzi <[EMAIL PROTECTED]> wrote: With the current API design you'd able to easily confine the "pre" code inside the "set" function, and the "post" code inside the "unset" function. It looks pretty clean to me, and allows to limit the knowledge of sys_indirect, the more as

Re: [patch 0/6] sys_indirect RFC - sys_indirect introduction

2007-07-02 Thread Ulrich Drepper
On 7/1/07, Davide Libenzi [EMAIL PROTECTED] wrote: With the current API design you'd able to easily confine the pre code inside the set function, and the post code inside the unset function. It looks pretty clean to me, and allows to limit the knowledge of sys_indirect, the more as possible

Re: [patch 0/4] MAP_NOZERO v2 - VM_NOZERO/MAP_NOZERO early summer madness

2007-07-02 Thread Ulrich Drepper
On 7/2/07, Rik van Riel [EMAIL PROTECTED] wrote: That should not happen. The default SELinux configuration in Fedora (and Debian?) runs a few daemons in their own restricted modes and has most of the system running in unconfined_t, including the majority of user programs. This is the state as

Re: [patch 0/6] sys_indirect RFC - sys_indirect introduction

2007-07-02 Thread Ulrich Drepper
On 7/2/07, Davide Libenzi [EMAIL PROTECTED] wrote: Never be usable? I made you a concrete example that is like 8 months old. And *that* could not have been cleanly handled with the flat structure idea. First of all, sigmasks are not widely needed. Second, why on earth shouldn't it be possible

Re: [patch 0/6] sys_indirect RFC - sys_indirect introduction

2007-07-01 Thread Ulrich Drepper
On 6/30/07, Davide Libenzi <[EMAIL PROTECTED]> wrote: This is how all those overloaded syscalls looks like, BTW: [...] How would you do that with a single shared strcture, w/out adding in all signal paths the knowledge of the structure? You said it yourself: each individual wrapper would look

Re: [patch 0/6] sys_indirect RFC - sys_indirect introduction

2007-07-01 Thread Ulrich Drepper
On 6/30/07, Davide Libenzi [EMAIL PROTECTED] wrote: This is how all those overloaded syscalls looks like, BTW: [...] How would you do that with a single shared strcture, w/out adding in all signal paths the knowledge of the structure? You said it yourself: each individual wrapper would look

Re: [patch 0/6] sys_indirect RFC - sys_indirect introduction

2007-06-30 Thread Ulrich Drepper
On 6/30/07, Davide Libenzi <[EMAIL PROTECTED]> wrote: But, a __get_user(), once you scrap off all the gcc wrapping, is bacially a move. That could even be removed, but really I don't see the reason since it allows for a cleaner strcture definition in userland. Don't generalize. The 4G/4G

Re: [patch 0/6] sys_indirect RFC - sys_indirect introduction

2007-06-30 Thread Ulrich Drepper
On 6/30/07, Davide Libenzi [EMAIL PROTECTED] wrote: But, a __get_user(), once you scrap off all the gcc wrapping, is bacially a move. That could even be removed, but really I don't see the reason since it allows for a cleaner strcture definition in userland. Don't generalize. The 4G/4G

Re: [patch 3/6] sys_indirect RFC - sys_indirect core

2007-06-29 Thread Ulrich Drepper
On 6/29/07, Davide Libenzi <[EMAIL PROTECTED]> wrote: +int indirect_set_context(struct fsa_context *ator, +const struct indirect_ctx __user * __user *ctxs, +unsigned int nctxs, struct indirect_op **first) +{ + unsigned int i; + int

Re: [patch 0/6] sys_indirect RFC - sys_indirect introduction

2007-06-29 Thread Ulrich Drepper
On 6/29/07, Davide Libenzi <[EMAIL PROTECTED]> wrote: [include/linux/indirect.h] #define SYSIND_CTX_OPENFLAGS0 struct sysind_ctx_OPENFLAGS { __u32 ctx; __u32 flags; I agree that this interface is more than any other in danger of needing an

Re: [patch 0/6] sys_indirect RFC - sys_indirect introduction

2007-06-29 Thread Ulrich Drepper
On 6/29/07, Davide Libenzi [EMAIL PROTECTED] wrote: [include/linux/indirect.h] #define SYSIND_CTX_OPENFLAGS0 struct sysind_ctx_OPENFLAGS { __u32 ctx; __u32 flags; I agree that this interface is more than any other in danger of needing an

Re: [patch 3/6] sys_indirect RFC - sys_indirect core

2007-06-29 Thread Ulrich Drepper
On 6/29/07, Davide Libenzi [EMAIL PROTECTED] wrote: +int indirect_set_context(struct fsa_context *ator, +const struct indirect_ctx __user * __user *ctxs, +unsigned int nctxs, struct indirect_op **first) +{ + unsigned int i; + int error;

Re: [patch 0/4] MAP_NOZERO v2 - VM_NOZERO/MAP_NOZERO early summer madness

2007-06-28 Thread Ulrich Drepper
On 6/28/07, Rik van Riel <[EMAIL PROTECTED]> wrote: That wants MAP_PRIVATE so that the kernel can also decide to not swap these pages out to an unencrypted swap area. That's not what MAP_PRIVATE means. MAP_PRIVATE is the opposite of MAP_SHARED. It's meaningless for anonymous memory (which is

Re: [patch 0/4] MAP_NOZERO v2 - VM_NOZERO/MAP_NOZERO early summer madness

2007-06-28 Thread Ulrich Drepper
On 6/28/07, Rik van Riel [EMAIL PROTECTED] wrote: That wants MAP_PRIVATE so that the kernel can also decide to not swap these pages out to an unencrypted swap area. That's not what MAP_PRIVATE means. MAP_PRIVATE is the opposite of MAP_SHARED. It's meaningless for anonymous memory (which is

Re: [patch 2/3] MAP_NOZERO - implement sys_brk2()

2007-06-27 Thread Ulrich Drepper
On 6/27/07, Hugh Dickins <[EMAIL PROTECTED]> wrote: The absolute virtual addresses are randomized, yes; but do a sequence of mmaps and they come back adjacent to each other, and so mergable. Or does your distro include a kernel patch to randomize them relative to each other? Each individual

Re: [patch 2/3] MAP_NOZERO - implement sys_brk2()

2007-06-27 Thread Ulrich Drepper
On 6/27/07, Hugh Dickins <[EMAIL PROTECTED]> wrote: Not so: if an mmap can be done by extending either adjacent vma (prot and flags and file and offset all match up), that's what's done and no separate vma is created. (And adjacent vmas get merged when mprotect removes the difference in

Re: [patch 2/3] MAP_NOZERO - implement sys_brk2()

2007-06-27 Thread Ulrich Drepper
On 6/27/07, Hugh Dickins [EMAIL PROTECTED] wrote: Not so: if an mmap can be done by extending either adjacent vma (prot and flags and file and offset all match up), that's what's done and no separate vma is created. (And adjacent vmas get merged when mprotect removes the difference in

Re: [patch 2/3] MAP_NOZERO - implement sys_brk2()

2007-06-27 Thread Ulrich Drepper
On 6/27/07, Hugh Dickins [EMAIL PROTECTED] wrote: The absolute virtual addresses are randomized, yes; but do a sequence of mmaps and they come back adjacent to each other, and so mergable. Or does your distro include a kernel patch to randomize them relative to each other? Each individual mmap

Re: [patch 2/3] MAP_NOZERO - implement sys_brk2()

2007-06-26 Thread Ulrich Drepper
On 6/26/07, Rik van Riel <[EMAIL PROTECTED]> wrote: After going through the first malloc()/free() cycle, surely the memory will no longer be zeroed on the second malloc() ? If returned to the system, sure. What makes the first brk malloc so special? If the memory is zeroed it needs not be

Re: [patch 2/3] MAP_NOZERO - implement sys_brk2()

2007-06-26 Thread Ulrich Drepper
On 6/26/07, Davide Libenzi <[EMAIL PROTECTED]> wrote: I acutally have the code for it, but I never posted it since it did not receive a too warm review (and the only user was the fdmap thingy). Only user of sys_indirect? There will be quite a few right away. Every syscall that returns a file

Re: [patch 2/3] MAP_NOZERO - implement sys_brk2()

2007-06-26 Thread Ulrich Drepper
On 6/26/07, Davide Libenzi <[EMAIL PROTECTED]> wrote: The following patch implements the sys_brk2() syscall, that nothing is other than a sys_brk() with an extra "flags" parameter. Shouldn't we wait for Linus' sys_indirect to arrive and make this another syscall which takes advantage of it? -

Re: [patch 2/3] MAP_NOZERO - implement sys_brk2()

2007-06-26 Thread Ulrich Drepper
On 6/26/07, Rik van Riel <[EMAIL PROTECTED]> wrote: Since programs can get back free()d memory after a malloc(), with the old contents of the memory intact, surely your MAP_NONZERO behavior could be the default for programs that can get away with it? Maybe we could use some magic ELF header,

Re: [patch 2/3] MAP_NOZERO - implement sys_brk2()

2007-06-26 Thread Ulrich Drepper
On 6/26/07, Rik van Riel [EMAIL PROTECTED] wrote: Since programs can get back free()d memory after a malloc(), with the old contents of the memory intact, surely your MAP_NONZERO behavior could be the default for programs that can get away with it? Maybe we could use some magic ELF header,

Re: [patch 2/3] MAP_NOZERO - implement sys_brk2()

2007-06-26 Thread Ulrich Drepper
On 6/26/07, Davide Libenzi [EMAIL PROTECTED] wrote: The following patch implements the sys_brk2() syscall, that nothing is other than a sys_brk() with an extra flags parameter. Shouldn't we wait for Linus' sys_indirect to arrive and make this another syscall which takes advantage of it? - To

Re: [patch 2/3] MAP_NOZERO - implement sys_brk2()

2007-06-26 Thread Ulrich Drepper
On 6/26/07, Davide Libenzi [EMAIL PROTECTED] wrote: I acutally have the code for it, but I never posted it since it did not receive a too warm review (and the only user was the fdmap thingy). Only user of sys_indirect? There will be quite a few right away. Every syscall that returns a file

Re: [patch 2/3] MAP_NOZERO - implement sys_brk2()

2007-06-26 Thread Ulrich Drepper
On 6/26/07, Rik van Riel [EMAIL PROTECTED] wrote: After going through the first malloc()/free() cycle, surely the memory will no longer be zeroed on the second malloc() ? If returned to the system, sure. What makes the first brk malloc so special? If the memory is zeroed it needs not be

Re: [PATCH] Futex: Revert the non-functional REQUEUE_PI

2007-06-18 Thread Ulrich Drepper
g used. This is what the current model allows: we find problems and since the development cycle requires changes to be added at the beginning we have time to back changes out again. No harm done. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- V

Re: [PATCH] Futex: Revert the non-functional REQUEUE_PI

2007-06-18 Thread Ulrich Drepper
. This is what the current model allows: we find problems and since the development cycle requires changes to be added at the beginning we have time to back changes out again. No harm done. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version

Re: [PATCH] Futex: Revert the non-functional REQUEUE_PI

2007-06-17 Thread Ulrich Drepper
emoval is no problem. > Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]> > Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]> Signed-off-by: Ulrich Drepper <[EMAIL PROTECTED]> - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNAT

Re: [PATCH] Futex: Revert the non-functional REQUEUE_PI

2007-06-17 Thread Ulrich Drepper
is no problem. Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Ulrich Drepper [EMAIL PROTECTED] - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux

Re: FUTEX_CMP_REQUEUE_PI is not quite there

2007-06-09 Thread Ulrich Drepper
PI futex. It cannot be, the semantics is different. This is no locking futex. The kernel will have to deal with this. The requeue operation is meaningless if this is not done since it's only use is for this situation. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View,

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-09 Thread Ulrich Drepper
re two interface to use: open + fcntl. This is racy. And don't tell me this doesn't matter. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGat6r2ijCOnn/RHQRAiatAKCs7RLZmpgAU5NyT58c8ueJum4fgw

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-09 Thread Ulrich Drepper
n do even more. In whatever way you look at it, there currently is a problem which cannot be solved except with truly horrible, horrible hack (open N descriptors and randomly select one to use; yep, horrible, I said so). - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-09 Thread Ulrich Drepper
. In whatever way you look at it, there currently is a problem which cannot be solved except with truly horrible, horrible hack (open N descriptors and randomly select one to use; yep, horrible, I said so). - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-09 Thread Ulrich Drepper
interface to use: open + fcntl. This is racy. And don't tell me this doesn't matter. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGat6r2ijCOnn/RHQRAiatAKCs7RLZmpgAU5NyT58c8ueJum4fgwCgjqP0

Re: FUTEX_CMP_REQUEUE_PI is not quite there

2007-06-09 Thread Ulrich Drepper
. It cannot be, the semantics is different. This is no locking futex. The kernel will have to deal with this. The requeue operation is meaningless if this is not done since it's only use is for this situation. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-08 Thread Ulrich Drepper
ever guarantee that descriptors are allocated sequentially. Linus already showed a code sequence: close(0); .. something else .. if (open("myfile", O_RDONLY) < 0) exit(1); This occurs in the real world and it is guaranteed to work. - -- ➧ Ul

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-08 Thread Ulrich Drepper
; #define NR_FILES > > for (i = 0; i < NR_FILES; i++) > close(i); You're confusing the problems. This is not the argument for having a separate file descriptor set. It is the argument to have hidden file descriptors. Randomization has nothing whatsoever to do with this ex

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-08 Thread Ulrich Drepper
ile descriptors cannot be used as indeces and the randomization makes sure that no program by some fluke happens to work. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGaaZ02ijC

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-08 Thread Ulrich Drepper
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alan Cox wrote: > Why does he want an unpredictable algorithm To avoid exactly the kind of problem we have now in future: programs relying on specific patterns. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BE

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-08 Thread Ulrich Drepper
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alan Cox wrote: Why does he want an unpredictable algorithm To avoid exactly the kind of problem we have now in future: programs relying on specific patterns. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-08 Thread Ulrich Drepper
descriptors cannot be used as indeces and the randomization makes sure that no program by some fluke happens to work. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGaaZ02ijCOnn

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-08 Thread Ulrich Drepper
NR_FILES some constant for (i = 0; i NR_FILES; i++) close(i); You're confusing the problems. This is not the argument for having a separate file descriptor set. It is the argument to have hidden file descriptors. Randomization has nothing whatsoever to do with this example. - -- ➧ Ulrich

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-08 Thread Ulrich Drepper
sequentially. Linus already showed a code sequence: close(0); .. something else .. if (open(myfile, O_RDONLY) 0) exit(1); This occurs in the real world and it is guaranteed to work. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-07 Thread Ulrich Drepper
xed up. No need to rely on hacks if we can still fix up the interfaces. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGaMU42ijCOnn/RHQRAm0MAJ9pprTVUD/2YvDsL6CPL21WvZSkEACeN3r8 TT8a5FyF2rCct+8gB

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-07 Thread Ulrich Drepper
ng would be done in two places: after fork and after execve? That would be enough. Programs should clean after themselves. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGaICk2ijCOnn/RHQRAqq5AJwIDmKdsL

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-07 Thread Ulrich Drepper
ork. Yes, this might expand the region in which descriptors are allocated due to inherited descriptors. But I consider this the application's problem and it usually is not really an issue. Apps have to explicitly request using the new descriptors and they can use CLOEXEC (CLOFORK) correctly. - --

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-07 Thread Ulrich Drepper
too different from this. If all this is unwanted then go with what you proposed. Otherwise think about a more generic approach. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) i

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-07 Thread Ulrich Drepper
ght might be enough. Maybe that's too specific for people's taste. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGaGRP2ijCOnn/RHQRAv2qAJ0WzyKvOPx01PviCp4L/mUmNaehtQCfdKF5 4Qc7Uj47zY8jdqUZf+Ht3gs= =jRfN

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-07 Thread Ulrich Drepper
lly: The problem is O_CLOEXEC. They are all racy and if we add a variant with flags then we might as well support O_NONSEQFD as well. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (G

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-07 Thread Ulrich Drepper
*utmr, int oflags) ... These aren't released yet, so, change them now before it's too late. And to add to your list: epoll_create(). Important if you think that's the interface people should use. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version:

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-07 Thread Ulrich Drepper
code is the answer but iff Davide's unified code does not perform worse than the current code I don't see the harm since, for instance, extending socket() is in any case necessary. I mentioned that close_on_exit must be set on open, else leaks are risked. This will come naturally with a flags pa

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-07 Thread Ulrich Drepper
. No need to rely on hacks if we can still fix up the interfaces. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGaMU42ijCOnn/RHQRAm0MAJ9pprTVUD/2YvDsL6CPL21WvZSkEACeN3r8 TT8a5FyF2rCct+8gBKyWF/s= =fs4f

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-07 Thread Ulrich Drepper
than the current code I don't see the harm since, for instance, extending socket() is in any case necessary. I mentioned that close_on_exit must be set on open, else leaks are risked. This will come naturally with a flags parameter which already takes O_NONSEQFD. - -- ➧ Ulrich Drepper ➧ Red Hat

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-07 Thread Ulrich Drepper
released yet, so, change them now before it's too late. And to add to your list: epoll_create(). Important if you think that's the interface people should use. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-07 Thread Ulrich Drepper
racy and if we add a variant with flags then we might as well support O_NONSEQFD as well. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGaFTO2ijCOnn/RHQRAm7uAJ9NsP6FegpO3cAnCe83eZ8awtkHawCgzKK4

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-07 Thread Ulrich Drepper
be enough. Maybe that's too specific for people's taste. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGaGRP2ijCOnn/RHQRAv2qAJ0WzyKvOPx01PviCp4L/mUmNaehtQCfdKF5 4Qc7Uj47zY8jdqUZf+Ht3gs= =jRfN -END PGP

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-07 Thread Ulrich Drepper
this. If all this is unwanted then go with what you proposed. Otherwise think about a more generic approach. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGaHkj2ijCOnn/RHQRAhWoAJ4loMzrYJQDCU4e6jdOfjL4LG

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-07 Thread Ulrich Drepper
, this might expand the region in which descriptors are allocated due to inherited descriptors. But I consider this the application's problem and it usually is not really an issue. Apps have to explicitly request using the new descriptors and they can use CLOEXEC (CLOFORK) correctly. - -- ➧ Ulrich

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-07 Thread Ulrich Drepper
places: after fork and after execve? That would be enough. Programs should clean after themselves. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGaICk2ijCOnn/RHQRAqq5AJwIDmKdsL71ecQVd6PoDI2oOL

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-06 Thread Ulrich Drepper
this, before or after the new version controlled symbol is introduced, will break it. Policies or stateful behavior, however yo want to call it, is just plain wrong for this (and most other things). - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE-

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-06 Thread Ulrich Drepper
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alan Cox wrote: > prctl(PR_SPARSEFD, 1); > > to turn on sparse fd allocation for a process ? Yes, there is. Go back and read the archives. It has been discussed in depth. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Moun

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-06 Thread Ulrich Drepper
ng in this area at userlevel would involve a new interface. Programs also need new definitions from headers files. This means a recent enough glibc will be needed in any case. Unless programs use their own definitions in which case they might as well use the syscall() function. - -- ➧ Ulrich D

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-06 Thread Ulrich Drepper
involve a new interface. Programs also need new definitions from headers files. This means a recent enough glibc will be needed in any case. Unless programs use their own definitions in which case they might as well use the syscall() function. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-06 Thread Ulrich Drepper
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alan Cox wrote: prctl(PR_SPARSEFD, 1); to turn on sparse fd allocation for a process ? Yes, there is. Go back and read the archives. It has been discussed in depth. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View

Re: [patch 7/8] fdmap v2 - implement sys_socket2

2007-06-06 Thread Ulrich Drepper
or after the new version controlled symbol is introduced, will break it. Policies or stateful behavior, however yo want to call it, is just plain wrong for this (and most other things). - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version

Re: Syslets, signals, and security

2007-06-04 Thread Ulrich Drepper
On 6/4/07, Jeff Dike <[EMAIL PROTECTED]> wrote: First, there are signals. If the app has an interval timer enabled, every thread will inherit it and you will have 32 threads getting alarms, which seems surprising and wasteful. Not only that. IIRC the current code does nothing about blocking

Re: Syslets, signals, and security

2007-06-04 Thread Ulrich Drepper
On 6/4/07, Jeff Dike [EMAIL PROTECTED] wrote: First, there are signals. If the app has an interval timer enabled, every thread will inherit it and you will have 32 threads getting alarms, which seems surprising and wasteful. Not only that. IIRC the current code does nothing about blocking

Re: [patch 2/2] ufd v1 - use unsequential O(1) fdmap

2007-06-03 Thread Ulrich Drepper
propriating dup2. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGY6GA2ijCOnn/RHQRAtQ1AJ4+dDIgeBKlggt4U+lyZnDfQJZ/VQCfRbG4 0FtGWqlLOWFlspMJ9S3xQ7E= =jrG1 -END PGP SIGNATURE- - To unsubscribe from

Re: [patch 2/2] ufd v1 - use unsequential O(1) fdmap

2007-06-03 Thread Ulrich Drepper
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Davide Libenzi wrote: > Randomizing the base is not a problem. Should this be always, or flag > driven? I would say all the time. I don't think it's a problem with reproducibility in any reasonable code. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc.

Re: [patch 2/2] ufd v1 - use unsequential O(1) fdmap

2007-06-03 Thread Ulrich Drepper
implement these extra security measures. The cost of a randomized star base (offset from 2^30) should be zero. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGYyid2ijCOnn/RHQRAjRoAJ9XsAazZtc9V3A

Re: [patch 2/2] ufd v1 - use unsequential O(1) fdmap

2007-06-03 Thread Ulrich Drepper
/fcntl functionality. But removing functionality is harder. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGYxnb2ijCOnn/RHQRAkyoAJ4+L3W/aVYaQ/IG0HPm0tt5PKPcRACgoJYF bChz20uicqD9tBbDtU1yruM= =4vNd

Re: [patch 2/2] ufd v1 - use unsequential O(1) fdmap

2007-06-03 Thread Ulrich Drepper
uld be better but the new RLIMIT_NOFILE semantics is certainly also correct according to POSIX. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGYwZ82ijCOnn/RHQRAsvGAJ4jXamjOJVq4ImmVYT3/ghBXTB1bgCdGF0O

Re: [patch 2/2] ufd v1 - use unsequential O(1) fdmap

2007-06-03 Thread Ulrich Drepper
is certainly also correct according to POSIX. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGYwZ82ijCOnn/RHQRAsvGAJ4jXamjOJVq4ImmVYT3/ghBXTB1bgCdGF0O Y4nv9i7L98UEDEKc09Wt0VU= =OS4+ -END PGP

Re: [patch 2/2] ufd v1 - use unsequential O(1) fdmap

2007-06-03 Thread Ulrich Drepper
. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGYxnb2ijCOnn/RHQRAkyoAJ4+L3W/aVYaQ/IG0HPm0tt5PKPcRACgoJYF bChz20uicqD9tBbDtU1yruM= =4vNd -END PGP SIGNATURE- - To unsubscribe from this list: send

Re: [patch 2/2] ufd v1 - use unsequential O(1) fdmap

2007-06-03 Thread Ulrich Drepper
measures. The cost of a randomized star base (offset from 2^30) should be zero. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGYyid2ijCOnn/RHQRAjRoAJ9XsAazZtc9V3AxaPjiNMjK8jPUZgCdG/Eg

Re: [patch 2/2] ufd v1 - use unsequential O(1) fdmap

2007-06-03 Thread Ulrich Drepper
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Davide Libenzi wrote: Randomizing the base is not a problem. Should this be always, or flag driven? I would say all the time. I don't think it's a problem with reproducibility in any reasonable code. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444

Re: [patch 2/2] ufd v1 - use unsequential O(1) fdmap

2007-06-03 Thread Ulrich Drepper
. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGY6GA2ijCOnn/RHQRAtQ1AJ4+dDIgeBKlggt4U+lyZnDfQJZ/VQCfRbG4 0FtGWqlLOWFlspMJ9S3xQ7E= =jrG1 -END PGP SIGNATURE- - To unsubscribe from this list: send

[PATCH] V3: O_CLOEXEC for SCM_RIGHTS

2007-06-02 Thread Ulrich Drepper
Take two: I forgot to change the compat code. This has now happened. Only one additional line changed. Everything else from the first patch remains the same. I try to avoid clogging the list unnecessarily by not resending the test program. Signed-off-by: Ulrich Drepper <[EMAIL PROTEC

[PATCH] V2: O_CLOEXEC for SCM_RIGHTS

2007-06-02 Thread Ulrich Drepper
Take two: I forgot to change the compat code. This has now happened. Only one additional line changed. Everything else from the first patch remains the same. I try to avoid clogging the list unnecessarily by not resending the test program. Signed-off-by: Ulrich Drepper <[EMAIL PROTEC

[PATCH] O_CLOEXEC for SCM_RIGHTS

2007-06-02 Thread Ulrich Drepper
= -1) error (1, 0, "no descriptor received"); char fdname[20]; snprintf (fdname, sizeof (fdname), "%d", fd); execl ("/proc/self/exe", argv[0], fdname, NULL); puts ("execl failed"); return 1; } Signed-off-by: Ulrich Drepper <[EMAIL P

[PATCH] O_CLOEXEC for SCM_RIGHTS

2007-06-02 Thread Ulrich Drepper
/self/exe, argv[0], fdname, NULL); puts (execl failed); return 1; } Signed-off-by: Ulrich Drepper [EMAIL PROTECTED] --- a/fs/open.c +++ b/fs/open.c @@ -855,7 +855,7 @@ /* * Find an empty file descriptor entry, and mark it busy. */ -static int get_unused_fd_flags(int flags) +int

[PATCH] V2: O_CLOEXEC for SCM_RIGHTS

2007-06-02 Thread Ulrich Drepper
Take two: I forgot to change the compat code. This has now happened. Only one additional line changed. Everything else from the first patch remains the same. I try to avoid clogging the list unnecessarily by not resending the test program. Signed-off-by: Ulrich Drepper [EMAIL PROTECTED

[PATCH] V3: O_CLOEXEC for SCM_RIGHTS

2007-06-02 Thread Ulrich Drepper
Take two: I forgot to change the compat code. This has now happened. Only one additional line changed. Everything else from the first patch remains the same. I try to avoid clogging the list unnecessarily by not resending the test program. Signed-off-by: Ulrich Drepper [EMAIL PROTECTED

Re: [PATCH] Introduce O_CLOEXEC (take >2)

2007-05-31 Thread Ulrich Drepper
w what the runtime libraries need (not just libc, libstdc++, libxml, whatever) and vice versa. Policies are always wrong for somebody and changing the standardized behavior is not acceptable. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- V

Re: [PATCH] Introduce O_CLOEXEC (take >2)

2007-05-31 Thread Ulrich Drepper
ight just as well break assumptions in the same program. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGXxm/2ijCOnn/RHQRAm+wAJ9YD6KsS6T96xChZvS/3yCwCo6+0gCgl0IY y6OxxUcuQ8yGJsiYebkuIMY= =tkxV ---

Re: [PATCH] Introduce O_CLOEXEC (take >2)

2007-05-31 Thread Ulrich Drepper
access to the functionality. I cannot set the policy to default to close-on-exit in glibc all the while the application assumes this is not the case. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGXxcK2

Re: [PATCH] Introduce O_CLOEXEC (take >2)

2007-05-31 Thread Ulrich Drepper
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Nicholas Miell wrote: > O_CLOSEONEXEC, perhaps? Then nobody would know this is equivalent to FD_CLOEXEC. I think the name I propose is fine. - -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -BEGIN PGP SIGNAT

[PATCH] Introduce O_CLOEXEC (take >2)

2007-05-31 Thread Ulrich Drepper
return 0; } fd = open ("/proc/self/exe", O_RDONLY | O_CLOEXEC); printf ("in parent: new fd = %d\n", fd); char buf[20]; snprintf (buf, sizeof (buf), "%d", fd); execl ("/proc/self/exe", argv[0], buf, NULL); puts ("execl failed"); return

Re: [PATCH RT] fix faulting bomb in futex_unlock_pi64

2007-05-31 Thread Ulrich Drepper
On 5/30/07, Steven Rostedt <[EMAIL PROTECTED]> wrote: But, the -rt kernel has pretty much the same code for the futex_unlock_pi64, and it has the same bug. Why would you use futex_unlock_pi64? In fact, the whole 64-bit futex patch should be reviewed and cut down to the bare minimum. I know, I

Re: [BUG] futex_unlock_pi() hurts my brain and may cause application deadlock

2007-05-31 Thread Ulrich Drepper
On 5/30/07, Steven Rostedt <[EMAIL PROTECTED]> wrote: > if (!(uval & FUTEX_OWNER_DIED)) { > pagefault_disable(); > uval = futex_atomic_cmpxchg_inatomic(uaddr, current->pid, 0); > pagefault_enable(); > } [...] This code is in futex_unlock_pi.

Re: [BUG] futex_unlock_pi() hurts my brain and may cause application deadlock

2007-05-31 Thread Ulrich Drepper
On 5/30/07, Steven Rostedt [EMAIL PROTECTED] wrote: if (!(uval FUTEX_OWNER_DIED)) { pagefault_disable(); uval = futex_atomic_cmpxchg_inatomic(uaddr, current-pid, 0); pagefault_enable(); } [...] This code is in futex_unlock_pi. Can the

Re: [PATCH RT] fix faulting bomb in futex_unlock_pi64

2007-05-31 Thread Ulrich Drepper
On 5/30/07, Steven Rostedt [EMAIL PROTECTED] wrote: But, the -rt kernel has pretty much the same code for the futex_unlock_pi64, and it has the same bug. Why would you use futex_unlock_pi64? In fact, the whole 64-bit futex patch should be reviewed and cut down to the bare minimum. I know, I

<    1   2   3   4   5   6   7   8   >