filemap_populate and shmem_populate must install even a linear file_pte,
in case there was a nonlinear page or file_pte already installed there:
could only happen if already VM_NONLINEAR, but no need to check that.
Alexander Viro [Sun, 25 Jul 2004 04:12:16 +0000 (21:12 -0700)]
[PATCH] sparse: simplify and tighten sparse typechecking
This takes advantage of the simplified typeof semantics of sparse
address spaces, (should be enough for alpha, i386, ppc, ppc64, sparc,
sparc64, x86_64 - most of them didn't actually need anything to be done)
and couple of missing annotations that got caught by that.
Anton Blanchard [Sat, 24 Jul 2004 15:31:11 +0000 (08:31 -0700)]
[NET]: Use NET_IP_ALIGN in acenic.
Use NET_IP_ALIGN in acenic driver. Also remove the 16 byte padding,
caches can be anywhere from 16 to 256 bytes and the skb should be
cacheline aligned already.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: David S. Miller <davem@redhat.com>
Herbert Xu [Sat, 24 Jul 2004 15:26:27 +0000 (08:26 -0700)]
[AH6]: Replace skb by iph in clear_mutable_options.
This patch replaces the skb argument in ipv6_clear_mutable_options() by
an ipv6hdr. Doing so allows us to point skb->nh elsewhere when calling
this function.
I've also thrown in some obvious clean-ups for that function.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@redhat.com>
Herbert Xu [Sat, 24 Jul 2004 15:24:48 +0000 (08:24 -0700)]
[AH4]: Save daddr iff options are present.
This is a little optimisation for AH4. When I moved the tunnel code out,
I put the daddr copying code on the main path which is unnecessary since
daddr is only mutable if IP options are present.
This patch moves the saving and restoring of daddr under the check for
the existence of IP options.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@redhat.com>
Anton Blanchard [Sat, 24 Jul 2004 02:39:20 +0000 (19:39 -0700)]
[PATCH] ppc64: exception path optimisations
- We were statically predicting syscalls would be 32bit which meant every
64bit syscall was guaranteed to be mispredicted. Just let the hardware
predict this one.
- We shouldnt use blrl for indirect function calls, it is unlikely to be
predicted correctly and corrupts the link prediction stack. We should
use bctrl instead.
- Statically predict a branch in the system call path, favouring calls from
userspace.
- Remove static prediction in pagefault path, hardware prediction should do
a better job here.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[SCTP] Mark chunks as ineligible for fast retransmit after they are
retransmitted. Also mark any chunks that could not be fit in the
PMTU sized packet as ineligible for fast retransmit.
Herbert Xu [Fri, 23 Jul 2004 06:26:52 +0000 (23:26 -0700)]
[AH6]: Disallow mutable bits after AH header.
As we discussed before, mutable headers should not be allowed after
the AH header. In fact, this appears to be the intention of RFC 2402.
It is further clarified in section 3.1.1 of
David Mosberger [Fri, 23 Jul 2004 03:26:36 +0000 (20:26 -0700)]
[PATCH] NX: allow architectures to select legacy mode dynamically
On some platforms, you'll want to support READ_IMPLIES_EXEC differently
depending on personality (e.g, native binary vs. x86 binary).
This supports that (and makes the code more readable while at it) by
replacing the old architecture-specific fixed LEGACY_BINARIES macro
define with a architecture-specific "elf_read_implies_exec_binary()"
helper function.
For now, x86 is the only user, and sets the "read implies exec" bit for
legacy apps. ia64 and x86-64 are likely to want to do their own thing.
Make "install_page()" able to handle truncated pages.
This makes it much easier on the callers, no need to
worry about races with vmtruncate() and friends, since
"install_page()" will just cleanly handle that case
and tell the caller about it.
Roman Fietze [Thu, 22 Jul 2004 10:14:12 +0000 (03:14 -0700)]
[PATCH] clean up n_tty alloc_buf()
Don't bother zeroing the allocated memory inside alloc_buf() in the
n_tty line discipline. alloc_buf() is static inline and is only
referenced by n_tty_open() which always clears the memory (once more).
The recent changes to (6 Jul 04) pkt_cls.h are evil, you can't build a version
of 'tc' to work unless you know the kernel config!
It has several API problems:
- API data structures change on kernel config options
- new fields should be added at the end of a structure to allow
binary compatibility.
This patch tries to clean this up.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@redhat.com>
Herbert Xu [Thu, 22 Jul 2004 05:16:19 +0000 (22:16 -0700)]
[INET]: Create enum of ECN bits
This patch is a preparation for an update of the ECN encap/decap
code with respect to RFC3168.
It creates an enum of the four code-points defined by RFC3168
and uses them throughout the inet_ecn.h file.
The only non-trivial bit is in IP_ECN_set_ce/IP6_ECN_set_ce where
the patch uses INET_ECN_CE instead of 1. This is OK as those
functions assume that the ECT bit is already set.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@redhat.com>
Herbert Xu [Wed, 21 Jul 2004 07:51:31 +0000 (00:51 -0700)]
[CRYPTO]: Fix stack overrun in crypt().
The stack allocation in crypt() is bogus as whether tmp_src/tmp_dst
is used is determined by factors unrelated to nbytes and
src->length/dst->length.
Since the condition for whether tmp_src/tmp_dst are used is very
complex, let's allocate them always instead of guessing.
This fixes a number of weird crashes including those AES crashes
that people have been seeing with the 2.4 backport + ipt_conntrack.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: James Morris <jmorris@redhat.com> Signed-off-by: David S. Miller <davem@redhat.com>
Simple enhancement to netem packet scheduler that makes it classful so
that the underlying pfifo default discipline can be substituted with something
else (tbf, red, ...)
Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@redhat.com>
This cleans up legacy x86 binary support by introducing a new
personality bit: READ_IMPLIES_EXEC, and implements Linus' suggestion to
add the PROT_EXEC bit on the two affected syscall entry places,
sys_mprotect() and sys_mmap(). If this bit is set then PROT_READ will
also add the PROT_EXEC bit - as expected by legacy x86 binaries. The
ELF loader will automatically set this bit when it encounters a legacy
binary.
This approach avoids the problems the previous ->def_flags solution
caused. In particular this patch fixes the PROT_NONE problem in a
cleaner way (http://lkml.org/lkml/2004/7/12/227), and it should fix the
ia64 PROT_EXEC problem reported by David Mosberger. Also,
mprotect(PROT_READ) done by legacy binaries will do the right thing as
well.
the details:
- the personality bit is added to the personality mask upon exec(),
within the ELF loader, but is not cleared (see the exceptions below).
This means that if an environment that already has the bit exec()s a
new-style binary it will still get the old behavior.
- one exception are setuid/setgid binaries: these will reset the
bit - thus local attackers cannot manually set the bit and circumvent
NX protection. Legacy setuid binaries will still get the bit through
the ELF loader. This gives us maximum flexibility in shaping
compatibility environments.
- selinux also clears the bit when switching SIDs via exec().
- x86 is the only arch making use of READ_IMPLIES_EXEC currently. Other
arches will have the pre-NX-patch protection setup they always had.
I have booted an old distro [RH 7.2] and two new PT_GNU_STACK distros
[SuSE 9.2 and FC2] on an NX-capable CPU - they work just fine and all
the mapping details are right. I've checked the PROT_NONE test-utility
as well and it works as expected. I have checked various setuid
scenarios as well involving legacy and new-style binaries.
an improved setarch utility can be used to set the personality bit
manually:
David Eger [Sun, 18 Jul 2004 02:06:48 +0000 (19:06 -0700)]
[PATCH] pmac_zilog: serial minors taken failure path fix
I've tracked down the core issue giving me the oops wrt pmac_zilog.
When you have two serial drivers, (e.g. 8250 and PMAC_ZILOG) they both say
"I want to reserve X ports starting with major TTY_MAJOR and minor 64".
By the time pmac_zilog gets there, the ports it requests are already
reserved. Unfortunately, init_pmz() doesn't check for pmz_register()
failure, and so it merrily goes on to register the half-initialized
pmac_zilog driver with the power management subsystem.
This path provides a proper failure path.
Also:
Restore ppc configs now that I know people use AT Keyboards on CHRP and PReP
machines, and the zilog driver is no longer Oops'ing.
Signed-off-by: David Eger <eger@havoc.gtf.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] Fix i386 bootup with HIGHMEM+SLAB_DEBUG+NUMA and no real
For some reason I booted a NUMA and SLAB_DEBUG i386 kernel on a non
NUMA 512MB machine. This caused an oops at bootup in change_page_attr.
The reason was that highmem_start_start page ended up zero and
that triggered the highmem check in change_page_attr when the
slab debug code would unmap a kernel mapping.
Fix is straightforward: if there is no highmem set highmem_start_page
to max_low_pfn+1
[PATCH] Fix memory corruption at x86-64 SMP bootup
This fixes a long standing corruption bug in the x86-64 code. The SMP
trampoline would corrupt page 2, which was sometimes used for other
data. This corrupted the ioport/iomem list in some cases and causes
oopses while read /proc/iomem.
Fix is to check the correct location and don't zero it afterwards
because it gets reinitialized for the next CPU anyways.
This patch fixes a hard-to-trigger condition, where the inode is on the
inode_in_use list while it's state is dirty. In this state dirty pages are
not written back in sync() or from kupdate, only from direct page reclaim.
And this causes a livelock in balance_dirty_pages after a while.
The actual sequence of events required to get into this state is: