17 Dec, 2009

10 commits

  • As of commit ee18d64c1f632043a02e6f5ba5e045bb26a5465f ("KEYS: Add a keyctl to
    install a process's session keyring on its parent [try #6]"), CONFIG_KEYS=y
    fails to build on architectures that haven't implemented TIF_NOTIFY_RESUME yet:

    security/keys/keyctl.c: In function 'keyctl_session_to_parent':
    security/keys/keyctl.c:1312: error: 'TIF_NOTIFY_RESUME' undeclared (first use in this function)
    security/keys/keyctl.c:1312: error: (Each undeclared identifier is reported only once
    security/keys/keyctl.c:1312: error: for each function it appears in.)

    Make KEYCTL_SESSION_TO_PARENT depend on TIF_NOTIFY_RESUME until
    m68k, and xtensa have implemented it.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: James Morris
    Acked-by: Mike Frysinger

    Geert Uytterhoeven
     
  • In NOMMU mode clamp dac_mmap_min_addr to zero to cause the tests on it to be
    skipped by the compiler. We do this as the minimum mmap address doesn't make
    any sense in NOMMU mode.

    mmap_min_addr and round_hint_to_min() can be discarded entirely in NOMMU mode.

    Signed-off-by: David Howells
    Acked-by: Eric Paris
    Signed-off-by: James Morris

    David Howells
     
  • init_mmap_min_addr() is a pure_initcall and should be static.

    Signed-off-by: H Hartley Sweeten
    Signed-off-by: Andrew Morton
    Signed-off-by: James Morris

    H Hartley Sweeten
     
  • Return the PTR_ERR of the correct pointer.

    Signed-off-by: Roel Kluin
    Signed-off-by: Andrew Morton
    Acked-by: David Howells
    Signed-off-by: James Morris

    Roel Kluin
     
  • Limit the number of imbalance messages to once per filesystem type instead of
    once per system boot. (it's actually slightly racy and could give you a
    couple per fs, but this isn't a real issue)

    Signed-off-by: Mimi Zohar
    Signed-off-by: Al Viro

    Mimi Zohar
     
  • Kill the 'update' argument of ima_path_check(), kill
    dead code in ima.

    Current rules: ima counters are bumped at the same time
    when the file switches from put_filp() fodder to fput()
    one. Which happens exactly in two places - alloc_file()
    and __dentry_open(). Nothing else needs to do that at
    all.

    Signed-off-by: Al Viro

    Al Viro
     
  • ima_inode_free() has some funky #define just to confuse the crap out of me.

    void ima_iint_delete(struct inode *inode)

    and then things actually call ima_inode_free() and nothing calls
    ima_iint_delete().

    Signed-off-by: Eric Paris
    Signed-off-by: Al Viro

    Eric Paris
     
  • We currently have a lot of duplicated code around ima file counts. Clean
    that all up.

    Signed-off-by: Eric Paris
    Acked-by: Serge Hallyn
    Signed-off-by: Al Viro

    Eric Paris
     
  • iints are supposed to be allocated when an inode is allocated (during
    security_inode_alloc()) But we have code which will attempt to allocate
    an iint during measurement calls. If we couldn't allocate the iint and we
    cared, we should have died during security_inode_alloc(). Not make the
    code more complex and less efficient.

    Signed-off-by: Eric Paris
    Signed-off-by: Al Viro

    Eric Paris
     
  • ima_inode_alloc returns 0 and 1, but the LSM hooks expects an errno.

    Signed-off-by: Eric Paris
    Signed-off-by: Al Viro

    Eric Paris
     

10 Dec, 2009

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (42 commits)
    tree-wide: fix misspelling of "definition" in comments
    reiserfs: fix misspelling of "journaled"
    doc: Fix a typo in slub.txt.
    inotify: remove superfluous return code check
    hdlc: spelling fix in find_pvc() comment
    doc: fix regulator docs cut-and-pasteism
    mtd: Fix comment in Kconfig
    doc: Fix IRQ chip docs
    tree-wide: fix assorted typos all over the place
    drivers/ata/libata-sff.c: comment spelling fixes
    fix typos/grammos in Documentation/edac.txt
    sysctl: add missing comments
    fs/debugfs/inode.c: fix comment typos
    sgivwfb: Make use of ARRAY_SIZE.
    sky2: fix sky2_link_down copy/paste comment error
    tree-wide: fix typos "couter" -> "counter"
    tree-wide: fix typos "offest" -> "offset"
    fix kerneldoc for set_irq_msi()
    spidev: fix double "of of" in comment
    comment typo fix: sybsystem -> subsystem
    ...

    Linus Torvalds
     

08 Dec, 2009

3 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1815 commits)
    mac80211: fix reorder buffer release
    iwmc3200wifi: Enable wimax core through module parameter
    iwmc3200wifi: Add wifi-wimax coexistence mode as a module parameter
    iwmc3200wifi: Coex table command does not expect a response
    iwmc3200wifi: Update wiwi priority table
    iwlwifi: driver version track kernel version
    iwlwifi: indicate uCode type when fail dump error/event log
    iwl3945: remove duplicated event logging code
    b43: fix two warnings
    ipw2100: fix rebooting hang with driver loaded
    cfg80211: indent regulatory messages with spaces
    iwmc3200wifi: fix NULL pointer dereference in pmkid update
    mac80211: Fix TX status reporting for injected data frames
    ath9k: enable 2GHz band only if the device supports it
    airo: Fix integer overflow warning
    rt2x00: Fix padding bug on L2PAD devices.
    WE: Fix set events not propagated
    b43legacy: avoid PPC fault during resume
    b43: avoid PPC fault during resume
    tcp: fix a timewait refcnt race
    ...

    Fix up conflicts due to sysctl cleanups (dead sysctl_check code and
    CTL_UNNUMBERED removed) in
    kernel/sysctl_check.c
    net/ipv4/sysctl_net_ipv4.c
    net/ipv6/addrconf.c
    net/sctp/sysctl.c

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl-2.6: (43 commits)
    security/tomoyo: Remove now unnecessary handling of security_sysctl.
    security/tomoyo: Add a special case to handle accesses through the internal proc mount.
    sysctl: Drop & in front of every proc_handler.
    sysctl: Remove CTL_NONE and CTL_UNNUMBERED
    sysctl: kill dead ctl_handler definitions.
    sysctl: Remove the last of the generic binary sysctl support
    sysctl net: Remove unused binary sysctl code
    sysctl security/tomoyo: Don't look at ctl_name
    sysctl arm: Remove binary sysctl support
    sysctl x86: Remove dead binary sysctl support
    sysctl sh: Remove dead binary sysctl support
    sysctl powerpc: Remove dead binary sysctl support
    sysctl ia64: Remove dead binary sysctl support
    sysctl s390: Remove dead sysctl binary support
    sysctl frv: Remove dead binary sysctl support
    sysctl mips/lasat: Remove dead binary sysctl support
    sysctl drivers: Remove dead binary sysctl support
    sysctl crypto: Remove dead binary sysctl support
    sysctl security/keys: Remove dead binary sysctl support
    sysctl kernel: Remove binary sysctl logic
    ...

    Linus Torvalds
     
  • Conflicts:

    kernel/irq/chip.c

    Jiri Kosina
     

06 Dec, 2009

1 commit


04 Dec, 2009

1 commit

  • That is "success", "unknown", "through", "performance", "[re|un]mapping"
    , "access", "default", "reasonable", "[con]currently", "temperature"
    , "channel", "[un]used", "application", "example","hierarchy", "therefore"
    , "[over|under]flow", "contiguous", "threshold", "enough" and others.

    Signed-off-by: André Goddard Rosa
    Signed-off-by: Jiri Kosina

    André Goddard Rosa
     

03 Dec, 2009

1 commit


25 Nov, 2009

1 commit

  • TOMOYO 1.7.1 has recursive directory matching operator support.
    I want to add it to TOMOYO for Linux 2.6.33 .
    ----------
    [PATCH] TOMOYO: Add recursive directory matching operator support.

    This patch introduces new operator /\{dir\}/ which matches
    '/' + 'One or more repetitions of dir/' (e.g. /dir/ /dir/dir/ /dir/dir/dir/ ).

    Signed-off-by: Tetsuo Handa
    Acked-by: John Johansen
    Signed-off-by: James Morris

    Tetsuo Handa
     

24 Nov, 2009

2 commits

  • As far as I know, all distros currently ship kernels with default
    CONFIG_SECURITY_FILE_CAPABILITIES=y. Since having the option on
    leaves a 'no_file_caps' option to boot without file capabilities,
    the main reason to keep the option is that turning it off saves
    you (on my s390x partition) 5k. In particular, vmlinux sizes
    came to:

    without patch fscaps=n: 53598392
    without patch fscaps=y: 53603406
    with this patch applied: 53603342

    with the security-next tree.

    Against this we must weigh the fact that there is no simple way for
    userspace to figure out whether file capabilities are supported,
    while things like per-process securebits, capability bounding
    sets, and adding bits to pI if CAP_SETPCAP is in pE are not supported
    with SECURITY_FILE_CAPABILITIES=n, leaving a bit of a problem for
    applications wanting to know whether they can use them and/or why
    something failed.

    It also adds another subtly different set of semantics which we must
    maintain at the risk of severe security regressions.

    So this patch removes the SECURITY_FILE_CAPABILITIES compile
    option. It drops the kernel size by about 50k over the stock
    SECURITY_FILE_CAPABILITIES=y kernel, by removing the
    cap_limit_ptraced_target() function.

    Changelog:
    Nov 20: remove cap_limit_ptraced_target() as it's logic
    was ifndef'ed.

    Signed-off-by: Serge E. Hallyn
    Acked-by: Andrew G. Morgan"
    Signed-off-by: James Morris

    Serge E. Hallyn
     
  • Historically we've seen cases where permissions are requested for classes
    where they do not exist. In particular we have seen CIFS forget to set
    i_mode to indicate it is a directory so when we later check something like
    remove_name we have problems since it wasn't defined in tclass file. This
    used to result in a avc which included the permission 0x2000 or something.
    Currently the kernel will deny the operations (good thing) but will not
    print ANY information (bad thing). First the auditdeny field is no
    extended to include unknown permissions. After that is fixed the logic in
    avc_dump_query to output this information isn't right since it will remove
    the permission from the av and print the phrase "". This takes us
    back to the behavior before the classmap rewrite.

    Signed-off-by: Eric Paris
    Signed-off-by: James Morris

    Eric Paris
     

21 Nov, 2009

3 commits


19 Nov, 2009

3 commits

  • Conflicts:
    drivers/net/sfc/sfe4001.c
    drivers/net/wireless/libertas/cmd.c
    drivers/staging/Kconfig
    drivers/staging/Makefile
    drivers/staging/rtl8187se/Kconfig
    drivers/staging/rtl8192e/Kconfig

    David S. Miller
     
  • While running fsstress tests on the NFSv4 mounted ext3 and ext4
    filesystem, the following call trace was generated on the nfs
    server machine.

    Replace GFP_KERNEL with GFP_NOFS in ima_iint_insert() to avoid a
    potential deadlock.

    =================================
    [ INFO: inconsistent lock state ]
    2.6.31-31.el6.x86_64 #1
    ---------------------------------
    inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-W} usage.
    kswapd2/75 [HC0[0]:SC0[0]:HE1:SE1] takes:
    (jbd2_handle){+.+.?.}, at: [] jbd2_journal_start+0xfe/0x13f
    {RECLAIM_FS-ON-W} state was registered at:
    [] mark_held_locks+0x65/0x99
    [] lockdep_trace_alloc+0xbd/0xf5
    [] kmem_cache_alloc+0x40/0x185
    [] ima_iint_insert+0x3d/0xf1
    [] ima_inode_alloc+0x25/0x44
    [] inode_init_always+0xec/0x271
    [] alloc_inode+0x51/0xa1
    [] new_inode+0x2e/0x94
    [] ext4_new_inode+0xb8/0xdc9
    [] ext4_create+0xcf/0x175
    [] vfs_create+0x82/0xb8
    [] do_filp_open+0x32c/0x9ee
    [] do_sys_open+0x6c/0x12c
    [] sys_open+0x2e/0x44
    [] system_call_fastpath+0x16/0x1b
    [] 0xffffffffffffffff
    irq event stamp: 90371
    hardirqs last enabled at (90371): []
    kmem_cache_alloc+0xf0/0x185
    hardirqs last disabled at (90370): []
    kmem_cache_alloc+0x89/0x185
    softirqs last enabled at (89492): []
    __do_softirq+0x1bf/0x1eb
    softirqs last disabled at (89477): [] call_softirq+0x1c/0x30

    other info that might help us debug this:
    2 locks held by kswapd2/75:
    #0: (shrinker_rwsem){++++..}, at: [] shrink_slab+0x44/0x177
    #1: (&type->s_umount_key#25){++++..}, at: []

    Reported-by: Muni P. Beerakam
    Reported-by: Amit K. Arora
    Cc: stable@kernel.org
    Signed-off-by: Mimi Zohar
    Signed-off-by: James Morris

    Mimi Zohar
     
  • For consistency drop & in front of every proc_handler. Explicity
    taking the address is unnecessary and it prevents optimizations
    like stubbing the proc_handlers to NULL.

    Cc: Alexey Dobriyan
    Cc: Ingo Molnar
    Cc: Joe Perches
    Signed-off-by: Eric W. Biederman

    Eric W. Biederman
     

12 Nov, 2009

2 commits


10 Nov, 2009

1 commit

  • For SELinux to do better filtering in userspace we send the name of the
    module along with the AVC denial when a program is denied module_request.

    Example output:

    type=SYSCALL msg=audit(11/03/2009 10:59:43.510:9) : arch=x86_64 syscall=write success=yes exit=2 a0=3 a1=7fc28c0d56c0 a2=2 a3=7fffca0d7440 items=0 ppid=1727 pid=1729 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=rpc.nfsd exe=/usr/sbin/rpc.nfsd subj=system_u:system_r:nfsd_t:s0 key=(null)
    type=AVC msg=audit(11/03/2009 10:59:43.510:9) : avc: denied { module_request } for pid=1729 comm=rpc.nfsd kmod="net-pf-10" scontext=system_u:system_r:nfsd_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=system

    Signed-off-by: Eric Paris
    Signed-off-by: James Morris

    Eric Paris
     

09 Nov, 2009

2 commits

  • The LSM currently requires setting a kernel parameter at boot to select
    a specific LSM. This adds a config option that allows specifying a default
    LSM that is used unless overridden with the security= kernel parameter.
    If the the config option is not set the current behavior of first LSM
    to register is used.

    Signed-off-by: John Johansen
    Acked-by: Serge Hallyn
    Signed-off-by: James Morris

    John Johansen
     
  • Currently the mmap_min_addr value can only be bypassed during mmap when
    the task has CAP_SYS_RAWIO. However, the mmap_min_addr sysctl value itself
    can be adjusted to 0 if euid == 0, allowing a bypass without CAP_SYS_RAWIO.
    This patch adds a check for the capability before allowing mmap_min_addr to
    be changed.

    Signed-off-by: Kees Cook
    Acked-by: Serge Hallyn
    Signed-off-by: James Morris

    Kees Cook
     

29 Oct, 2009

1 commit

  • When examining the network device name hash, it was discovered that
    the low order bits of full_name_hash() are not very well dispersed
    across the possible values. When used by filesystem code, this is handled
    by folding with the function hash_long().

    The only other non-filesystem usage of full_name_hash() at this time
    appears to be in TOMOYO. This patch should fix that.

    I do not use TOMOYO at this time, so this patch is build tested only.

    Signed-off-by: Stephen Hemminger
    Acked-by: Tetsuo Handa
    Signed-off-by: James Morris

    Stephen Hemminger
     

25 Oct, 2009

1 commit


24 Oct, 2009

1 commit


20 Oct, 2009

2 commits


19 Oct, 2009

1 commit

  • In order to have better cache layouts of struct sock (separate zones
    for rx/tx paths), we need this preliminary patch.

    Goal is to transfert fields used at lookup time in the first
    read-mostly cache line (inside struct sock_common) and move sk_refcnt
    to a separate cache line (only written by rx path)

    This patch adds inet_ prefix to daddr, rcv_saddr, dport, num, saddr,
    sport and id fields. This allows a future patch to define these
    fields as macros, like sk_refcnt, without name clashes.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

16 Oct, 2009

1 commit

  • The destination keyring specified to request_key() and co. is made available to
    the process that instantiates the key (the slave process started by
    /sbin/request-key typically). This is passed in the request_key_auth struct as
    the dest_keyring member.

    keyctl_instantiate_key and keyctl_negate_key() call get_instantiation_keyring()
    to get the keyring to attach the newly constructed key to at the end of
    instantiation. This may be given a specific keyring into which a link will be
    made later, or it may be asked to find the keyring passed to request_key(). In
    the former case, it returns a keyring with the refcount incremented by
    lookup_user_key(); in the latter case, it returns the keyring from the
    request_key_auth struct - and does _not_ increment the refcount.

    The latter case will eventually result in an oops when the keyring prematurely
    runs out of references and gets destroyed. The effect may take some time to
    show up as the key is destroyed lazily.

    To fix this, the keyring returned by get_instantiation_keyring() must always
    have its refcount incremented, no matter where it comes from.

    This can be tested by setting /etc/request-key.conf to:

    #OP TYPE DESCRIPTION CALLOUT INFO PROGRAM ARG1 ARG2 ARG3 ...
    #====== ======= =============== =============== ===============================
    create * test:* * |/bin/false %u %g %d %{user:_display}
    negate * * * /bin/keyctl negate %k 10 @u

    and then doing:

    keyctl add user _display aaaaaaaa @u
    while keyctl request2 user test:x test:x @u &&
    keyctl list @u;
    do
    keyctl request2 user test:x test:x @u;
    sleep 31;
    keyctl list @u;
    done

    which will oops eventually. Changing the negate line to have @u rather than
    %S at the end is important as that forces the latter case by passing a special
    keyring ID rather than an actual keyring ID.

    Reported-by: Alexander Zangerl
    Signed-off-by: David Howells
    Tested-by: Alexander Zangerl
    Signed-off-by: Linus Torvalds

    David Howells
     

12 Oct, 2009

2 commits