Alexander Viro [Tue, 13 Jul 2004 04:00:39 +0000 (21:00 -0700)]
[PATCH] sparse: isdn compile fix for platforms with HZ > 1000
Division by zero is an ugly thing... We are safe wrt overflows,
since the maximal value we ever pass is 10000 - not enough to overflow
unless you've got a platform with HZ > 200000.
Alexander Viro [Tue, 13 Jul 2004 04:00:16 +0000 (21:00 -0700)]
[PATCH] sparse: VIDIOCSWIN compat_ioctl fixes
In handling of VIDIOCSWIN for 32bit on 64bit platforms:
* switched to compat_alloc_user_space()
* fixed memory corruption in copying arguments from userland
* fixed arithmetic overflows
* added missing checks for get_user() results
and corresponding returns with -EFAULT.
Fixes calculation of how many bytes in the RX/TX FIFOs.
Previous code failed to check wether the full flags
where set before returning the byte counter. This
should ensure that the serial driver behaves correctly
when the FIFO fills, and not just ignore the input
data
Jack Steiner [Mon, 12 Jul 2004 07:27:49 +0000 (00:27 -0700)]
[PATCH] ia64: Reduce TLB flushing during process migration
This patch adds an architecture-specific callout after explicit
processor migrations. The callout allows architectures (or platforms)
to update TLB specific information (ex., cpu_vm_mask).
Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: David Mosberger <davidm@hpl.hp.com>
copy_from_user() moved from dvb_ringbuffer_{write,pkt_write}() to callers;
these functions are always getting kernel pointer now. "usermem" argument
killed, code annotated.
x86: fix stackframe ownership confusion in sys_sigaltstack()
gcc doesn't understand that "asmlinkage" routines have the
argument stack owned by the assembly-language caller, and the
recent sparse cleanup made gcc think it owns enough stack
frame space to make a tailcall by overwriting "struct pt_regs"
that is set up by the low-level system call code.
Hide that problem again.
The real fix would be to tell gcc that the caller owns the
stack frame that it set up, but we don't have any such
interfaces, so for now the best we can do is to hide it.
Martin Josefsson [Sun, 11 Jul 2004 10:49:02 +0000 (03:49 -0700)]
[NETFILTER]: Add timestamping to ipt_ULOG
After Andi's timestamp optimizations we don't have any timestamps on the
packets unless someone requested them. Here's a patch for 2.6 to
explicitly timestamp the packets before we log them.
Harald approved it some time ago, he's pretty busy so I'm sending it
instead.
Signed-off-by: Martin Josefsson <gandalf@netfilter.org> Signed-off-by: David S. Miller <davem@redhat.com>
Adrian Bunk [Sun, 11 Jul 2004 02:39:27 +0000 (19:39 -0700)]
[PATCH] kill IKCONFIG_VERSION
The patch below (already ACK'ed by Randy Dunlap) kills the unused
IKCONFIG_VERSION from kernel/configs.c .
This patch is based on a previous patch by Anton Blanchard and an idea of
Bartlomiej Zolnierkiewicz. (I hope I haven't forgotten anyone who contributed
to this patch. ;-) )
Signed-off-by: Adrian Bunk <bunk@fs.tum.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Adrian Bunk [Sun, 11 Jul 2004 02:39:05 +0000 (19:39 -0700)]
[PATCH] remove outdated ext2 help text parts
The patch below solves Bugzilla #3014 by removing much outdated information
from the ext2 help text.
The help text is now very short, but few correct information is better than
outdated information - and if you think it's too short, feel free to send a
patch that adds more current information.
Signed-off-by: Adrian Bunk <bunk@fs.tum.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
From: Ursula Braun-Krahl <braunu@de.ibm.com>
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
iucv driver changes:
- Fix iucv declare/retrieve buffer which the cpu hotplug patch has broken.
- Make smp_call_function_on call func(info) in non-smp kernels.
- Use a spinlock to get smp_get_cpu/smp_put_cpu race free.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
From: Ulrich Weigand <uweigand@de.ibm.com>
s390 core changes:
- Add signo between signal frame and the signal return instruction on the
user stack for backtrace over signal handlers.
- Add hfp floating point exceptions.
- Use a single function for region, segment and page translation exceptions.
- Discard SIGTRAP for single stepped instructions if the trapping instruction
is repeated (normal memory faults) or if another signal is delivered anyway.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andrea Arcangeli [Sun, 11 Jul 2004 02:38:19 +0000 (19:38 -0700)]
[PATCH] mpage_writepages() i_size reading fix
I believe reading the i_size from memory multiple times can generate fs
corruption. The "offset" and the "end_index" were not coherent. this is
writepages and it runs w/o the i_sem, so the i_size can change from under
us anytime. If a parallel write happens while writepages run, the i_size
could advance from 4095 to 4100. With the current 2.6 code that could
translate in end_index = 0 and offset = 4. That's broken because end_index
and offset could be not coherent. Either end_index=1 and offset =4, or
end_index = 0 and offset = 4095. When they lose coherency the memset can
zeroout actual data. The below patch fixes that (it's at least a
theoretical bug).
I don't really expect this tiny race to fix the bug in practice after the
more serious bugs we covered yesterday didn't fix it (more likely the
compiler will get involved into the equation soon ;).
This is also an optimization for 32bit archs that needs special locking to
read 64bit i_size coherenty.
This patch also arranges for mpage_writepages() to always zero out the file's
final page between i_size and the end of the file's final block. This is a
best-effort correctness thing to deal with errant applications which write
into the mmapped page beyond the underlying file's EOF.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andrea Arcangeli [Sun, 11 Jul 2004 02:37:57 +0000 (19:37 -0700)]
[PATCH] writepage fs corruption fix
Fix a data loss bug in mpage_writepages(), triggerable under extreme memory
pressure on ext2, JFS, hfs and hfsplus:
The bug is the marking of the bh clean despite we could still run into the
"confused" path. After that the confused path really becomes confused and it
writes nothing and fs corruption triggers silenty (the reugular writepage only
writes bh that are marked dirty, it never attempts to submit_bh anything
marked clean). The mpage-writepage code must never mark the bh clean as far
as it wants to still fallback in the regular writepage which depends on the bh
to be dirty (i.e. the "goto confused" path). This could only triggers with
memory pressure (it also needs buffer_heads_over_limit == 0, and that is
frequent under mm pressure).
Thanks a lot to Chris for his fine debugging that localized the problem in the
writepage code.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
CC [M] sound/oss/ad1889.o
sound/oss/ad1889.c: In function `ad1889_ac97_init':
sound/oss/ad1889.c:854: warning: comparison is always false
due to limited range of data type
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Nick has tracked scheduling-while-atomic errors to shmem's fragile kmap
avoidance: the root error appears to lie deeper, but rework that fragility.
Plus I've been indicted for war crimes at the end of shmem_swp_entry: my
apologia scorned, so now hide the evidence.
Paul Mundt [Sun, 11 Jul 2004 02:37:09 +0000 (19:37 -0700)]
[PATCH] sh64: Add asm-sh64/setup.h
With the recent changes to init/main.c, we need an asm-sh64/setup.h. This
pulls out the definitions from arch/sh64/kernel/setup.c and moves them to
setup.h instead.
Signed-off-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Paul Mundt [Sun, 11 Jul 2004 02:36:57 +0000 (19:36 -0700)]
[PATCH] sh64: Fix init_task.c build.
resource.h was falling a bit behind, so we use the asm-sh version instead.
This exposed another compile issue with init_task.c, which in turn needed
linux/mqueue.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andrew Morton [Sun, 11 Jul 2004 02:35:50 +0000 (19:35 -0700)]
[PATCH] crc16 kconfig touchups
drivers/net/hamradio/Kconfig:116:warning: 'select' used by config symbol 'BAYCOM_SER_FDX' refer to undefined symbol 'CRC16'
drivers/net/hamradio/Kconfig:136:warning: 'select' used by config symbol 'BAYCOM_SER_HDX' refer to undefined symbol 'CRC16'
drivers/net/hamradio/Kconfig:154:warning: 'select' used by config symbol 'BAYCOM_PAR' refer to undefined symbol 'CRC16'
drivers/net/hamradio/Kconfig:169:warning: 'select' used by config symbol 'BAYCOM_EPP' refer to undefined symbol 'CRC16'
net/irda/Kconfig:8:warning: 'select' used by config symbol 'IRDA' refer to undefined symbol 'CRC16'
drivers/net/Kconfig:1749:warning: 'select' used by config symbol 'VIA_VELOCITY' refer to undefined symbol 'CRC16'
drivers/net/Kconfig:2465:warning: 'select' used by config symbol 'PPP_ASYNC' refer to undefined symbol 'CRC16'
drivers/isdn/hisax/Kconfig:403:warning: 'select' used by config symbol 'HISAX_ST5481' refer to undefined symbol 'CRC16'
drivers/isdn/hisax/Kconfig:7:warning: 'select' used by config symbol 'ISDN_DRV_HISAX' refer to undefined symbol 'CRC16'
drivers/isdn/tpam/Kconfig:7:warning: 'select' used by config symbol 'ISDN_DRV_TPAM' refer to undefined symbol 'CRC16'
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
As pointed by Thomas Sailer, crc16.c module contains CRC16-CCITT (x^16 + x^12
+ x^5 + 1) implementation, not IBM CRC16 (x^16 + x^15 + x^2 + 1) one. Looks
like we need to rename it accordingly and this patchset does exactly this.
Andrew Morton [Sun, 11 Jul 2004 02:34:41 +0000 (19:34 -0700)]
[PATCH] slab: fix get_user inside spinlock
This little debugging __get_user is in fact happening inside a spinlock. It
was never very useful, and has caused problems for some architectures in the
past. Let's just remove it.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Mika Kukkonen [Sun, 11 Jul 2004 02:34:08 +0000 (19:34 -0700)]
[PATCH] Correct return type of hashfn() in fs/dquot.c
CC fs/dquot.o
fs/dquot.c:208: warning: type qualifiers ignored on function return type
Once again with extra gcc warnings enabled. Every user of the function is
expecting unsigned value, not int in first place, and I think the const is
just misplaced.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Mika Kukkonen [Sun, 11 Jul 2004 02:33:57 +0000 (19:33 -0700)]
[PATCH] Remove always false check in mm/slab.c
CC mm/slab.o
mm/slab.c: In function `kmem_cache_create':
mm/slab.c:1129: warning: comparison of unsigned expression < 0 is always false
This comes from the fact that 'align' is size_t and so unsigned. Just to be
sure, I did
$ grep __kernel_size_t include/*/posix_types.h
and yes, every arch defines that to be unsigned.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andy Whitcroft [Sun, 11 Jul 2004 02:33:34 +0000 (19:33 -0700)]
[PATCH] convert uses of ZONE_HIGHMEM to is_highmem
As the comments in mmzone.h indicate is_highmem() is designed to reduce the
proliferation of the constant ZONE_HIGHMEM. This patch updates references
to ZONE_HIGHMEM to use is_highmem(). None appear to be on critical paths.
Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Rusty Russell [Sun, 11 Jul 2004 02:32:49 +0000 (19:32 -0700)]
[PATCH] trivial: RCS___IGNORE quilt backup files
From: David Gibson <david@gibson.dropbear.id.au>
This patch excludes the .pc directory from the same things that
SCCS/BitKeeper/.svn/CVS files are excluded from. The .pc directory is used
for backup/reference files by quilt, a patch mangling system conceptually
derived from akpm's patch scripts. Excluding the .pc directory is handy,
because otherwise old versions of files found in there tend to end up at the
front of the TAGS index.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Rusty Russell [Sun, 11 Jul 2004 02:32:15 +0000 (19:32 -0700)]
[PATCH] trivial: scripts_kernel-doc: ignoring embedded structs shouldn't be
From: <adobriyan@mail.ru>
Imagine you have a code similar to
struct foo {
union {
struct tcphdr *th;
} h;
union {
struct iphdr *iph;
} nh;
};
kernel-doc in it's current state will happily eat everything from first '{' to
last '}' and nobody will see parameter 'h' in documentation (look at
include/linux/skbuff.h:struct sk_buff for real world example).
So, fix the greedy regexp.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Mika Kukkonen [Sun, 11 Jul 2004 02:32:04 +0000 (19:32 -0700)]
[PATCH] int return to unsigned in smb_proc_readdir_long() in fs/smbfs/proc.c
CC [M] fs/smbfs/proc.o
fs/smbfs/proc.c: In function `smb_proc_readdir_long':
fs/smbfs/proc.c:2313: warning: comparison of unsigned expression < 0 is always false
fs/smbfs/proc.c:2467: warning: comparison of unsigned expression < 0 is always false
The first one is pretty dangerous looking, as smb_proc_readdir_long() can
return several negative error values and all those are converted to
unsigned and then erronously pass the test on line 2313. Chris Wright gave
it a quick look and we did not see immediately if this can be remotely
exploited, but it looks pretty scary.
The second warning on line 2467 is just extra so I just removed it.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>