• R/O
  • HTTP
  • SSH
  • HTTPS

linux-2.4.36: コミット一覧

2.4.36-stable kernel tree


RSS
Rev. 日時 作者
2bd6c95 2005-07-27 05:26:44 David S. Miller

[NETLINK]: Fix two socket hashing bugs.

1) netlink_release() should only decrement the hash entry
count if the socket was actually hashed.

This was causing hash->entries to underflow, which
resulting in all kinds of troubles.

On 64-bit systems, this would cause the following
conditional to erroneously trigger:

err = -ENOMEM;
if (BITS_PER_LONG > 32 && unlikely(hash->entries >= UINT_MAX))
goto err;

2) netlink_autobind() needs to propagate the error return from
netlink_insert(). Otherwise, callers will not see the error
as they should and thus try to operate on a socket with a zero pid,
which is very bad.

However, it should not propagate -EBUSY. If two threads race
to autobind the socket, that is fine. This is consistent with the
autobind behavior in other protocols.

So bug #1 above, combined with this one, resulted in hangs
on netlink_sendmsg() calls to the rtnetlink socket. We'd try
to do the user sendmsg() with the socket's pid set to zero,
later we do a socket lookup using that pid (via the value we
stashed away in NETLINK_CB(skb).pid), but that won't give us the
user socket, it will give us the rtnetlink socket. So when we
try to wake up the receive queue, we dive back into rtnetlink_rcv()
which tries to recursively take the rtnetlink semaphore.

Thanks to Jakub Jelink for providing backtraces. Also, thanks to
Herbert Xu for supplying debugging patches to help track this down,
and also finding a mistake in an earlier version of this fix.

Signed-off-by: David S. Miller <davem@davemloft.net>

49ffecf 2005-07-27 00:58:51 Tim Yamin

Merge with rsync://rsync.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.4.git/
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.4.git/

da29f83 2005-07-27 05:45:51 Jakub Bogusz

[SPARC64]: fix sys32_utimes(somefile, NULL)

This patch fixes utimes(somefile, NULL) syscalls on sparc64 kernel with
32-bit userland - use of uninitialized value resulted in making random
timestamps, which confused e.g. sudo.
It has been already fixed (by davem) in linux-2.6 tree 30 months ago.

Signed-off-by: Jakub Bogusz <qboosh@pld-linux.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

cd28e52 2005-07-27 00:47:36 Tim Yamin

The gzip description is as good as the ChangeLog says it is -: "Set n to
length of v, to detect improper tables" and "Don't accidentally grow j
past z". The return 2 instead of the return 0 is so that we actually
error out if we also get inproper tables (for some reason the code
returned "OK" in such cases).

Fix outstanding security bugs in the Linux zlib implementations. See:

a) http://sources.redhat.com/ml/bug-gnu-utils/1999-06/msg00183.html
b) http://bugs.gentoo.org/show_bug.cgi?id=94584

Signed-off-by: Tim Yamin <plasmaroo@gentoo.org>
Signed-off-by: Tavis Ormandy <taviso@gentoo.org>

cc54d13 2005-07-26 19:52:46 Larry Woodman

[PATCH] workaround inode cache (prune_icache/__refile_inode) SMP races

Over the past couple of weeks we have seen two races in the inode cache
code. The first is between [dispose_list()] and __refile_inode() and the
second is between prune_icache() and truncate_inodes(). I posted both of
these patches but wanted to make sure they got properly reviewed and
included in RHEL3-U6.

Fixes bug 155289.

The first scenerio is:

1.) cpu0 is in __sync_one() just about to call __refile_inode() after
taking the inode_lock and clearing I_LOCK.

spin_lock(&inode_lock);
inode->i_state &= ~I_LOCK;
if (!(inode->i_state & I_FREEING))
__refile_inode(inode);
wake_up(&inode->i_wait);

2.) cpu1 is in [dispose_list()] where it has dropped the inode_lock and calls
clear_inode(). It doesnt block because
I_LOCK is clear so it sets the inode state.

void clear_inode(struct inode *inode)
{
...
wait_on_inode(inode);
...
inode->i_state = I_CLEAR;
...
}

3.) cpu0 calls __refile_inode which places is on one of the four
possible inode lists

static inline void __refile_inode(struct inode *inode)
{
if (inode->i_state & I_DIRTY)
to = &inode->i_sb->s_dirty;
else if (atomic_read(&inode->i_count))
to = &inode_in_use;
else if (inode->i_data.nrpages)
to = &inode_unused_pagecache;
else
to = &inode_unused;

list_del(&inode->i_list);
list_add(&inode->i_list, to);
}

4.) cpu1 returns from clear_inode() then calls destroy_inode() which
kmem_cache_free()s it.

static void destroy_inode(struct inode *inode)
{

if (inode->i_sb->s_op->destroy_inode)
inode->i_sb->s_op->destroy_inode(inode);
else
kmem_cache_free(inode_cachep, inode);
}

5.) at this point we have an inode that has been kmem_cache_free()'d
that is also sitting one of the lists determined by __refile_inode(),
that cant be good!!! Also, the code looks the same in RHEL4.

The second scenerio is:

CPU0 is in prune_icache() called by kswapd and CPU1 is in
invalidate_inodes() called by the auto-mount daemon.

1.) CPU0: prune_icache() sets the I_LOCK bit in an inode on the
inode_unused_pagecache list, releases the inode_lock and calls
invalidate_inode_pages.

2.) CPU1: invalidate_inodes() calls invalidate_list() for the
inode_unused_pagecache list with the node_lock held and sets the
I_FREEING bit in the inode->i_state.

3.) CPU0: prune_icache() acquires the inode_lock and clears the I_LOCK
bit in the inode->i_state.

4.) CPU1: dispose_list() calls clear_inode() without the inode_lock
held. Since the I_LOCK bit is clear, clear_inode() sets inode->i_state =
I_CLEAR, clearing the I_FREEING bit.

5.) CPU0: prune_icache() calls __refile_inode() because clear_inode()
cleared I_FREEING without holding the inode_lock. This inode that is no
longer on the inode_unused_pagecache list which results in that inode
being placed on the inode_unused list.

6.) CPU1: dispose_list() calls destroy_inode() which kmem_cache_free()s
an inode that is also on the inode_unused list.

At this point there is an inode that has been kmem_cache_free()'d and is
also on the inode_unused list.

This patch to clear_inode() acquires the inode_lock before manipulating
the inode->i_state field. This is the only place in the kernel that
manipulates the inode without holding the inode_lock.

2e8f68c 2005-07-26 17:33:09 Alan Stern

[PATCH] file_storage and UHCI bugfixes

The patch below (as547) corrects two minor errors, one in the
file_storage gadget driver (need to send a length-zero packet if a
control response is short) and one in the alternate UHCI driver (need
to set the QH bit in the frame list). Both of these are back-ports of
things that have been in 2.6 for several releases.

Alan Stern

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>

d09a5ee 2005-07-26 03:12:30 Pete Zaitcev

[PATCH] usb: printer double up()

Doing a double up() is actually safe in Linux, but still, it's a bug.
This fix is present in 2.6.13-rc3.

By Domen Puncer <domen@coderock.org>
up(&usblp->sem) was called twice in a row in this code path.

c9a8f5a 2005-07-24 09:12:48 Jeff Garzik

libata: update to 2.6.x latest

Minor stuff:
* doc updates
* pci id updates
* new ->host_stop behavior
* fix bugs in PIO data xfer, SATA probe, large disk SCSI xlat

451771c 2005-07-07 15:58:59 Marcelo Tosatti

Revert [NETLINK]: Fix two socket hashing bugs.

I premutarely applied this fix - its not complete yet.

Revert.

cbff79e 2005-07-05 01:53:38 Marcelo

Change VERSION to 2.4.32-pre1

c9587df 2005-07-02 00:09:04 Marcelo

Merge of http://rsync.kernel.org/pub/scm/linux/kernel/git/davem/net-2.4

c324de4 2005-07-01 08:02:17 Andi Kleen

[PATCH] x86-64: Enable Nvidia timer override workaround for SMP kernels too

>From Tymm Twillman

In the 2.4.30/31 kernels there is now a backport from the 2.6 kernels of
a workaround for buggy timer overrides in the ACPI tables for many
nvidia chipset based motherboards. Unfortunately the code for this on
x86-64 based systems is conditionally compiled in only for non-SMP
kernels. This is a patch to remove the conditional and allow the code
to be compiled in for SMP kernels as well (we've seen a number of SMP
motherboards which intermittently lock up during boot, and otherwise
sometimes seem unstable without the workaround). Patch so far has been
tested across numerous reboots and several hours uptime.

Signed-off-by: Andi Kleen <ak@suse.de>

478fa85 2005-07-01 08:02:16 Andi Kleen

[PATCH] x86-64: Fix build with !CONFIG_SWIOTLB

Allow compilation without CONFIG_SWIOTLB

Pointed out by Tymm Twillman. I did the patch slightly differently
than his version.

Signed-off-by: Andi Kleen <ak@suse.de>

51e3154 2005-07-01 08:02:14 Andi Kleen

[PATCH] x86_64: Disable exception stack for stack faults

Stack segment faults were executed on a exception stack. But they
use the normal return path and can schedule there, but scheduling
is not allowed on a exception stack.

Just drop the exception stack for stack segment faults. This
will make some oops triple fault now, but that's better than
allowing user triggerable oops.

Double faults still have this problem, but if they happen you
have enough other problems already that this one doesn't matter
anymore.

2.6 has a more complicated fix here that actually handles
this properly, but for 2.4 the simple version is better.

Found from RedHat QA using crashme

Signed-off-by: Andi Kleen <ak@suse.de>

3a36ef7 2005-06-29 22:50:00 Andi Kleen

[PATCH] Fix canonical checking for segment registers in ptrace

Fix canonical checking for segment registers in ptrace

This avoids a local DOS where a process could oops the kernel by
passing bogus values to ptrace. Some versions of UML did this.

Found by Alexander Nyberg

Signed-off-by: Andi Kleen <ak@suse.de>

2e7fe37 2005-06-29 22:49:53 Andi Kleen

[PATCH] Check for canonical addresses in ptrace

Check for canonical addresses in ptrace

This works around a AMD bug that allows to hang the CPU by passing
illegal addresses.

Signed-off-by: Andi Kleen <ak@suse.de>

1e483bd 2005-06-29 22:49:46 Andi Kleen

[PATCH] Fix buffer overflow in x86-64/ia64 32bit execve

Fix buffer overflow in x86-64/ia64 32bit execve

Originally noted by Ilja van Sprundel

I fixed it for both x86-64 and IA64. Other architectures
are not affected.

Signed-off-by: Andi Kleen <ak@suse.de>

aedc33f 2005-06-26 16:20:15 David S. Miller

[NETLINK]: Fix two socket hashing bugs.

1) netlink_release() should only decrement the hash entry
count if the socket was actually hashed.

This was causing hash->entries to underflow, which
resulting in all kinds of troubles.

On 64-bit systems, this would cause the following
conditional to erroneously trigger:

err = -ENOMEM;
if (BITS_PER_LONG > 32 && unlikely(hash->entries >= UINT_MAX))
goto err;

2) netlink_autobind() needs to propagate the error return from
netlink_insert(). Otherwise, callers will not see the error
as they should and thus try to operate on a socket with a zero pid,
which is very bad.

So bug #1 above, combined with this one, resulted in hangs
on netlink_sendmsg() calls to the rtnetlink socket. We'd try
to do the user sendmsg() with the socket's pid set to zero,
later we do a socket lookup using that pid (via the value we
stashed away in NETLINK_CB(skb).pid), but that won't give us the
user socket, it will give us the rtnetlink socket. So when we
try to wake up the receive queue, we dive back into rtnetlink_rcv()
which tries to recursively take the rtnetlink semaphore.

Thanks to Jakub Jelink for providing backtraces, and Herbert Xu for
debugging patches to help track this down.

Signed-off-by: David S. Miller <davem@davemloft.net>

bb6c408 2005-06-23 09:17:43 Marcelo

Merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.4

9143f9a 2005-06-20 12:23:14 David S. Miller

[SPARC64]: Fix cmsg length checks in Solaris emulation layer.

Signed-off-by: David S. Miller <davem@davemloft.net>

bc4a598 2005-06-20 10:28:11 David S. Miller

[SPARC64]: Fix conflicting __bzero_noasi() prototypes.

Signed-off-by: David S. Miller <davem@davemloft.net>

47edc91 2005-06-10 04:22:54 Ralf Baechle

[PATCH] update netdev address

Change the address of netdev in 2.4 also.

6a76456 2005-06-10 03:49:59 H. J. Lu

[PATCH] newer i386/x86_64 assemblers prohibit instructions for moving between a seg register and a 32bit location

The new i386/x86_64 assemblers no longer accept instructions for moving
between a segment register and a 32bit memory location, i.e.,

movl (%eax),%ds
movl %ds,(%eax)

To generate instructions for moving between a segment register and a
16bit memory location without the 16bit operand size prefix, 0x66,

mov (%eax),%ds
mov %ds,(%eax)

should be used. It will work with both new and old assemblers. The
assembler starting from 2.16.90.0.1 will also support

movw (%eax),%ds
movw %ds,(%eax)

without the 0x66 prefix. I am enclosing patches for 2.4 and 2.6 kernels
here. The resulting kernel binaries should be unchanged as before, with
old and new assemblers, if gcc never generates memory access for

unsigned gsindex;
asm volatile("movl %%gs,%0" : "=g" (gsindex));

If gcc does generate memory access for the code above, the upper bits
in gsindex are undefined and the new assembler doesn't allow it.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

1f34177 2005-06-09 01:24:51 Pete Zaitcev

[PATCH] USB 2.4.31: ftdi_sio fixes

These are 7 fixes that Ian Abbott sent me in 2.4.31 frame and which were
delayed while 2.4.31 stabilized.

- A big batch of new IDs, backported from 2.6; with renamed CANview
- Change the message about zero length write to warning
- Fix custom baud bases (by Rogier Wolff)
- Unregister user-specified tables, or else we oops on rmmod
- Actually initialize user-specified devices, using FT8U232AM template
- Add ID for UM100 (by Armin Laugher)
- Restore RTS and DTR after B0 (originally by Nathan Croy)

63789b3 2005-06-08 01:26:54 NeilBrown

[PATCH] Claim i_alloc_sem while changing file size in nfsd

nfsd should hold i_alloc_sem while calling notify_change
with ATTR_SIZE set, just like do_truncate does.

From: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>

### Diffstat output
./fs/nfsd/vfs.c | 2 ++
1 files changed, 2 insertions(+)

diff ./fs/nfsd/vfs.c~current~ ./fs/nfsd/vfs.c

c3616f6 2005-06-03 06:04:06 NeilBrown

[PATCH] Don't drop setuid on directories when ownership changed by NFSd

..as setuid means something totally different on directories.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>

diff ./fs/nfsd/vfs.c~current~ ./fs/nfsd/vfs.c

f68679b 2005-06-03 06:03:57 Marcel Holtmann

[PATCH] Fix" introduced in 2.4.27pre2 for bluetooth hci_usb race causes kernel hang

> I have noticed a problem with a race condition fix introduced in
> 2.4.27-pre2 that causes the kernel to hang when disconnecting a
> Bluetooth USB dongle or doing 'hciconfig hci0 down'. No message is
> printed, the kernel just doesn't respond anymore.

if this works then we should do the same change in the bfusb driver. A
patch that fixes both drivers is attached.

284ce8b 2005-06-03 05:44:34 Marcelo

initial v2.4 GIT import

旧リポジトリブラウザで表示