]> git.kernelconcepts.de Git - karo-tx-linux.git/log
karo-tx-linux.git
17 years agoLinux 2.6.16.47-rc1 v2.6.16.47-rc1
Adrian Bunk [Tue, 10 Apr 2007 21:07:31 +0000 (23:07 +0200)]
Linux 2.6.16.47-rc1

17 years agoAPPLETALK: Fix a remotely triggerable crash (CVE-2007-1357)
Jean Delvare [Tue, 10 Apr 2007 21:06:06 +0000 (23:06 +0200)]
APPLETALK: Fix a remotely triggerable crash (CVE-2007-1357)

When we receive an AppleTalk frame shorter than what its header says,
we still attempt to verify its checksum, and trip on the BUG_ON() at
the end of function atalk_sum_skb() because of the length mismatch.

This has security implications because this can be triggered by simply
sending a specially crafted ethernet frame to a target victim,
effectively crashing that host. Thus this qualifies, I think, as a
remote DoS. Here is the frame I used to trigger the crash, in npg
format:

<Appletalk Killer>
{
# Ethernet header -----

  XX XX XX XX XX XX  # Destination MAC
  00 00 00 00 00 00  # Source MAC
  00 1D              # Length

# LLC header -----

  AA AA 03
  08 00 07 80 9B  # Appletalk

# Appletalk header -----

  00 1B        # Packet length (invalid)
  00 01        # Fake checksum
  00 00 00 00  # Destination and source networks
  00 00 00 00  # Destination and source nodes and ports

# Payload -----

  0C 0D 0E 0F 10 11 12 13
  14
}

The destination MAC address must be set to those of the victim.

The severity is mitigated by two requirements:
* The target host must have the appletalk kernel module loaded. I
  suspect this isn't so frequent.
* AppleTalk frames are non-IP, thus I guess they can only travel on
  local networks. I am no network expert though, maybe it is possible
  to somehow encapsulate AppleTalk packets over IP.

The bug has been reported back in June 2004:
  http://bugzilla.kernel.org/show_bug.cgi?id=2979
But it wasn't investigated, and was closed in July 2006 as both
reporters had vanished meanwhile.

This code was new in kernel 2.6.0-test5:
  http://git.kernel.org/?p=linux/kernel/git/tglx/history.git;a=commitdiff;h=7ab442d7e0a76402c12553ee256f756097cae2d2
And not modified since then, so we can assume that vanilla kernels
2.6.0-test5 and later, and distribution kernels based thereon, are
affected.

Note that I still do not know for sure what triggered the bug in the
real-world cases. The frame could have been corrupted by the kernel if
we have a bug hiding somewhere. But more likely, we are receiving the
faulty frame from the network.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agosiimage: PIO1/2 taskfile transfer overclocking fix
Sergei Shtylyov [Sun, 8 Apr 2007 23:16:18 +0000 (01:16 +0200)]
siimage: PIO1/2 taskfile transfer overclocking fix

Fix two typos found by SiI680A documentation check.  They caused the taskfile
transfer overclocking:

- in PIO mode 1 as 0x2283 must be used for both data and taskfile transfers;

- in PIO mode 2 as data and taskfile timings are swapped when writing to the
  MMIO regs.

Fix coding style and trailing whitespace in enclosing statements while at it...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agohrtimer: prevent overrun DoS in hrtimer_forward()
Thomas Gleixner [Sun, 8 Apr 2007 23:04:23 +0000 (01:04 +0200)]
hrtimer: prevent overrun DoS in hrtimer_forward()

hrtimer_forward() does not check for the possible overflow of
timer->expires. This can happen on 64 bit machines with large interval
values and results currently in an endless loop in the softirq because
the expiry value becomes negative and therefor the timer is expired all
the time.

Check for this condition and set the expiry value to the max. expiry
time in the future.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agofix MTIME_SEC_MAX on 32-bit
Thomas Gleixner [Sun, 8 Apr 2007 22:54:30 +0000 (00:54 +0200)]
fix MTIME_SEC_MAX on 32-bit

The maximum seconds value we can handle on 32bit is LONG_MAX.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoprevent timespec/timeval to ktime_t overflow
Thomas Gleixner [Sun, 8 Apr 2007 22:03:30 +0000 (00:03 +0200)]
prevent timespec/timeval to ktime_t overflow

Frank v.  Waveren pointed out that on 64bit machines the timespec to
ktime_t conversion might overflow.  This is also true for timeval to
time_t conversions.  This breaks a "sleep inf" on 64bit machines.

While a timespec/timeval with tx.sec = MAX_LONG is valid by specification
the internal representation of ktime_t is based on nanoseconds.  The
conversion of seconds to nanoseconds overflows for seconds values >=
(MAX_LONG / NSEC_PER_SEC).

Check the seconds argument to the conversion and limit it to the maximum
time which can be represented by ktime_t.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoieee1394: video1394: DMA fix
David Moore [Sun, 8 Apr 2007 21:54:41 +0000 (23:54 +0200)]
ieee1394: video1394: DMA fix

This together with the phys_to_virt fix in lib/swiotlb.c::swiotlb_sync_sg
fixes video1394 DMA on machines with DMA bounce buffers, especially Intel
x86-64 machines with > 3GB RAM.

Signed-off-by: David Moore <dcm@acm.org>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoFix reparenting to the same thread group. (take 2)
Eric W. Biederman [Sun, 8 Apr 2007 21:47:24 +0000 (23:47 +0200)]
Fix reparenting to the same thread group. (take 2)

This patch fixes the case when we reparent to a different thread in the
same thread group.  This modifies the code so that we do not send
signals and do not change the signal to send to SIGCHLD unless we have
change the thread group of our parents.  It also suppresses sending
pdeath_sig in this cas as well since the result of geppid doesn't
change.

Thanks to Oleg for spotting my bug of only fixing this for non-ptraced
tasks.

This fixes the issues identified by Albert Cahalan in thread
http://lkml.org/lkml/2006/12/21/22

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agotcp: fix cubic scaling error
Stephen Hemminger [Sun, 8 Apr 2007 21:45:04 +0000 (23:45 +0200)]
tcp: fix cubic scaling error

Doug Leith observed a discrepancy between the version of CUBIC described
in the papers and the version in 2.6.18. A math error related to scaling
causes Cubic to grow too slowly.

Patch is from "Sangtae Ha" <sha2@ncsu.edu>. I validated that
it does fix the problems.

See the following to show behavior over 500ms 100 Mbit link.

Sender (2.6.19-rc3) ---  Bridge (2.6.18-rt7) ------- Receiver (2.6.19-rc3)
                    1G      [netem]           100M

        http://developer.osdl.org/shemminger/tcp/2.6.19-rc3/cubic-orig.png
        http://developer.osdl.org/shemminger/tcp/2.6.19-rc3/cubic-fix.png

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[netdrvr] tulip, de2104x: fix typo: s/__sparc_/__sparc__/
Jeff Garzik [Wed, 4 Apr 2007 21:45:53 +0000 (23:45 +0200)]
[netdrvr] tulip, de2104x: fix typo: s/__sparc_/__sparc__/

Noticed by Doug Nazar (via David Miller).

Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agob44: src_desc->addr is little-endian
Al Viro [Wed, 4 Apr 2007 21:32:02 +0000 (23:32 +0200)]
b44: src_desc->addr is little-endian

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoide-floppy: Fix unformatted media crash
Alan Cox [Wed, 4 Apr 2007 19:34:22 +0000 (21:34 +0200)]
ide-floppy: Fix unformatted media crash

A ZIP or similar with unformatted media will cause crashes when attempts
are made to read/write it in some cases. This is because bs_factor is
zero and we divide by it causing an oops.

As the size of a non-accessible/non-existant media is really a bit of a
zen question it doesn't matter if non-existant media is 512 bytes per
sector or zero. Setting it to 1 causes us to generate 512 bytes/sector
accesses and error properly.

Based on a fix found lurking in an ancient bugzilla entry since about 2004 (ugghhh)

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[IFB]: Fix crash on input device removal
Patrick McHardy [Tue, 3 Apr 2007 02:03:55 +0000 (04:03 +0200)]
[IFB]: Fix crash on input device removal

The input_device pointer is not refcounted, which means the device may
disappear while packets are queued, causing a crash when ifb passes packets
with a stale skb->dev pointer to netif_rx().

Fix by storing the interface index instead and do a lookup where neccessary.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[VIDEO] ffb: Fix two DAC handling bugs.
David S. Miller [Mon, 2 Apr 2007 23:50:31 +0000 (01:50 +0200)]
[VIDEO] ffb: Fix two DAC handling bugs.

The determination of whether the DAC has inverted cursor logic is
broken, import the version checks the X.org driver uses to fix this.

Next, when we change the timing generator, borrow code from X.org that
does 10 NOP reads of the timing generator register afterwards to make
sure the video-enable transition occurs cleanly.

Finally, use macros for the DAC registers and fields in order to
provide documentation for the next person who reads this code.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoLinux 2.6.16.46 v2.6.16.46
Adrian Bunk [Sat, 31 Mar 2007 20:21:00 +0000 (22:21 +0200)]
Linux 2.6.16.46

17 years agoLinux 2.6.16.46-rc1 v2.6.16.46-rc1
Adrian Bunk [Wed, 28 Mar 2007 20:43:59 +0000 (22:43 +0200)]
Linux 2.6.16.46-rc1

17 years ago[ALSA] ca0106 - Add missing sysfs device assignment
Takashi Iwai [Wed, 28 Mar 2007 20:40:35 +0000 (22:40 +0200)]
[ALSA] ca0106 - Add missing sysfs device assignment

Added the missing device assignment before creating sysfs tree.
This caused the insufficient device permissions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[ALSA] cs4281 - Fix the check of right channel
Takashi Iwai [Wed, 28 Mar 2007 20:39:55 +0000 (22:39 +0200)]
[ALSA] cs4281 - Fix the check of right channel

Fix the check of right channel in mixer volume put callback.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[ALSA] Dereference after free in snd_hwdep_release()
Florin Malita [Wed, 28 Mar 2007 20:38:55 +0000 (22:38 +0200)]
[ALSA] Dereference after free in snd_hwdep_release()

snd_card_file_remove() may free hw->card so we can't dereference
hw->card->module after that.
Coverity ID 1420.

Signed-off-by: Florin Malita <fmalita@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[ALSA] cmipci - Fix a typo in 'PC Speaker Playback Switch' control
Takashi Iwai [Wed, 28 Mar 2007 20:36:35 +0000 (22:36 +0200)]
[ALSA] cmipci - Fix a typo in 'PC Speaker Playback Switch' control

Fixed a typo in  'PC Speaker Playback Switch' control name.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[ALSA] fix NULL pointer dereference in sound/synth/emux/soundfont.c
Eric Sesterhenn [Wed, 28 Mar 2007 20:35:52 +0000 (22:35 +0200)]
[ALSA] fix NULL pointer dereference in sound/synth/emux/soundfont.c

this is about coverity id #100.
It seems the if statement is negated, since the else branch calls
remove_info() with sflist->currsf as a parameter where it gets
dereferenced.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[ALSA] Fix invalid assignment of PCI revision
Takashi Iwai [Wed, 28 Mar 2007 20:32:32 +0000 (22:32 +0200)]
[ALSA] Fix invalid assignment of PCI revision

Fix the type of PCI revision to char from int and avoid invalid
assignment with pointer cast.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[ALSA] hda-intel - Don't try to probe invalid codecs
Takashi Iwai [Wed, 28 Mar 2007 20:29:24 +0000 (22:29 +0200)]
[ALSA] hda-intel - Don't try to probe invalid codecs

Fix the max number of codecs detected by HD-intel (and compatible)
controllers.

ATI controllers may have up to 4 codecs while ICH up to 3.
Now max codecs is defined according to the driver type, either 3 or 4.
Currently 4 is set only to ATI chips.  Other might need the same
change, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[ALSA] hda-codec - Don't return error at initialization of modem codec
Takashi Iwai [Wed, 28 Mar 2007 20:28:59 +0000 (22:28 +0200)]
[ALSA] hda-codec - Don't return error at initialization of modem codec

Some modem codec seem to fail in the initialization, and this
stopped loading of the whole module although the audio is OK.
Since it's usually a non-fatal issue, the driver tries to proceed
to initialize now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agousb-audio: work around wrong frequency in CM6501 descriptors
Clemens Ladisch [Wed, 28 Mar 2007 20:28:33 +0000 (22:28 +0200)]
usb-audio: work around wrong frequency in CM6501 descriptors

The C-Media CM6501 chip's descriptors say that altsetting 5 supports
48 kHz, but it actually plays at 96 kHz.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agosound/pci/au88x0/au88x0.c: ioremap balanced with iounmap
Amol Lad [Wed, 28 Mar 2007 20:27:42 +0000 (22:27 +0200)]
sound/pci/au88x0/au88x0.c: ioremap balanced with iounmap

Signed-off-by: Amol Lad <amol@verismonetworks.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[IPV6] HASHTABLES: Use appropriate seed for caluculating ehash index.
YOSHIFUJI Hideaki [Wed, 28 Mar 2007 20:04:44 +0000 (22:04 +0200)]
[IPV6] HASHTABLES: Use appropriate seed for caluculating ehash index.

Tetsuo Handa <handat@pm.nttdata.co.jp> told me that connect(2) with TCPv6
socket almost always took a few minutes to return when we did not have any
ports available in the range of net.ipv4.ip_local_port_range.

The reason was that we used incorrect seed for calculating index of
hash when we check established sockets in __inet6_check_established().

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[PPP]: Don't leak an sk_buff on interface destruction.
Guennadi Liakhovetski [Wed, 28 Mar 2007 20:00:29 +0000 (22:00 +0200)]
[PPP]: Don't leak an sk_buff on interface destruction.

Signed-off-by: Guennadi Liakhovetski <gl@dsa-ac.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[NET_SCHED]: Fix ingress locking
Patrick McHardy [Wed, 28 Mar 2007 19:58:20 +0000 (21:58 +0200)]
[NET_SCHED]: Fix ingress locking

Ingress queueing uses a seperate lock for serializing enqueue operations,
but fails to properly protect itself against concurrent changes to the
qdisc tree. Use queue_lock for now since the real fix it quite intrusive.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[NET_SCHED]: cls_basic: fix NULL pointer dereference
Patrick McHardy [Wed, 28 Mar 2007 19:56:42 +0000 (21:56 +0200)]
[NET_SCHED]: cls_basic: fix NULL pointer dereference

cls_basic doesn't allocate tp->root before it is linked into the
active classifier list, resulting in a NULL pointer dereference
when packets hit the classifier before its ->change function is
called.

Reported by Chris Madden <chris@reflexsecurity.com>

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: RAZR v3i unusual_devs
Pete Zaitcev [Wed, 28 Mar 2007 19:45:16 +0000 (21:45 +0200)]
USB: RAZR v3i unusual_devs

This adds an unusual_devs entry for the Motorola RAZR 3vi.

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB storage: Nokia 6288 unusual_devs entry
Andrew Nayenko [Wed, 28 Mar 2007 19:44:39 +0000 (21:44 +0200)]
USB storage: Nokia 6288 unusual_devs entry

This patch adds an usual_devs entry for the Nokia 6288.

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB Storage: US_FL_IGNORE_RESIDUE needed for Aiptek MP3 Player
Dylan Taft [Wed, 28 Mar 2007 19:43:59 +0000 (21:43 +0200)]
USB Storage: US_FL_IGNORE_RESIDUE needed for Aiptek MP3 Player

Device will not work as a mass storage device without US_FL_IGNORE_RESIDUE.

I bought this mp3 player that takes SD cards here

http://www.aiptek.com/Merchant2/merchant.mvc?Screen=PROD&Product_Code=AX4&Category_Code=MP3&Store_Code=AS

Signed-off-by: Dylan Taft <d13f00l@gmail.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: unusual_devs.h for Sony floppy
Luiz Fernando N. Capitulino [Wed, 28 Mar 2007 19:42:29 +0000 (21:42 +0200)]
USB: unusual_devs.h for Sony floppy

This patch increases the range for 0x054c:0x002c devices to make
the following Sony USB floppy to work:

T:  Bus=02 Lev=01 Prnt=01 Port=02 Cnt=02 Dev#=  6 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=054c ProdID=002c Rev=20.00
S:  Manufacturer=SONY
S:  Product=USB Floppy
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=04 Prot=00 Driver=usb-storage
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=83(I) Atr=03(Int.) MxPS=   2 Ivl=127ms

Signed-off-by: Marcelo Ricardo Leitner <mrl@mandriva.com>
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[NET_SCHED]: Fix endless loops caused by inaccurate qlen counters
Patrick McHardy [Wed, 28 Mar 2007 19:31:36 +0000 (21:31 +0200)]
[NET_SCHED]: Fix endless loops caused by inaccurate qlen counters

There are multiple problems related to qlen adjustment that can lead
to an upper qdisc getting out of sync with the real number of packets
queued, leading to endless dequeueing attempts by the upper layer code.

All qdiscs must maintain an accurate q.qlen counter. There are basically
two groups of operations affecting the qlen: operations that propagate
down the tree (enqueue, dequeue, requeue, drop, reset) beginning at the
root qdisc and operations only affecting a subtree or single qdisc
(change, graft, delete class). Since qlen changes during operations from
the second group don't propagate to ancestor qdiscs, their qlen values
become desynchronized.

This patch adds a function to propagate qlen changes up the qdisc tree,
optionally calling a callback function to perform qdisc-internal
maintenance when the child qdisc is deactivated, and converts all
qdiscs to use this where necessary.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agomm: fix madvise infinine loop
Nick Piggin [Wed, 28 Mar 2007 19:29:38 +0000 (21:29 +0200)]
mm: fix madvise infinine loop

madvise(MADV_REMOVE) can go into an infinite loop or cause an oops if the
call covers a region from the start of a vma, and extending past that vma.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Acked-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[SERIAL] Fix oops when removing suspended serial port
Russell King [Wed, 28 Mar 2007 19:28:32 +0000 (21:28 +0200)]
[SERIAL] Fix oops when removing suspended serial port

A serial card might have been removed when the system is resumed.
This results in a suspended port being shut down, which results in
the ports shutdown method being called twice in a row.  This causes
BUGs.  Avoid this by tracking the suspended state separately from
the initialised state.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoieee1394: dv1394: fix CardBus card ejection
Stefan Richter [Mon, 26 Mar 2007 22:49:40 +0000 (00:49 +0200)]
ieee1394: dv1394: fix CardBus card ejection

Fix NULL pointer dereference on hot ejection of a FireWire card while
dv1394 was loaded.  http://bugzilla.kernel.org/show_bug.cgi?id=7121

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agomd: fix /proc/mdstat refcounting
Akinbou Mita [Mon, 26 Mar 2007 21:43:10 +0000 (23:43 +0200)]
md: fix /proc/mdstat refcounting

I have seen mdadm oops after successfully unloading md module.

This patch privents from unloading md module while
mdadm is polling /proc/mdstat.

Signed-off-by: Akinbou Mita <akinobu.mita@gmail.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agofix read past end of array in md/linear.c
Andy Isaacson [Mon, 26 Mar 2007 21:42:40 +0000 (23:42 +0200)]
fix read past end of array in md/linear.c

When iterating through an array, one must be careful to test one's index
variable rather than another similarly-named variable.

The loop will read off the end of conf->disks[] in the following
(pathological) case:

% dd bs=1 seek=840716287 if=/dev/zero of=d1 count=1
% for i in 2 3 4; do dd if=/dev/zero of=d$i bs=1k count=$(($i+150)); done
% ./vmlinux ubd0=root ubd1=d1 ubd2=d2 ubd3=d3 ubd4=d4
# mdadm -C /dev/md0 --level=linear --raid-devices=4 /dev/ubd[1234]

adding some printks, I saw this:
[42949374.960000] hash_spacing = 821120
[42949374.960000] cnt          = 4
[42949374.960000] min_spacing  = 801
[42949374.960000] j=0 size=820928 sz=820928
[42949374.960000] i=0 sz=820928 hash_spacing=820928
[42949374.960000] j=1 size=64 sz=64
[42949374.960000] j=2 size=64 sz=128
[42949374.960000] j=3 size=64 sz=192
[42949374.960000] j=4 size=1515870810 sz=1515871002

Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agomd: pass down BIO_RW_SYNC in raid{1,10}
Lars Ellenberg [Mon, 26 Mar 2007 21:41:58 +0000 (23:41 +0200)]
md: pass down BIO_RW_SYNC in raid{1,10}

md raidX make_request functions strip off the BIO_RW_SYNC flag, thus
introducing additional latency.

Fixing this in raid1 and raid10 seems to be straightforward enough.

For our particular usage case in DRBD, passing this flag improved some
initialization time from ~5 minutes to ~5 seconds.

Signed-off-by: Lars Ellenberg <lars@linbit.com>
Acked-by: NeilBrown <neilb@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agomd: Fix bug where spares don't always get rebuilt properly when they become live
Neil Brown [Mon, 26 Mar 2007 21:41:22 +0000 (23:41 +0200)]
md: Fix bug where spares don't always get rebuilt properly when they become live

If save_raid_disk is >= 0, then the device could be a device that is
already in sync that is being re-added.  So we need to default this
value to -1.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoMD: Fix problem where hot-added drives are not resynced.
Neil Brown [Mon, 26 Mar 2007 21:40:42 +0000 (23:40 +0200)]
MD: Fix problem where hot-added drives are not resynced.

If a drive is added with HOT_ADD_DISK rather than ADD_NEW_DISK,
saved_raid_disk isn't initialised properly, and the drive can be
included in the array without a resync.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: unusual_devs update for Sony P990i phone
Alan Stern [Mon, 26 Mar 2007 21:35:49 +0000 (23:35 +0200)]
USB: unusual_devs update for Sony P990i phone

This patch (as846) adds the IGNORE_RESIDUE flag to the unusual_devs
entry for Sony-Ericsson's P990i phone.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: unusual_devs entry for Sony DSC-H5
Lars Jacob [Mon, 26 Mar 2007 21:30:19 +0000 (23:30 +0200)]
USB: unusual_devs entry for Sony DSC-H5

This patch (as749) extends the unusual_devs entry for the Sony DSC-T1 and
T5 to cover the H5 as well.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: unusual_devs.h entry for nokia 6233
Manuel Osdoba [Sun, 25 Mar 2007 01:25:00 +0000 (03:25 +0200)]
USB: unusual_devs.h entry for nokia 6233

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: unusual_devs.h for 0x046b:ff40
Pete Zaitcev [Sun, 25 Mar 2007 01:24:11 +0000 (03:24 +0200)]
USB: unusual_devs.h for 0x046b:ff40

American Megatrends did something wrong in their floppy emulator. It breaks
with both kinds of MODE SENSE which our stack sends. Alan and I tried a few
tweaks, and got LUNs sensed right, but US_FL_NO_WP_DETECT is still needed.

I set the firmware bracket to 1.00 exactly, in case AMI or Sun fix it with a
firmware update. Hey, you never know.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: Fix UCR-61S2B unusual_dev entry
Phil Dibowitz [Sun, 25 Mar 2007 01:23:20 +0000 (03:23 +0200)]
USB: Fix UCR-61S2B unusual_dev entry

Recently this entry's bcd scope was narrowed so as not to falsly apply
to bcd's other than 0x0110. But while it breaks those of a larger bcd,
it is still needed for those of a smaller bcd - so this changes the
lower bcd limit to 0x0000.

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agounusual_devs update for UCR-61S2B
Alan Stern [Sun, 25 Mar 2007 01:22:24 +0000 (03:22 +0200)]
unusual_devs update for UCR-61S2B

The existing unusual_devs entry for the UCR-61S2B appears to have too
wide a revision range.  It matches at least one device that doesn't
respond to the initialization sequence.  Perhaps the sequence needs to
be updated, or perhaps something else can be done.  For now, this patch
(as764) restricts the range to include only the revision mentioned in
the original comment.

This resolves (for now!) Bugzilla entry #6950.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB storage: fix ipod ejecting issue
Pete Zaitcev [Sun, 25 Mar 2007 01:18:00 +0000 (03:18 +0200)]
USB storage: fix ipod ejecting issue

Signed-off-by: Pete Zaitcev <zaitcev@yahoo.com>
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB Storage: unusual_devs: add supertop drives
Phil Dibowitz [Sun, 25 Mar 2007 01:17:17 +0000 (03:17 +0200)]
USB Storage: unusual_devs: add supertop drives

This combines patches from Alan Stern and Robert Schedel for two "Super Top"
drives that need the IGNORE_RESIDUE flag but have different vendor IDs.

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: Nokia E70 is an unusual device
Mikko Honkala [Sun, 25 Mar 2007 01:16:42 +0000 (03:16 +0200)]
USB: Nokia E70 is an unusual device

When the Nokia E70 Phone is plugged in to the USB port, I get:

end_request: I/O error, dev sda, sector 1824527
sd 0:0:0:0: SCSI error: return code = 0x10070000
end_request: I/O error, dev sda, sector 1824535
sd 0:0:0:0: SCSI error: return code = 0x10070000

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: add Digitech USB-Storage to unusual_devs.h
Jaco Kroon [Sun, 25 Mar 2007 01:14:22 +0000 (03:14 +0200)]
USB: add Digitech USB-Storage to unusual_devs.h

The mass storage device from Digitech designed for Flash Cards, as found
on (for example) the GNX4 device has issues with residue, similar to the
bug report at http://kerneltrap.org/node/6297.  This patch adds the
faulty storage device to unusual_devs.h, this not only reduces the noise
in dmesg but also increases the transfer speeds by a factor of 7x for me
(89kB/s -> 637kB/s).

T:  Bus=02 Lev=02 Prnt=02 Port=01 Cnt=02 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1210 ProdID=0003 Rev= 1.00
S:  Manufacturer=DigiTech HMG
S:  Product=DigiTech Mass Storage
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50
Driver=usb-storage
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

Signed-off-by: Jaco Kroon <jaco@kroon.co.za>
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: Mitsumi USB FDD 061M: UNUSUAL_DEV multilun fix
Tobias Lorenz [Sun, 25 Mar 2007 01:10:55 +0000 (03:10 +0200)]
USB: Mitsumi USB FDD 061M: UNUSUAL_DEV multilun fix

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: usb-storage: Unusual_dev update
Phil Dibowitz [Sun, 25 Mar 2007 01:10:17 +0000 (03:10 +0200)]
USB: usb-storage: Unusual_dev update

The protocol in this entry is needed for some versions of the device but
not others. This adds the NEED_OVERRIDE flag to prevent it complaining
to users who don't need it.

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: unusual_devs entry for Nokia 6234
Alan Stern [Sun, 25 Mar 2007 01:08:55 +0000 (03:08 +0200)]
USB: unusual_devs entry for Nokia 6234

This patch (as803) adds an unusual_devs entry for the Nokia 6234
mobile phone.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: unusual_devs entry for Nokia 6131
Alan Stern [Sun, 25 Mar 2007 01:06:00 +0000 (03:06 +0200)]
USB: unusual_devs entry for Nokia 6131

This patch (as796) adds an unusual_devs entry for the Nokia 6131, which
doesn't like large transfer sizes.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: unusual-devs entry for Nokia E60
Alan Stern [Sun, 25 Mar 2007 01:03:42 +0000 (03:03 +0200)]
USB: unusual-devs entry for Nokia E60

This patch (as794) adds an unusual_devs entry for the Nokia E60.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: unusual_dev entry for Sony P990i
Phil Dibowitz [Sun, 25 Mar 2007 01:03:13 +0000 (03:03 +0200)]
USB: unusual_dev entry for Sony P990i

This patch is a re-diffed version of one originally sent by
Jan Mate <mate@fiit.stuba.sk>.

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: unusual_devs entry for Lacie DVD+-RW
Alan Stern [Sun, 25 Mar 2007 01:02:24 +0000 (03:02 +0200)]
USB: unusual_devs entry for Lacie DVD+-RW

This patch (as781) adds an entry to unusual_devs.h for the Lacie DVD+-RW
drive.  Apparently its USB interface has requirements similar to the
Genesys Logic interface; it doesn't like data to be sent too soon after
a command.

This fixes Bugzilla #6817.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB Storage: unusual_devs.h for Sony Ericsson M600i
Phil Dibowitz [Sun, 25 Mar 2007 01:01:01 +0000 (03:01 +0200)]
USB Storage: unusual_devs.h for Sony Ericsson M600i

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB floppy drive SAMSUNG SFD-321U/EP was detected 8 times
Jürgen Mell [Sun, 25 Mar 2007 00:59:34 +0000 (01:59 +0100)]
USB floppy drive SAMSUNG SFD-321U/EP was detected 8 times

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: unusual_devs entry for A-VOX WSX-300ER MP3 player
David Kuehling [Sun, 25 Mar 2007 00:57:41 +0000 (01:57 +0100)]
USB: unusual_devs entry for A-VOX WSX-300ER MP3 player

This patch (as763) adds an unusual_devs entry for the A-VOX WSX-300ER MP3
player.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: unusual_devs entry for Nokia 3250
Mario Rettig [Sun, 25 Mar 2007 00:57:06 +0000 (01:57 +0100)]
USB: unusual_devs entry for Nokia 3250

Here is another unusual_devs entry (as760) for another Nokia device,
this time the 3250.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: another unusual device
Phil Dibowitz [Sun, 25 Mar 2007 00:56:30 +0000 (01:56 +0100)]
USB: another unusual device

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: unusual_devs entry for Nokia E61
Alan Stern [Sun, 25 Mar 2007 00:56:02 +0000 (01:56 +0100)]
USB: unusual_devs entry for Nokia E61

This patch (as748) adds an unusual_devs entry for the Nokia E61 mobile
phone.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: unusual_devs entry for Nokia N91
Alan Stern [Sun, 25 Mar 2007 00:55:30 +0000 (01:55 +0100)]
USB: unusual_devs entry for Nokia N91

This patch (as745) adds an unusual_devs entry for the Nokia N91, just like
the entry for the N80 added a couple of weeks ago.  Apparently Nokia isn't
using very good firmware these days...

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB Storage: US_FL_MAX_SECTORS_64 flag
Phil Dibowitz [Sun, 25 Mar 2007 00:54:59 +0000 (01:54 +0100)]
USB Storage: US_FL_MAX_SECTORS_64 flag

This patch adds a US_FL_MAX_SECTORS_64 and removes the Genesys special-cases
for this that were in scsiglue.c. It also adds the flag to other devices
reported to need it.

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: unusual_devs entry for Samsung MP3 player
Ernis [Sun, 25 Mar 2007 00:53:46 +0000 (01:53 +0100)]
USB: unusual_devs entry for Samsung MP3 player

This patch (as730) contains an unusual_devs entry for a Samsung MP3
device.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agousb-storage: unusual_devs entry for Motorola RAZR V3x
Davide Perini [Sun, 25 Mar 2007 00:53:16 +0000 (01:53 +0100)]
usb-storage: unusual_devs entry for Motorola RAZR V3x

This patch (as725) adds an unusual_devs entry for the Motorola RAZR V3x.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: unusual_devs entry for Nokia N80
Alan Stern [Sun, 25 Mar 2007 00:52:47 +0000 (01:52 +0100)]
USB: unusual_devs entry for Nokia N80

Here is a patch (as720) adding an unusual_devs entry for the Nokia N80
mobile phone.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agousb-storage: unusual_devs entry for Nikon DSC D70s
Alan Stern [Sun, 25 Mar 2007 00:52:12 +0000 (01:52 +0100)]
usb-storage: unusual_devs entry for Nikon DSC D70s

This patch (as704) adds an unusual_devs entry for the Nikon DSC D70s,
which uses a different Product ID from the D70.  It also moves the entry
for the DSC E2000 up in the list, to preserve the numerical ordering.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: storage: atmel unusual dev update
Olivier Blondeau [Sun, 25 Mar 2007 00:51:39 +0000 (01:51 +0100)]
USB: storage: atmel unusual dev update

Originally submitted by Olivier Blondeau <zeitoun@gmail.com>, with re-diffing
by me. Adds a new atmel unusual_dev entry.

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: Storage: unusual devs update
Phil Dibowitz [Sun, 25 Mar 2007 00:50:55 +0000 (01:50 +0100)]
USB: Storage: unusual devs update

This patch removes the Protocol portion of the Iomega Click! device as it's not
needed. Not-needed message reported by Kenneth Crudup <kenny@panix.com>

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: storage: new unusual_devs.h entry: Mitsumi 7in1 Card Reader
Rodolfo Quesada [Sun, 25 Mar 2007 00:50:11 +0000 (01:50 +0100)]
USB: storage: new unusual_devs.h entry: Mitsumi 7in1 Card Reader

This patch (as661) adds an unusual_devs entry for the Mitsumi 7in1 Card
reader.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: storage: unusual_devs.h entry 0420:0001
Phil Dibowitz [Sun, 25 Mar 2007 00:49:34 +0000 (01:49 +0100)]
USB: storage: unusual_devs.h entry 0420:0001

Ref
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=176584

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: storage: another unusual_devs.h entry
Phil Dibowitz [Sun, 25 Mar 2007 00:48:56 +0000 (01:48 +0100)]
USB: storage: another unusual_devs.h entry

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoUSB: storage: sandisk unusual_devices entry
Phil Dibowitz [Sun, 25 Mar 2007 00:48:23 +0000 (01:48 +0100)]
USB: storage: sandisk unusual_devices entry

The following adds an unusual_devs entry for the SanDisk ImageMate CompactFlash
USB drive, for the US_FL_FIX_CAPACITY flag. Additionally, it removes trailing
whitespace from the previous entry. It's based on the patch sent by Roman Hodek
<roman@hodek.net>.

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoLinux 2.6.16.45 v2.6.16.45
Adrian Bunk [Sat, 24 Mar 2007 22:57:05 +0000 (23:57 +0100)]
Linux 2.6.16.45

17 years agoLinux 2.6.16.45-rc1 v2.6.16.45-rc1
Adrian Bunk [Sat, 24 Mar 2007 20:54:43 +0000 (21:54 +0100)]
Linux 2.6.16.45-rc1

17 years ago[NETFILTER]: tcp conntrack: accept SYN|URG as valid
Patrick McHardy [Sat, 24 Mar 2007 20:36:52 +0000 (21:36 +0100)]
[NETFILTER]: tcp conntrack: accept SYN|URG as valid

Some stacks apparently send packets with SYN|URG set. Linux accepts
these packets, so TCP conntrack should to.

Pointed out by Martijn Posthuma <posthuma@sangine.com>.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[NETFILTER]: nfnetlink_log: fix use after free
Michał Mirosław [Sat, 24 Mar 2007 20:36:24 +0000 (21:36 +0100)]
[NETFILTER]: nfnetlink_log: fix use after free

Paranoia: instance_put() might have freed the inst pointer when we
spin_unlock_bh().

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[NETFILTER]: nfnetlink_log: fix reference leak
Michał Mirosław [Sat, 24 Mar 2007 20:34:37 +0000 (21:34 +0100)]
[NETFILTER]: nfnetlink_log: fix reference leak

Stop reference leaking in nfulnl_log_packet(). If we start a timer we
are already taking another reference.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[NETFILTER]: nfnetlink_log: fix possible NULL pointer dereference
Michał Mirosław [Sat, 24 Mar 2007 20:33:56 +0000 (21:33 +0100)]
[NETFILTER]: nfnetlink_log: fix possible NULL pointer dereference

Eliminate possible NULL pointer dereference in nfulnl_recv_config().

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[NETFILTER]: nfnetlink_log: fix NULL pointer dereference
Michał Mirosław [Sat, 24 Mar 2007 20:32:13 +0000 (21:32 +0100)]
[NETFILTER]: nfnetlink_log: fix NULL pointer dereference

Fix the nasty NULL dereference on multiple packets per netlink message.

BUG: unable to handle kernel NULL pointer dereference at virtual address 00000004
 printing eip:
f8a4b3bf
*pde = 00000000
Oops: 0002 [#1]
SMP
Modules linked in: nfnetlink_log ipt_ttl ipt_REDIRECT xt_tcpudp iptable_nat nf_nat nf_conntrack
_ipv4 xt_state ipt_ipp2p xt_NFLOG xt_hashlimit ip6_tables iptable_filter xt_multiport xt_mark i
pt_set iptable_raw xt_MARK iptable_mangle ip_tables cls_fw cls_u32 sch_esfq sch_htb ip_set_ipma
p ip_set ipt_ULOG x_tables dm_snapshot dm_mirror loop e1000 parport_pc parport e100 floppy ide_
cd cdrom
CPU:    0
EIP:    0060:[<f8a4b3bf>]    Not tainted VLI
EFLAGS: 00010206   (2.6.20 #5)
EIP is at __nfulnl_send+0x24/0x51 [nfnetlink_log]
eax: 00000000   ebx: f2b5cbc0   ecx: c03f5f54   edx: c03f4000
esi: f2b5cbc8   edi: c03f5f54   ebp: f8a4b3ec   esp: c03f5f30
ds: 007b   es: 007b   ss: 0068
Process swapper (pid: 0, ti=c03f4000 task=c03bece0 task.ti=c03f4000)
Stack: f2b5cbc0 f8a4b401 00000100 c0444080 c012af49 00000000 f6f19100 f6f19000
       c1707800 c03f5f54 c03f5f54 00000123 00000021 c03e8d08 c0426380 00000009
       c0126932 00000000 00000046 c03e9980 c03e6000 0047b007 c01269bd 00000000
Call Trace:
 [<f8a4b401>] nfulnl_timer+0x15/0x25 [nfnetlink_log]
 [<c012af49>] run_timer_softirq+0x10a/0x164
 [<c0126932>] __do_softirq+0x60/0xba
 [<c01269bd>] do_softirq+0x31/0x35
 [<c0104f6e>] do_IRQ+0x62/0x74
 [<c01036cb>] common_interrupt+0x23/0x28
 [<c0101018>] default_idle+0x0/0x3f
 [<c0101045>] default_idle+0x2d/0x3f
 [<c01010fa>] cpu_idle+0xa0/0xb9
 [<c03fb7f5>] start_kernel+0x1a8/0x1ac
 [<c03fb293>] unknown_bootoption+0x0/0x181
 =======================
Code: 5e 5f 5b 5e 5f 5d c3 53 89 c3 8d 40 1c 83 7b 1c 00 74 05 e8 2c ee 6d c7 83 7b 14 00 75 04
 31 c0 eb 34 83 7b 10 01 76 09 8b 43 18 <66> c7 40 04 03 00 8b 53 34 8b 43 14 b9 40 00 00 00 e8
 08 9a 84
EIP: [<f8a4b3bf>] __nfulnl_send+0x24/0x51 [nfnetlink_log] SS:ESP 0068:c03f5f30
 <0>Kernel panic - not syncing: Fatal exception in interrupt
 <0>Rebooting in 5 seconds..

Panic no more!

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[NETFILTER]: nfnetlink_log: fix crash on bridged packet
Patrick McHardy [Sat, 24 Mar 2007 20:30:53 +0000 (21:30 +0100)]
[NETFILTER]: nfnetlink_log: fix crash on bridged packet

physoutdev is only set on purely bridged packet, when nfnetlink_log is used
in the OUTPUT/FORWARD/POSTROUTING hooks on packets forwarded from or to a
bridge it crashes when trying to dereference skb->nf_bridge->physoutdev.

Reported by Holger Eitzenberger <heitzenberger@astaro.com>

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[NETFILTER]: nf_conntrack: fix incorrect classification of IPv6 fragments as ESTABLISHED
Patrick McHardy [Sat, 24 Mar 2007 20:30:06 +0000 (21:30 +0100)]
[NETFILTER]: nf_conntrack: fix incorrect classification of IPv6 fragments as ESTABLISHED

The individual fragments of a packet reassembled by conntrack have the
conntrack reference from the reassembled packet attached, but nfctinfo
is not copied. This leaves it initialized to 0, which unfortunately is
the value of IP_CT_ESTABLISHED.

The result is that all IPv6 fragments are tracked as ESTABLISHED,
allowing them to bypass a usual ruleset which accepts ESTABLISHED
packets early.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoFix reference counting (memory leak) problem in __nfulnl_send() and callers related...
Michał Mirosław [Sat, 24 Mar 2007 20:27:27 +0000 (21:27 +0100)]
Fix reference counting (memory leak) problem in __nfulnl_send() and callers related to packet queueing.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoNETFILTER: xt_connbytes: fix division by zero
Patrick McHardy [Sat, 24 Mar 2007 20:26:20 +0000 (21:26 +0100)]
NETFILTER: xt_connbytes: fix division by zero

When the packet counter of a connection is zero a division by zero
occurs in div64_64(). Fix that by using zero as average value, which
is correct as long as the packet counter didn't overflow, at which
point we have lost anyway.

Based on patch from Jonas Berlin <xkr47@outerspace.dyndns.org>,
with suggestions from KOVACS Krisztian <hidden@balabit.hu>.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoNETFILTER: tcp conntrack: fix IP_CT_TCP_FLAG_CLOSE_INIT value
Patrick McHardy [Sat, 24 Mar 2007 20:22:57 +0000 (21:22 +0100)]
NETFILTER: tcp conntrack: fix IP_CT_TCP_FLAG_CLOSE_INIT value

IP_CT_TCP_FLAG_CLOSE_INIT is a flag and should have a value of 0x4 instead
of 0x3, which is IP_CT_TCP_FLAG_WINDOW_SCALE | IP_CT_TCP_FLAG_SACK_PERM.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoNETFILTER: nf_conntrack_ipv6: fix crash when handling fragments
Patrick McHardy [Sat, 24 Mar 2007 20:22:33 +0000 (21:22 +0100)]
NETFILTER: nf_conntrack_ipv6: fix crash when handling fragments

When IPv6 connection tracking splits up a defragmented packet into
its original fragments, the packets are taken from a list and are
passed to the network stack with skb->next still set. This causes
dev_hard_start_xmit to treat them as GSO fragments, resulting in
a use after free when connection tracking handles the next fragment.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoNETFILTER: Fix iptables ABI breakage on (at least) CRIS
Patrick McHardy [Sat, 24 Mar 2007 20:22:09 +0000 (21:22 +0100)]
NETFILTER: Fix iptables ABI breakage on (at least) CRIS

With the introduction of x_tables we accidentally broke compatibility
by defining IPT_TABLE_MAXNAMELEN to XT_FUNCTION_MAXNAMELEN instead of
XT_TABLE_MAXNAMELEN, which is two bytes larger.

On most architectures it doesn't really matter since we don't have
any tables with names that long in the kernel and the structure
layout didn't change because of alignment requirements of following
members. On CRIS however (and other architectures that don't align
data) this changed the structure layout and thus broke compatibility
with old iptables binaries.

Changing it back will break compatibility with binaries compiled
against recent kernels again, but since the breakage has only been
there for three releases this seems like the better choice.

Spotted by Jonas Berlin <xkr47@outerspace.dyndns.org>.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoNETFILTER: arp_tables: fix userspace compilation
Bart De Schuymer [Sat, 24 Mar 2007 20:19:35 +0000 (21:19 +0100)]
NETFILTER: arp_tables: fix userspace compilation

The included patch translates arpt_counters to xt_counters, making
userspace arptables compile against recent kernels.

Signed-off-by: Bart De Schuymer <bdschuym@pandora.be>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoNETFILTER: ctnetlink: check for status attribute existence on conntrack creation
Pablo Neira Ayuso [Sat, 24 Mar 2007 20:18:36 +0000 (21:18 +0100)]
NETFILTER: ctnetlink: check for status attribute existence on conntrack creation

Check that status flags are available in the netlink message received
to create a new conntrack.

Fixes a crash in ctnetlink_create_conntrack when the CTA_STATUS attribute
is not present.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoNETFILTER: Kconfig: fix xt_physdev dependencies
Patrick McHardy [Sat, 24 Mar 2007 20:18:01 +0000 (21:18 +0100)]
NETFILTER: Kconfig: fix xt_physdev dependencies

xt_physdev depends on bridge netfilter, which is a boolean, but can still
be built modular because of special handling in the bridge makefile. Add
a dependency on BRIDGE to prevent XT_MATCH_PHYSDEV=y, BRIDGE=m.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoload_module: no BUG if module_subsys uninitialized
Ed Swierk [Tue, 20 Mar 2007 23:28:30 +0000 (00:28 +0100)]
load_module: no BUG if module_subsys uninitialized

Invoking load_module() before param_sysfs_init() is called crashes in
mod_sysfs_setup(), since the kset in module_subsys is not initialized yet.

In my case, net-pf-1 is getting modprobed as a result of hotplug trying to
create a UNIX socket.  Calls to hotplug begin after the topology_init
initcall.

Another patch for the same symptom (module_subsys-initialize-earlier.patch)
moves param_sysfs_init() to the subsys initcalls, but this is still not
early enough in the boot process in some cases.  In particular,
topology_init() causes /sbin/hotplug to run, which requests net-pf-1 (the
UNIX socket protocol) which can be compiled as a module.  Moving
param_sysfs_init() to the postcore initcalls fixes this particular race,
but there might well be other cases where a usermodehelper causes a module
to load earlier still.

The patch makes load_module() return an error rather than crashing the
kernel if invoked before module_subsys is initialized.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years agoi386 bootioremap / kexec fix
Keith Mannthey [Tue, 20 Mar 2007 23:21:48 +0000 (00:21 +0100)]
i386 bootioremap / kexec fix

With CONFIG_PHYSICAL_START set to a non default values the i386
boot_ioremap code calculated its pte index wrong and users of boot_ioremap
have their areas incorrectly mapped (for me SRAT table not mapped during
early boot).  This patch removes the addr < BOOT_PTE_PTRS constraint.

Signed-off-by: Keith Mannthey <kmannth@us.ibm.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[SPARC64]: Add missing HPAGE_MASK masks on address parameters.
David S. Miller [Tue, 20 Mar 2007 22:26:06 +0000 (23:26 +0100)]
[SPARC64]: Add missing HPAGE_MASK masks on address parameters.

These pte loops all assume the passed in address is HPAGE
aligned, make sure that is actually true.

[ This also includes other hugepage bug fixes for sparc64
  that occurred between 2.6.16 to 2.6.20 ]

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[NET]: Copy mac_len in skb_clone() as well
Alexey Dobriyan [Tue, 20 Mar 2007 22:24:20 +0000 (23:24 +0100)]
[NET]: Copy mac_len in skb_clone() as well

ANK says: "It is rarely used, that's wy it was not noticed.
But in the places, where it is used, it should be disaster."

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 years ago[IPV6]: ipv6_fl_socklist is inadvertently shared.
Masayuki Nakagawa [Tue, 20 Mar 2007 22:23:13 +0000 (23:23 +0100)]
[IPV6]: ipv6_fl_socklist is inadvertently shared.

The ipv6_fl_socklist from listening socket is inadvertently shared
with new socket created for connection.  This leads to a variety of
interesting, but fatal, bugs. For example, removing one of the
sockets may lead to the other socket's encountering a page fault
when the now freed list is referenced.

The fix is to not share the flow label list with the new socket.

Signed-off-by: Masayuki Nakagawa <nakagawa.msy@ncos.nec.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>