GitHub/moto-9609/android_kernel_motorola_exynos9610.git
16 years agoselinux: add support for installing a dummy policy (v2)
Serge E. Hallyn [Tue, 26 Aug 2008 19:47:57 +0000 (14:47 -0500)]
selinux: add support for installing a dummy policy (v2)

In August 2006 I posted a patch generating a minimal SELinux policy.  This
week, David P. Quigley posted an updated version of that as a patch against
the kernel.  It also had nice logic for auto-installing the policy.

Following is David's original patch intro (preserved especially
bc it has stats on the generated policies):

se interested in the changes there were only two significant
changes. The first is that the iteration through the list of classes
used NULL as a sentinel value. The problem with this is that the
class_to_string array actually has NULL entries in its table as place
holders for the user space object classes.

The second change was that it would seem at some point the initial sids
table was NULL terminated. This is no longer the case so that iteration
has to be done on array length instead of looking for NULL.

Some statistics on the policy that it generates:

The policy consists of 523 lines which contain no blank lines. Of those
523 lines 453 of them are class, permission, and initial sid
definitions. These lines are usually little to no concern to the policy
developer since they will not be adding object classes or permissions.
Of the remaining 70 lines there is one type, one role, and one user
statement. The remaining lines are broken into three portions. The first
group are TE allow rules which make up 29 of the remaining lines, the
second is assignment of labels to the initial sids which consist of 27
lines, and file system labeling statements which are the remaining 11.

In addition to the policy.conf generated there is a single file_contexts
file containing two lines which labels the entire system with base_t.

This policy generates a policy.23 binary that is 7920 bytes.

(then a few versions later...):

The new policy is 587 lines (stripped of blank lines) with 476 of those
lines being the boilerplate that I mentioned last time. The remaining
111 lines have the 3 lines for type, user, and role, 70 lines for the
allow rules (one for each object class including user space object
classes), 27 lines to assign types to the initial sids, and 11 lines for
file system labeling. The policy binary is 9194 bytes.

Changelog:

Aug 26: Added Documentation/SELinux.txt
Aug 26: Incorporated a set of comments by Stephen Smalley:
1. auto-setup SELINUXTYPE=dummy
2. don't auto-install if selinux is enabled with
non-dummy policy
3. don't re-compute policy version
4. /sbin/setfiles not /usr/sbin/setfiles
Aug 22: As per JMorris comments, made sure make distclean
cleans up the mdp directory.
Removed a check for file_contexts which is now
created in the same file as the check, making it
superfluous.

Signed-off-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: David Quigley <dpquigl@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agosecurity: add/fix security kernel-doc
Randy Dunlap [Mon, 18 Aug 2008 04:44:22 +0000 (21:44 -0700)]
security: add/fix security kernel-doc

Add security/inode.c functions to the kernel-api docbook.
Use '%' on constants in kernel-doc notation.
Fix several typos/spellos in security function descriptions.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agoselinux: Unify for- and while-loop style
Vesa-Matti Kari [Thu, 7 Aug 2008 00:18:20 +0000 (03:18 +0300)]
selinux: Unify for- and while-loop style

Replace "thing != NULL" comparisons with just "thing" to make
the code look more uniform (mixed styles were used even in the
same source file).

Signed-off-by: Vesa-Matti Kari <vmkari@cc.helsinki.fi>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agoselinux: conditional expression type validation was off-by-one
Vesa-Matti Kari [Wed, 6 Aug 2008 15:24:51 +0000 (18:24 +0300)]
selinux: conditional expression type validation was off-by-one

expr_isvalid() in conditional.c was off-by-one and allowed
invalid expression type COND_LAST. However, it is this header file
that needs to be fixed. That way the if-statement's disjunction's
second component reads more naturally, "if expr type is greater than
the last allowed value" ( rather than using ">=" in conditional.c):

  if (expr->expr_type <= 0 || expr->expr_type > COND_LAST)

Signed-off-by: Vesa-Matti Kari <vmkari@cc.helsinki.fi>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agosmack: limit privilege by label
Casey Schaufler [Wed, 30 Jul 2008 22:37:11 +0000 (15:37 -0700)]
smack: limit privilege by label

There have been a number of requests to make the Smack LSM
enforce MAC even in the face of privilege, either capability
based or superuser based. This is not universally desired,
however, so it seems desirable to make it optional. Further,
at least one legacy OS implemented a scheme whereby only
processes running with one particular label could be exempt
from MAC. This patch supports these three cases.

If /smack/onlycap is empty (unset or null-string) privilege
is enforced in the normal way.

If /smack/onlycap contains a label only processes running with
that label may be MAC exempt.

If the label in /smack/onlycap is the star label ("*") the
semantics of the star label combine with the privilege
restrictions to prevent any violations of MAC, even in the
presence of privilege.

Again, this will be independent of the privilege scheme.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: James Morris <jmorris@namei.org>
16 years agoSELinux: Fix a potentially uninitialised variable in SELinux hooks
David Howells [Sun, 27 Jul 2008 11:31:07 +0000 (21:31 +1000)]
SELinux: Fix a potentially uninitialised variable in SELinux hooks

Fix a potentially uninitialised variable in SELinux hooks that's given a
pointer to the network address by selinux_parse_skb() passing a pointer back
through its argument list.  By restructuring selinux_parse_skb(), the compiler
can see that the error case need not set it as the caller will return
immediately.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agoSELinux: trivial, remove unneeded local variable
Vesa-Matti J Kari [Sun, 20 Jul 2008 23:50:20 +0000 (02:50 +0300)]
SELinux: trivial, remove unneeded local variable

Hello,

Remove unneeded local variable:

    struct avtab_node *newnode

Signed-off-by: Vesa-Matti Kari <vmkari@cc.helsinki.fi>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agoSELinux: Trivial minor fixes that change C null character style
Vesa-Matti J Kari [Sun, 20 Jul 2008 20:57:01 +0000 (23:57 +0300)]
SELinux: Trivial minor fixes that change C null character style

Trivial minor fixes that change C null character style.

Signed-off-by: Vesa-Matti Kari <vmkari@cc.helsinki.fi>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agomake selinux_write_opts() static
Adrian Bunk [Tue, 22 Jul 2008 17:21:23 +0000 (20:21 +0300)]
make selinux_write_opts() static

This patch makes the needlessly global selinux_write_opts() static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Linus Torvalds [Fri, 1 Aug 2008 21:59:11 +0000 (14:59 -0700)]
Merge branch 'release' of git://git./linux/kernel/git/aegl/linux-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  [IA64] Move include/asm-ia64 to arch/ia64/include/asm

16 years agoembedded: fix vc_translate operator precedence
Tim Bird [Fri, 1 Aug 2008 21:05:50 +0000 (14:05 -0700)]
embedded: fix vc_translate operator precedence

This fixes a bug in operator precedence in the newly introduced vc_translate
macro.  Without this fix, the translation of some characters on the
kernel console is garbled.

This patch was copied to the e-mail list previously for testing.  Now,
all reports confirm that it works, so this is an official post for
application.

Signed-off-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
16 years agoRemove EXPORTS of follow_page & zap_page_range
Jack Steiner [Fri, 1 Aug 2008 20:08:15 +0000 (15:08 -0500)]
Remove EXPORTS of follow_page & zap_page_range

Delete 2 EXPORTs that were accidentally sent upstream.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agodual license ftrace.txt
Steven Rostedt [Thu, 31 Jul 2008 16:40:52 +0000 (12:40 -0400)]
dual license ftrace.txt

I asked legal about the licensing of ftrace.txt, and they told me that,
unless the Documentation directory is specifically set up to handle non
GPL licenses (which it does not appear to be), then it would be best to
put ftrace.txt under the GPL.

This patch adds a dual license to ftrace.txt such that it is under both
the FDL and the GPL.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoFRV: Wire up new system calls
David Howells [Thu, 31 Jul 2008 12:46:33 +0000 (13:46 +0100)]
FRV: Wire up new system calls

Wire up for FRV the system calls that were added in the last merge window.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMN10300: Wire up new system calls
David Howells [Thu, 31 Jul 2008 12:01:30 +0000 (13:01 +0100)]
MN10300: Wire up new system calls

Wire up system calls added in the last merge window for the MN10300 arch.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agotry harder to load tty ldisc driver
Eugeniy Meshcheryakov [Thu, 31 Jul 2008 09:03:19 +0000 (10:03 +0100)]
try harder to load tty ldisc driver

Currently function tty_ldisc_get() tries to load an ldisc driver module
only when tty_ldisc_try_get() returns -EAGAIN. This happens only if
module is being unloaded. If ldisc module is not loaded
tty_ldisc_try_get() returns -EINVAL and this case is not handled in
tty_ldisc_get(), so request_module() is not called.

Attached patch fixes this by calling request_module() if
tty_ldisc_try_get() returned any error code.

I discovered this when my UMTS modem stopped working with 2.6.27-rc1
because module ppp_async was not loaded.

Signed-off-by: Eugeniy Meshcheryakov <eugen@debian.org>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'kvm-updates-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 1 Aug 2008 19:48:16 +0000 (12:48 -0700)]
Merge branch 'kvm-updates-2.6.27' of git://git./linux/kernel/git/avi/kvm

* 'kvm-updates-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm:
  KVM: s390: Fix kvm on IBM System z10
  KVM: Advertise synchronized mmu support to userspace
  KVM: Synchronize guest physical memory map to host virtual memory map
  KVM: Allow browsing memslots with mmu_lock
  KVM: Allow reading aliases with mmu_lock

16 years agoMerge branch 'zero-len' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Fri, 1 Aug 2008 19:47:53 +0000 (12:47 -0700)]
Merge branch 'zero-len' of git://git./linux/kernel/git/jgarzik/misc-2.6

* 'zero-len' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/misc-2.6:
  drivers/media, include/media: delete zero-length files

16 years agomm/hugetlb: don't crash when HPAGE_SHIFT is 0
Benjamin Herrenschmidt [Thu, 31 Jul 2008 07:07:30 +0000 (00:07 -0700)]
mm/hugetlb: don't crash when HPAGE_SHIFT is 0

Some platform decide whether they support huge pages at boot time.  On
these, such as powerpc, HPAGE_SHIFT is a variable, not a constant, and is
set to 0 when there is no such support.

The patches to introduce multiple huge pages support broke that causing
the kernel to crash at boot time on machines such as POWER3 which lack
support for multiple page sizes.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMissing symbol prefix on vmlinux.lds.h
Yoshinori Sato [Thu, 31 Jul 2008 07:07:29 +0000 (00:07 -0700)]
Missing symbol prefix on vmlinux.lds.h

ARCH=h8300:

init/main.c:781: undefined reference to `___early_initcall_end'

Same problem have
__start___bug_table
__stop___bug_table
__tracedata_start
__tracedata_end
__per_cpu_start
__per_cpu_end

When defining a symbol in vmlinux.lds, use the VMLINUX_SYMBOL macro.
VMLINUX_SYMBOL adds a prefix charactor.

You can't just use straight symbol names in common header files as they
dont take into consideration weird arch-specific ABI conventions.  in the
case of Blackfin/h8300, the ABI dictates that any C-visible symbols have
an underscore prefixed to them.  Thus all symbols in vmlinux.lds.h need to
be wrapped in VMLINUX_SYMBOL() so that each arch can put hide this magic
in their own files.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: "Mike Frysinger" <vapier.adi@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoPNP: fix formatting of dbg_pnp_show_resources() output
Bjorn Helgaas [Thu, 31 Jul 2008 07:07:27 +0000 (00:07 -0700)]
PNP: fix formatting of dbg_pnp_show_resources() output

Each resource should be printed on its own line, so start snprintf'ing
at the beginning of the buffer every time through the loop.

Also, use scnprintf() rather than snprintf() when building up the
buffer to print.  scnprintf() returns the number of characters actually
written into the buffer (not including the trailing NULL).

snprintf() returns the number of characters that *would be* written,
assuming everything would fit in the buffer.  That's nice if we want to
resize the buffer to make sure everything fits, but in this case, I
just want to keep from overflowing the buffer, and it's OK if the
output is truncated.

Using snprintf() meant that my "len" could grow to be more than the
the buffer size, which makes "sizeof(buf) - len" negative, which causes
this alarming WARN_ON:
    http://marc.info/?l=linux-kernel&m=121736480005656&w=2

More useful snprintf/scnprintf discussion:
    http://lwn.net/Articles/69419/

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Reported-by: Pete Clements <clem@clem.clem-digital.net>
Cc: Rene Herman <rene.herman@keyaccess.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoRemove newline from the description of module parameters
Niels de Vos [Thu, 31 Jul 2008 07:07:23 +0000 (00:07 -0700)]
Remove newline from the description of module parameters

Some module parameters with only one line have the '\n' at the end of the
description.  This is not needed nor wanted as after the description the
type (i.e.  int) is followed by a newline.

Some modules contain a multi-line description, these are not affected
by this patch.

Signed-off-by: Niels de Vos <niels.devos@wincor-nixdorf.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: Ed L. Cashin <ecashin@coraid.com>
Cc: Dave Airlie <airlied@linux.ie>
Cc: Roland Dreier <rolandd@cisco.com>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
Linus Torvalds [Fri, 1 Aug 2008 19:41:29 +0000 (12:41 -0700)]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  pata_it821x: Driver updates and reworking
  libata.h: replace __FUNCTION__ with __func__
  ata_piix: subsys 106b:00a3 is apple ich8m too
  libata-core: make sure that ata_force_tbl is freed in case of an error
  libata: update atapi disable handling
  pata_via: add VX800 flag; add function for fixing h/w bugs
  pata_ali: misplaced pci_dev_put()

16 years agoMerge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-pull
Linus Torvalds [Fri, 1 Aug 2008 19:39:09 +0000 (12:39 -0700)]
Merge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-pull

* 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-pull: (64 commits)
  [XFS] Remove vn_revalidate calls in xfs.
  [XFS] Now that xfs_setattr is only used for attributes set from ->setattr
  [XFS] xfs_setattr currently doesn't just handle the attributes set through
  [XFS] fix use after free with external logs or real-time devices
  [XFS] A bug was found in xfs_bmap_add_extent_unwritten_real(). In a
  [XFS] fix compilation without CONFIG_PROC_FS
  [XFS] s/XFS_PURGE_INODE/IRELE/g s/VN_HOLD(XFS_ITOV())/IHOLD()/
  [XFS] fix mount option parsing in remount
  [XFS] Disable queue flag test in barrier check.
  [XFS] streamline init/exit path
  [XFS] Fix up problem when CONFIG_XFS_POSIX_ACL is not set and yet we still
  [XFS] Don't assert if trying to mount with blocksize > pagesize
  [XFS] Don't update mtime on rename source
  [XFS] Allow xfs_bmbt_split() to fallback to the lowspace allocator
  [XFS] Restore the lowspace extent allocator algorithm
  [XFS] use minleft when allocating in xfs_bmbt_split()
  [XFS] attrmulti cleanup
  [XFS] Check for invalid flags in xfs_attrlist_by_handle.
  [XFS] Fix CI lookup in leaf-form directories
  [XFS] Use the generic xattr methods.
  ...

16 years agoadd reverse dependency of CONFIG_SGI_XP upon CONFIG_SGI_GRU
Dean Nelson [Fri, 1 Aug 2008 14:55:26 +0000 (09:55 -0500)]
add reverse dependency of CONFIG_SGI_XP upon CONFIG_SGI_GRU

Add a reverse dependency of CONFIG_SGI_XP upon CONFIG_SGI_GRU to Kconfig.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoadd dependency of CONFIG_SGI_XP upon CONFIG_NET
Dean Nelson [Fri, 1 Aug 2008 19:19:08 +0000 (14:19 -0500)]
add dependency of CONFIG_SGI_XP upon CONFIG_NET

Add a dependency of CONFIG_SGI_XP upon CONFIG_NET to Kconfig.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agotracehook: fix exit_signal=0 case
Roland McGrath [Thu, 31 Jul 2008 09:04:09 +0000 (02:04 -0700)]
tracehook: fix exit_signal=0 case

My commit 2b2a1ff64afbadac842bbc58c5166962cf4f7664 introduced a regression
(sorry about that) for the odd case of exit_signal=0 (e.g. clone_flags=0).
This is not a normal use, but it's used by a case in the glibc test suite.

Dying with exit_signal=0 sends no signal, but it's supposed to wake up a
parent's blocked wait*() calls (unlike the delayed_group_leader case).
This fixes tracehook_notify_death() and its caller to distinguish a
"signal 0" wakeup from the delayed_group_leader case (with no wakeup).

Signed-off-by: Roland McGrath <roland@redhat.com>
Tested-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'for-linus' of git://neil.brown.name/md
Linus Torvalds [Fri, 1 Aug 2008 18:56:07 +0000 (11:56 -0700)]
Merge branch 'for-linus' of git://neil.brown.name/md

* 'for-linus' of git://neil.brown.name/md:
  md: raid10: wake up frozen array
  md: do not count blocked devices as spares
  md: do not progress the resync process if the stripe was blocked
  md: delay notification of 'active_idle' to the recovery thread
  md: fix merge error
  md: move async_tx_issue_pending_all outside spin_lock_irq

16 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfashe...
Linus Torvalds [Fri, 1 Aug 2008 18:54:05 +0000 (11:54 -0700)]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/mfasheh/ocfs2

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2:
  [PATCH] ocfs2: Release mutex in error handling code
  [PATCH] ocfs2: Fix oops when racing files truncates with writes into an mmap region
  [PATCH 2/2] ocfs2: Fix race between mount and recovery
  [PATCH 1/2] ocfs2: Add counter in struct ocfs2_dinode to track journal replays
  [PATCH] configfs: Convenience macros for attribute definition.
  [PATCH] configfs: Pin configfs subsystems separately from new config_items.
  [PATCH] configfs: Fix open directory making rmdir() fail
  [PATCH] configfs: Lock new directory inodes before removing on cleanup after failure
  [PATCH] configfs: Prevent userspace from creating new entries under attaching directories
  [PATCH] configfs: Fix failing symlink() making rmdir() fail
  [PATCH] configfs: Fix symlink() to a removing item
  [PATCH] configfs: Include linux/err.h in linux/configfs.h

16 years agoMerge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 1 Aug 2008 18:52:39 +0000 (11:52 -0700)]
Merge branch 'core-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  locking: fix mutex @key parameter kernel-doc notation

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes
Linus Torvalds [Fri, 1 Aug 2008 18:50:21 +0000 (11:50 -0700)]
Merge git://git./linux/kernel/git/sam/kbuild-fixes

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes:
  kbuild: scripts/ver_linux: don't set PATH
  Kconfig/init: change help text to match default value
  kbuild: genksyms: Include extern information in dumps
  kbuild: genksyms parser: fix the __attribute__ rule
  kbuild: scripts/genksyms/lex.l: add %option noinput
  kconfig: scripts/kconfig/zconf.l: add %option noinput
  kbuild: fix O=... build of um

16 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Fri, 1 Aug 2008 18:46:00 +0000 (11:46 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  md: the bitmap code needs to use blk_plug_device_unlocked()
  block: add a blk_plug_device_unlocked() that grabs the queue lock

16 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel...
Linus Torvalds [Fri, 1 Aug 2008 18:45:09 +0000 (11:45 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jwessel/linux-2.6-kgdb

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
  kgdb: fix gdb serial thread queries
  kgdb: fix kgdb_validate_break_address to perform a mem write
  kgdb: remove the requirement for CONFIG_FRAME_POINTER

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Fri, 1 Aug 2008 18:44:24 +0000 (11:44 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: ASoC: Export dapm_reg_event() fully
  ALSA: ASoC: Update Poodle to current ASoC API
  ALSA: asoc: restrict sample rate and size in Freescale MPC8610 sound drivers
  ALSA: sound/soc/pxa/tosa.c: removed duplicated include

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Fri, 1 Aug 2008 18:35:16 +0000 (11:35 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (46 commits)
  tcp: MD5: Fix IPv6 signatures
  skbuff: add missing kernel-doc for do_not_encrypt
  net/ipv4/route.c: fix build error
  tcp: MD5: Fix MD5 signatures on certain ACK packets
  ipv6: Fix ip6_xmit to send fragments if ipfragok is true
  ipvs: Move userspace definitions to include/linux/ip_vs.h
  netdev: Fix lockdep warnings in multiqueue configurations.
  netfilter: xt_hashlimit: fix race between htable_destroy and htable_gc
  netfilter: ipt_recent: fix race between recent_mt_destroy and proc manipulations
  netfilter: nf_conntrack_tcp: decrease timeouts while data in unacknowledged
  irda: replace __FUNCTION__ with __func__
  nsc-ircc: default to dongle type 9 on IBM hardware
  bluetooth: add quirks for a few hci_usb devices
  hysdn: remove the packed attribute from PofTimStamp_tag
  isdn: use the common ascii hex helpers
  tg3: adapt tg3 to use reworked PCI PM code
  atm: fix direct casts of pointers to u32 in the InterPhase driver
  atm: fix const assignment/discard warnings in the ATM networking driver
  net: use the common ascii hex helpers
  random32: seeding improvement
  ...

16 years agoMerge branch 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6
Linus Torvalds [Fri, 1 Aug 2008 18:33:19 +0000 (11:33 -0700)]
Merge branch 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6

* 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6:
  hwmon: needs new maintainer
  hwmon: (lm85) Simplify device initialization function
  hwmon: (lm85) Misc cleanups
  hwmon: (lm85) Don't write back cached values
  hwmon: (lm85) Drop dead code
  hwmon: (lm85) Coding-style cleanups
  hwmon: (lm75) add new-style driver binding
  hwmon: (lm75) cleanup/reorg
  hwmon: (adt7473) clarify an awkward bit of code
  hwmon: (adt7473) Remove unused defines
  hwmon: (dme1737) fix voltage scaling
  hwmon: (dme1737) probe all addresses
  hwmon: (dme1737) demacrofy for readability

16 years agomd: the bitmap code needs to use blk_plug_device_unlocked()
Jens Axboe [Fri, 1 Aug 2008 18:32:31 +0000 (20:32 +0200)]
md: the bitmap code needs to use blk_plug_device_unlocked()

It doesn't hold the queue lock, so it's both racey on the queue flags
and thus spews a warning.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblock: add a blk_plug_device_unlocked() that grabs the queue lock
Jens Axboe [Fri, 1 Aug 2008 18:31:32 +0000 (20:31 +0200)]
block: add a blk_plug_device_unlocked() that grabs the queue lock

blk_plug_device() must be called with the queue lock held, so callers
often just grab and release the lock for that purpose. Add a helper
that does just that.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoMerge git://git.infradead.org/mtd-2.6
Linus Torvalds [Fri, 1 Aug 2008 18:29:54 +0000 (11:29 -0700)]
Merge git://git.infradead.org/mtd-2.6

* git://git.infradead.org/mtd-2.6:
  [MTD] [NAND] drivers/mtd/nand/nandsim.c: fix printk warnings
  [MTD] [NAND] Blackfin NFC Driver: Cleanup the error exit path of bf5xx_nand_probe function
  [MTD] [NAND] Blackfin NFC Driver: use standard dev_err() rather than printk()
  [MTD] [NAND] Blackfin NFC Driver: enable Blackfin nand HWECC support by default
  [MTD] [NAND] Blackfin NFC Driver: add proper devinit/devexit markings to probe/remove functions
  [MTD] [NAND] Blackfin NFC Driver: add support for the ECC layout the Blackfin bootrom uses
  [MTD] [NAND] Blackfin NFC Driver: fix bug - hw ecc calc by making sure we extract 11 bits from each register instead of 10
  [MTD] [NAND] Blackfin NFC Driver: fix bug - do not clobber the status from the first 256 bytes if operating on 512 pages
  [MTD] [NAND] diskonchip.c fix sparse endian warnings
  [MTD] [NAND] drivers/mtd/nand/nandsim.c needs div64.h
  [JFFS2] Fix allocation of summary buffer
  Fix rename of at91_nand -> atmel_nand
  [MTD] [NOR] drivers/mtd/chips/jedec_probe.c: fix Am29DL800BB device ID
  [MTD] MTD_DEBUG always does compile-time typechecks
  [MTD] DataFlash: bugfix, binary page sizes now handled
  [MTD] [NAND] fsl_elbc_nand.c: fix printk warning
  [MTD] [NAND] nandsim: support random page read command
  [MTD] [NAND] fix subpage read for small page NAND

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
Linus Torvalds [Fri, 1 Aug 2008 18:26:51 +0000 (11:26 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
  [PATCH] pass struct path * to do_add_mount()
  [PATCH] switch mtd and dm-table to lookup_bdev()
  [patch 3/4] vfs: remove unused nameidata argument of may_create()
  [PATCH] devpts: switch to IDA
  [PATCH 2/2] proc: switch inode number allocation to IDA
  [PATCH 1/2] proc: fix inode number bogorithmetic
  [PATCH] fix bdev leak in block_dev.c do_open()
  [PATCH] fix races and leaks in vfs_quota_on() users
  [PATCH] clean dup2() up a bit
  [PATCH] merge locate_fd() and get_unused_fd()
  [PATCH] ipv4_static_sysctl_init() should be under CONFIG_SYSCTL
  Re: BUG at security/selinux/avc.c:883 (was: Re: linux-next: Tree

16 years agoMerge branch 'audit.b54' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit...
Linus Torvalds [Fri, 1 Aug 2008 18:23:09 +0000 (11:23 -0700)]
Merge branch 'audit.b54' of git://git./linux/kernel/git/viro/audit-current

* 'audit.b54' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current:
  [PATCH] Fix the bug of using AUDIT_STATUS_RATE_LIMIT when set fail, no error output.
  [PATCH] Fix the kernel panic of audit_filter_task when key field is set
  Re: [PATCH] the loginuid field should be output in all AUDIT_CONFIG_CHANGE audit messages
  kernel/audit.c control character detection is off-by-one
  [PATCH] Audit: Collect signal info when SIGUSR2 is sent to auditd

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
Linus Torvalds [Fri, 1 Aug 2008 18:22:45 +0000 (11:22 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/drzeus/mmc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc:
  au1xmmc: raise segment size limit.
  mmc_block: use proper sg iterators
  mmc: properly iterate over sg list in debug check
  mmc_test: Revert "mmc_test: test oversized sg lists"
  sdhci: check correct return value
  sdhci: disable DMA for req, not completely
  sdhci: handle bug in JMB38x for sizes < 4 bytes

16 years agoMerge branch 'reg-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg...
Linus Torvalds [Fri, 1 Aug 2008 17:56:40 +0000 (10:56 -0700)]
Merge branch 'reg-for-linus' of git://git./linux/kernel/git/lrg/voltage-2.6

* 'reg-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6:
  regulator: TI bq24022 Li-Ion Charger driver
  regulator: maintainers - add maintainers for regulator framework.
  regulator: documentation - ABI
  regulator: documentation - machine
  regulator: documentation - regulator driver
  regulator: documentation - consumer interface
  regulator: documentation - overview
  regulator: core kbuild files
  regulator: regulator test harness
  regulator: add support for fixed regulators.
  regulator: regulator framework core
  regulator: fixed regulator interface
  regulator: machine driver interface
  regulator: regulator driver interface
  regulator: consumer device interface

16 years agoMerge branch 'hotfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Fri, 1 Aug 2008 17:55:57 +0000 (10:55 -0700)]
Merge branch 'hotfixes' of git://git./linux/kernel/git/jmorris/security-testing-2.6

* 'hotfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
  SELinux: /proc/mounts should show what it can

16 years agoMerge git://git.infradead.org/battery-2.6
Linus Torvalds [Fri, 1 Aug 2008 17:55:07 +0000 (10:55 -0700)]
Merge git://git.infradead.org/battery-2.6

* git://git.infradead.org/battery-2.6:
  power_supply: Sharp SL-6000 (tosa) batteries support
  power_supply: fix up CHARGE_COUNTER output to be more precise
  power_supply: add CHARGE_COUNTER property and olpc_battery support for it
  power_supply: bump EC version check that we refuse to run with in olpc_battery
  power_supply: cleanup of the OLPC battery driver
  power_supply: add eeprom dump file to olpc_battery's sysfs
  power_supply: Support serial number in olpc_battery

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
Linus Torvalds [Fri, 1 Aug 2008 17:53:43 +0000 (10:53 -0700)]
Merge git://git./linux/kernel/git/lethal/sh-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (28 commits)
  mm/hugetlb.c must #include <asm/io.h>
  video: Fix up hp6xx driver build regressions.
  sh: defconfig updates.
  sh: Kill off stray mach-rsk7203 reference.
  serial: sh-sci: Fix up SH7760/SH7780/SH7785 early printk regression.
  sh: Move out individual boards without mach groups.
  sh: Make sure AT_SYSINFO_EHDR is exposed to userspace in asm/auxvec.h.
  sh: Allow SH-3 and SH-5 to use common headers.
  sh: Provide common CPU headers, prune the SH-2 and SH-2A directories.
  sh/maple: clean maple bus code
  sh: More header path fixups for mach dir refactoring.
  sh: Move out the solution engine headers to arch/sh/include/mach-se/
  sh: I2C fix for AP325RXA and Migo-R
  sh: Shuffle the board directories in to mach groups.
  sh: dma-sh: Fix up dreamcast dma.h mach path.
  sh: Switch KBUILD_DEFCONFIG to shx3_defconfig.
  sh: Add ARCH_DEFCONFIG entries for sh and sh64.
  sh: Fix compile error of Solution Engine
  sh: Proper __put_user_asm() size mismatch fix.
  sh: Stub in a dummy ENTRY_OFFSET for uImage offset calculation.
  ...

16 years agoMerge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 1 Aug 2008 17:28:17 +0000 (10:28 -0700)]
Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  generic, x86: fix add iommu_num_pages helper function
  x86: remove stray <6> in BogoMIPS printk
  x86: move dma32_reserve_bootmem() after reserve_crashkernel()

16 years agoMerge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
Linus Torvalds [Fri, 1 Aug 2008 17:27:10 +0000 (10:27 -0700)]
Merge branch 'for-linus' of git://git390.osdl.marist.edu/linux-2.6

* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
  [S390] qeth: avoid use of include/asm-s390
  [S390] dont use kthread for smp_rescan_cpus().
  [S390] virtio console: fix section mismatch warning.
  [S390] cio: Include linux/string.h in schid.h.
  [S390] qdio: fix section mismatch bug.
  [S390] stp: fix section mismatch warning.
  [S390] Remove diag 0x260 call from memory detection.
  [S390] qdio: make sure qdr is aligned to page size
  [S390] Add support for memory hot-remove.
  [S390] Wire up new syscalls.
  [S390] cio: Memory allocation for idset changed.
  [S390] qeth: preallocated qeth header for hiper socket
  [S390] Optimize storage key operations for anon pages
  [S390] nohz/sclp: disable timer on synchronous waits.
  [S390] ipl: Reboot from alternate device does not work when booting from file
  [S390] dasd: Add support for enhanced VM UID
  [S390] Remove last P390 trace.

16 years ago[IA64] Move include/asm-ia64 to arch/ia64/include/asm
Tony Luck [Fri, 1 Aug 2008 17:13:32 +0000 (10:13 -0700)]
[IA64] Move include/asm-ia64 to arch/ia64/include/asm

After moving the the include files there were a few clean-ups:

1) Some files used #include <asm-ia64/xyz.h>, changed to <asm/xyz.h>

2) Some comments alerted maintainers to look at various header files to
make matching updates if certain code were to be changed. Updated these
comments to use the new include paths.

3) Some header files mentioned their own names in initial comments. Just
deleted these self references.

Signed-off-by: Tony Luck <tony.luck@intel.com>
16 years agoau1xmmc: raise segment size limit.
Manuel Lauss [Tue, 29 Jul 2008 08:10:49 +0000 (10:10 +0200)]
au1xmmc: raise segment size limit.

Raise the DMA block size limit from 2048 bytes to the maximum supported
by the DMA controllers on the chip (64KB on Au1100, 4MB on Au1200).

This gives a very small performance boost and apparently fixes an oops
when MMC-DMA and network traffic are active at the same time.

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
16 years agommc_block: use proper sg iterators
Pierre Ossman [Mon, 28 Jul 2008 23:23:24 +0000 (01:23 +0200)]
mmc_block: use proper sg iterators

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
16 years agommc: properly iterate over sg list in debug check
Pierre Ossman [Mon, 28 Jul 2008 23:09:37 +0000 (01:09 +0200)]
mmc: properly iterate over sg list in debug check

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
16 years agommc_test: Revert "mmc_test: test oversized sg lists"
Pierre Ossman [Mon, 28 Jul 2008 23:05:22 +0000 (01:05 +0200)]
mmc_test: Revert "mmc_test: test oversized sg lists"

This reverts commit 48b5352ea1891455eb8e824cf7d92f66931a090f. Oversized
sg lists are not allowed anymore, and the core even checks for them in
debug mode, so this test is entirely incorrect.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
16 years agosdhci: check correct return value
Pierre Ossman [Mon, 28 Jul 2008 22:53:20 +0000 (00:53 +0200)]
sdhci: check correct return value

Fix a copy-and-paste error.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
16 years agosdhci: disable DMA for req, not completely
Pierre Ossman [Mon, 28 Jul 2008 22:45:51 +0000 (00:45 +0200)]
sdhci: disable DMA for req, not completely

The wrong flag was manipulated when an invalid sg list was given, turning
off DMA on the next (and all subsequent) request instead of the current
one.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
16 years agosdhci: handle bug in JMB38x for sizes < 4 bytes
Pierre Ossman [Mon, 28 Jul 2008 22:11:16 +0000 (00:11 +0200)]
sdhci: handle bug in JMB38x for sizes < 4 bytes

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
16 years ago[PATCH] Fix the bug of using AUDIT_STATUS_RATE_LIMIT when set fail, no error output.
zhangxiliang [Thu, 31 Jul 2008 02:11:19 +0000 (10:11 +0800)]
[PATCH] Fix the bug of using AUDIT_STATUS_RATE_LIMIT when set fail, no error output.

When the "status_get->mask" is "AUDIT_STATUS_RATE_LIMIT || AUDIT_STATUS_BACKLOG_LIMIT".
If "audit_set_rate_limit" fails and "audit_set_backlog_limit" succeeds, the "err" value
will be greater than or equal to 0. It will miss the failure of rate set.

Signed-off-by: Zhang Xiliang <zhangxiliang@cn.fujitsu.com>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years ago[PATCH] Fix the kernel panic of audit_filter_task when key field is set
zhangxiliang [Fri, 1 Aug 2008 11:15:47 +0000 (19:15 +0800)]
[PATCH] Fix the kernel panic of audit_filter_task when key field is set

When calling audit_filter_task(), it calls audit_filter_rules() with audit_context is NULL.
If the key field is set, the result in audit_filter_rules() will be set to 1 and
ctx->filterkey will be set to key.
But the ctx is NULL in this condition, so kernel will panic.

Signed-off-by: Zhang Xiliang <zhangxiliang@cn.fujitsu.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years agoRe: [PATCH] the loginuid field should be output in all AUDIT_CONFIG_CHANGE audit...
zhangxiliang [Fri, 1 Aug 2008 01:47:01 +0000 (09:47 +0800)]
Re: [PATCH] the loginuid field should be output in all AUDIT_CONFIG_CHANGE audit messages

> shouldn't these be using the "audit_get_loginuid(current)"  and if we
> are going to output loginuid we also should be outputting sessionid

Thanks for your detailed explanation.
I have made a new patch for outputing "loginuid" and "sessionid" by audit_get_loginuid(current) and audit_get_sessionid(current).
If there are some deficiencies, please give me your indication.

Signed-off-by: Zhang Xiliang <zhangxiliang@cn.fujitsu.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years agokernel/audit.c control character detection is off-by-one
Vesa-Matti J Kari [Tue, 22 Jul 2008 21:06:13 +0000 (00:06 +0300)]
kernel/audit.c control character detection is off-by-one

Hello,

According to my understanding there is an off-by-one bug in the
function:

   audit_string_contains_control()

in:

  kernel/audit.c

Patch is included.

I do not know from how many places the function is called from, but for
example, SELinux Access Vector Cache tries to log untrusted filenames via
call path:

avc_audit()
     audit_log_untrustedstring()
         audit_log_n_untrustedstring()
             audit_string_contains_control()

If audit_string_contains_control() detects control characters, then the
string is hex-encoded. But the hex=0x7f dec=127, DEL-character, is not
detected.

I guess this could have at least some minor security implications, since a
user can create a filename with 0x7f in it, causing logged filename to
possibly look different when someone reads it on the terminal.

Signed-off-by: Vesa-Matti Kari <vmkari@cc.helsinki.fi>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years ago[PATCH] Audit: Collect signal info when SIGUSR2 is sent to auditd
Eric Paris [Mon, 7 Jul 2008 14:49:45 +0000 (10:49 -0400)]
[PATCH] Audit: Collect signal info when SIGUSR2 is sent to auditd

Makes the kernel audit subsystem collect information about the sending
process when that process sends SIGUSR2 to the userspace audit daemon.
SIGUSR2 is a new interesting signal to auditd telling auditd that it
should try to start logging to disk again and the error condition which
caused it to stop logging to disk (usually out of space) has been
rectified.

Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years ago[PATCH] pass struct path * to do_add_mount()
Al Viro [Fri, 1 Aug 2008 13:05:54 +0000 (09:05 -0400)]
[PATCH] pass struct path * to do_add_mount()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years ago[PATCH] switch mtd and dm-table to lookup_bdev()
Al Viro [Fri, 1 Aug 2008 09:00:11 +0000 (05:00 -0400)]
[PATCH] switch mtd and dm-table to lookup_bdev()

No need to open-code it...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years ago[patch 3/4] vfs: remove unused nameidata argument of may_create()
Miklos Szeredi [Wed, 30 Jul 2008 13:08:48 +0000 (15:08 +0200)]
[patch 3/4] vfs: remove unused nameidata argument of may_create()

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years ago[PATCH] devpts: switch to IDA
Alexey Dobriyan [Sat, 26 Jul 2008 07:42:16 +0000 (11:42 +0400)]
[PATCH] devpts: switch to IDA

Devpts code wants just numbers for tty indexes.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years ago[PATCH 2/2] proc: switch inode number allocation to IDA
Alexey Dobriyan [Sat, 26 Jul 2008 07:21:37 +0000 (11:21 +0400)]
[PATCH 2/2] proc: switch inode number allocation to IDA

proc doesn't use "associate pointer with id" feature of IDR, so switch
to IDA.

NOTE, NOTE, NOTE:
Do not apply if release_inode_number() still mantions MAX_ID_MASK!

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years ago[PATCH 1/2] proc: fix inode number bogorithmetic
Alexey Dobriyan [Sat, 26 Jul 2008 07:18:28 +0000 (11:18 +0400)]
[PATCH 1/2] proc: fix inode number bogorithmetic

Id which proc gets from IDR for inode number and id which proc removes
from IDR do not match. E.g. 0x11a transforms into 0x8000011a.

Which stayed unnoticed for a long time because, surprise, idr_remove()
masks out that high bit before doing anything.

All of this due to "| ~MAX_ID_MASK" in release_inode_number().

I still don't understand how it's supposed to work, because "| ~MASK"
is not an inversion for "& MAX" operation.

So, use just one nice, working addition. Make start offset unsigned int,
while I'm at it. It's longness is not used anywhere.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years ago[PATCH] fix bdev leak in block_dev.c do_open()
Al Viro [Fri, 1 Aug 2008 09:32:04 +0000 (05:32 -0400)]
[PATCH] fix bdev leak in block_dev.c do_open()

Callers expect it to drop reference to bdev on all failure exits.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years ago[PATCH] fix races and leaks in vfs_quota_on() users
Al Viro [Fri, 1 Aug 2008 08:29:18 +0000 (04:29 -0400)]
[PATCH] fix races and leaks in vfs_quota_on() users

* new helper: vfs_quota_on_path(); equivalent of vfs_quota_on() sans the
  pathname resolution.
* callers of vfs_quota_on() that do their own pathname resolution and
  checks based on it are switched to vfs_quota_on_path(); that way we
  avoid the races.
* reiserfs leaked dentry/vfsmount references on several failure exits.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years ago[PATCH] clean dup2() up a bit
Al Viro [Wed, 30 Jul 2008 10:18:03 +0000 (06:18 -0400)]
[PATCH] clean dup2() up a bit

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years ago[PATCH] merge locate_fd() and get_unused_fd()
Al Viro [Wed, 30 Jul 2008 08:13:04 +0000 (04:13 -0400)]
[PATCH] merge locate_fd() and get_unused_fd()

New primitive: alloc_fd(start, flags).  get_unused_fd() and
get_unused_fd_flags() become wrappers on top of it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years ago[PATCH] ipv4_static_sysctl_init() should be under CONFIG_SYSCTL
Al Viro [Wed, 30 Jul 2008 10:32:52 +0000 (06:32 -0400)]
[PATCH] ipv4_static_sysctl_init() should be under CONFIG_SYSCTL

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years agoRe: BUG at security/selinux/avc.c:883 (was: Re: linux-next: Tree
Stephen Smalley [Mon, 28 Jul 2008 17:32:38 +0000 (13:32 -0400)]
Re: BUG at security/selinux/avc.c:883 (was: Re: linux-next: Tree
for July 17: early crash on x86-64)

SELinux needs MAY_APPEND to be passed down to the security hook.
Otherwise, we get permission denials when only append permission is
granted by policy even if the opening process specified O_APPEND.
Shows up as a regression in the ltp selinux testsuite, fixed by
this patch.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years ago[MTD] [NAND] drivers/mtd/nand/nandsim.c: fix printk warnings
Andrew Morton [Wed, 30 Jul 2008 19:35:04 +0000 (12:35 -0700)]
[MTD] [NAND] drivers/mtd/nand/nandsim.c: fix printk warnings

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
16 years ago[MTD] [NAND] Blackfin NFC Driver: Cleanup the error exit path of bf5xx_nand_probe...
Bryan Wu [Wed, 30 Jul 2008 19:35:04 +0000 (12:35 -0700)]
[MTD] [NAND] Blackfin NFC Driver: Cleanup the error exit path of bf5xx_nand_probe function

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Cc: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
16 years ago[MTD] [NAND] Blackfin NFC Driver: use standard dev_err() rather than printk()
Mike Frysinger [Wed, 30 Jul 2008 19:35:03 +0000 (12:35 -0700)]
[MTD] [NAND] Blackfin NFC Driver: use standard dev_err() rather than printk()

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
16 years ago[MTD] [NAND] Blackfin NFC Driver: enable Blackfin nand HWECC support by default
Mike Frysinger [Wed, 30 Jul 2008 19:35:02 +0000 (12:35 -0700)]
[MTD] [NAND] Blackfin NFC Driver: enable Blackfin nand HWECC support by default

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
16 years ago[MTD] [NAND] Blackfin NFC Driver: add proper devinit/devexit markings to probe/remove...
Mike Frysinger [Wed, 30 Jul 2008 19:35:02 +0000 (12:35 -0700)]
[MTD] [NAND] Blackfin NFC Driver: add proper devinit/devexit markings to probe/remove functions

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
16 years ago[MTD] [NAND] Blackfin NFC Driver: add support for the ECC layout the Blackfin bootrom...
Mike Frysinger [Wed, 30 Jul 2008 19:35:01 +0000 (12:35 -0700)]
[MTD] [NAND] Blackfin NFC Driver: add support for the ECC layout the Blackfin bootrom uses

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
16 years ago[MTD] [NAND] Blackfin NFC Driver: fix bug - hw ecc calc by making sure we extract...
Mike Frysinger [Wed, 30 Jul 2008 19:35:00 +0000 (12:35 -0700)]
[MTD] [NAND] Blackfin NFC Driver: fix bug - hw ecc calc by making sure we extract 11 bits from each register instead of 10

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
16 years ago[MTD] [NAND] Blackfin NFC Driver: fix bug - do not clobber the status from the first...
Mike Frysinger [Wed, 30 Jul 2008 19:34:59 +0000 (12:34 -0700)]
[MTD] [NAND] Blackfin NFC Driver: fix bug - do not clobber the status from the first 256 bytes if operating on 512 pages

Singed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
16 years ago[S390] qeth: avoid use of include/asm-s390
Martin Schwidefsky [Fri, 1 Aug 2008 14:39:24 +0000 (16:39 +0200)]
[S390] qeth: avoid use of include/asm-s390

The planned move of include/asm-s390 to arch/s390/include/asm
requires that all includes for asm headers use include/asm and
not include/asm-s390.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] dont use kthread for smp_rescan_cpus().
Heiko Carstens [Fri, 1 Aug 2008 14:39:23 +0000 (16:39 +0200)]
[S390] dont use kthread for smp_rescan_cpus().

Since git commit 3da1c84c00c7e5fa8348336bd8c342f9128b0f14
"workqueues: make get_online_cpus() useable for work->func()"
it is safe to call get_online_cpus() from workqueue context.
So remove the kthread workaround again.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] virtio console: fix section mismatch warning.
Heiko Carstens [Fri, 1 Aug 2008 14:39:22 +0000 (16:39 +0200)]
[S390] virtio console: fix section mismatch warning.

Fix these two false positive warnings:

WARNING: vmlinux.o(.text+0x2e1cc4): Section mismatch in reference from the function s390_virtio_console_init() to the function .init.text:early_put_chars()
The function s390_virtio_console_init() references
the function __init early_put_chars().
This is often because s390_virtio_console_init lacks a __init
annotation or the annotation of early_put_chars is wrong.

WARNING: vmlinux.o(.text+0x2e1cd0): Section mismatch in reference from the function s390_virtio_console_init() to the function .init.text:virtio_cons_early_init()
The function s390_virtio_console_init() references
the function __init virtio_cons_early_init().
This is often because s390_virtio_console_init lacks a __init
annotation or the annotation of virtio_cons_early_init is wrong.

Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] cio: Include linux/string.h in schid.h.
Cornelia Huck [Fri, 1 Aug 2008 14:39:21 +0000 (16:39 +0200)]
[S390] cio: Include linux/string.h in schid.h.

schid.h needs string.h for memset and memcmp.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] qdio: fix section mismatch bug.
Heiko Carstens [Fri, 1 Aug 2008 14:39:20 +0000 (16:39 +0200)]
[S390] qdio: fix section mismatch bug.

Fix the two section mismatch warnings below.
This fixes two real bugs since the code which has __exit annotations
may already be gone when it is called.

WARNING: vmlinux.o(.init.text+0x1cc4a): Section mismatch in reference from the function init_QDIO() to the function .exit.text:qdio_setup_exit()
The function __init init_QDIO() references
a function __exit qdio_setup_exit().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __exit annotation of
qdio_setup_exit() so it may be used outside an exit section.

WARNING: vmlinux.o(.init.text+0x1cc7a): Section mismatch in reference from the function init_QDIO() to the function .exit.text:qdio_remove_perf_stats()
The function __init init_QDIO() references
a function __exit qdio_remove_perf_stats().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __exit annotation of
qdio_remove_perf_stats() so it may be used outside an exit section.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] stp: fix section mismatch warning.
Heiko Carstens [Fri, 1 Aug 2008 14:39:19 +0000 (16:39 +0200)]
[S390] stp: fix section mismatch warning.

Fix these two (false positive) warnings by adding an __init annoation:

WARNING: vmlinux.o(.text+0x7e6a): Section mismatch in reference from the function stp_reset() to the function .init.text:__alloc_bootmem()
The function stp_reset() references
the function __init __alloc_bootmem().
This is often because stp_reset lacks a __init
annotation or the annotation of __alloc_bootmem is wrong.

WARNING: vmlinux.o(.text+0x7ece): Section mismatch in reference from the function stp_reset() to the function .init.text:free_bootmem()
The function stp_reset() references
the function __init free_bootmem().
This is often because stp_reset lacks a __init
annotation or the annotation of free_bootmem is wrong.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] Remove diag 0x260 call from memory detection.
Heiko Carstens [Fri, 1 Aug 2008 14:39:18 +0000 (16:39 +0200)]
[S390] Remove diag 0x260 call from memory detection.

The result of the diag 0x260 call is not always what one would expect.
So just remove it.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] qdio: make sure qdr is aligned to page size
Jan Glauber [Fri, 1 Aug 2008 14:39:17 +0000 (16:39 +0200)]
[S390] qdio: make sure qdr is aligned to page size

kzalloc does not guarantee the required alignment of qdr to page size,
use get_zeroed_page instead.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
16 years ago[S390] Add support for memory hot-remove.
Gerald Schaefer [Fri, 1 Aug 2008 14:39:16 +0000 (16:39 +0200)]
[S390] Add support for memory hot-remove.

This patch enables memory hot-remove on s390.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] Wire up new syscalls.
Heiko Carstens [Fri, 1 Aug 2008 14:39:15 +0000 (16:39 +0200)]
[S390] Wire up new syscalls.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] cio: Memory allocation for idset changed.
Michael Ernst [Fri, 1 Aug 2008 14:39:14 +0000 (16:39 +0200)]
[S390] cio: Memory allocation for idset changed.

Memory allocation for the quite huge idset changed from
kzalloc to vmalloc.

Signed-off-by: Michael Ernst <mernst@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] qeth: preallocated qeth header for hiper socket
Frank Blaschka [Fri, 1 Aug 2008 14:39:13 +0000 (16:39 +0200)]
[S390] qeth: preallocated qeth header for hiper socket

For hiper socket devices this patch will economize the reallocation
of the tx skb data segment by allocating separate memory for the qdio
transport information (qeth header).

Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] Optimize storage key operations for anon pages
Martin Schwidefsky [Fri, 1 Aug 2008 14:39:12 +0000 (16:39 +0200)]
[S390] Optimize storage key operations for anon pages

For anonymous pages without a swap cache backing the check in
page_remove_rmap for the physical dirty bit in page_remove_rmap is
unnecessary. The instructions that are used to check and reset the dirty
bit are expensive. Removing the check noticably speeds up process exit.
In addition the clearing of the dirty bit in __SetPageUptodate is
pointless as well. With these two changes there is no storage key
operation for an anonymous page anymore if it does not hit the swap
space.

The micro benchmark which repeatedly executes an empty shell script
gets about 5% faster.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] nohz/sclp: disable timer on synchronous waits.
Heiko Carstens [Fri, 1 Aug 2008 14:39:11 +0000 (16:39 +0200)]
[S390] nohz/sclp: disable timer on synchronous waits.

sclp_sync_wait wait synchronously for an sclp interrupt and disables
timer interrupts. However on the irq enter paths there is an extra
check if a timer interrupt would be due and calls the timer callback.
This would schedule softirqs in the wrong context.
So introduce local_tick_enable/disable which prevents this.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] ipl: Reboot from alternate device does not work when booting from file
Michael Holzheu [Fri, 1 Aug 2008 14:39:10 +0000 (16:39 +0200)]
[S390] ipl: Reboot from alternate device does not work when booting from file

During startup we check if diag308 works using diag 308 subcode 6,
which stores the actual ipl information. This fails with rc = 0x102, if
the system has been ipled from the HMC using load from CD or load from file.
In the case of rc = 0x102 we have to assume that diag 308 is working,
since it still can be used to ipl from an alternative device.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] dasd: Add support for enhanced VM UID
Stefan Weinhuber [Fri, 1 Aug 2008 14:39:09 +0000 (16:39 +0200)]
[S390] dasd: Add support for enhanced VM UID

When z/VM provides two virtual devices (minidisks) that reside on the
same real device, both will receive the configuration data from the
real device and thus get the same uid. To fix this problem, z/VM
provides an additional configuration data record that allows to
distinguish between minidisks.
z/VM APAR VM64273 needs be installed so this fix has an effect.

Signed-off-by: Stefan Weinhuber <wein@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] Remove last P390 trace.
Heiko Carstens [Fri, 1 Aug 2008 14:39:08 +0000 (16:39 +0200)]
[S390] Remove last P390 trace.

Seems like I forgot this hunk...

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[MTD] [NAND] diskonchip.c fix sparse endian warnings
Harvey Harrison [Wed, 30 Jul 2008 19:34:57 +0000 (12:34 -0700)]
[MTD] [NAND] diskonchip.c fix sparse endian warnings

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
16 years ago[MTD] [NAND] drivers/mtd/nand/nandsim.c needs div64.h
Andrew Morton [Wed, 30 Jul 2008 19:34:56 +0000 (12:34 -0700)]
[MTD] [NAND] drivers/mtd/nand/nandsim.c needs div64.h

drivers/mtd/nand/nandsim.c: In function 'divide':
drivers/mtd/nand/nandsim.c:462: error: implicit declaration of function 'do_div'

Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>