1. 02 4月, 2013 1 次提交
    • J
      selinux: make security_sb_clone_mnt_opts return an error on context mismatch · 094f7b69
      Jeff Layton 提交于
      I had the following problem reported a while back. If you mount the
      same filesystem twice using NFSv4 with different contexts, then the
      second context= option is ignored. For instance:
      
          # mount server:/export /mnt/test1
          # mount server:/export /mnt/test2 -o context=system_u:object_r:tmp_t:s0
          # ls -dZ /mnt/test1
          drwxrwxrwt. root root system_u:object_r:nfs_t:s0       /mnt/test1
          # ls -dZ /mnt/test2
          drwxrwxrwt. root root system_u:object_r:nfs_t:s0       /mnt/test2
      
      When we call into SELinux to set the context of a "cloned" superblock,
      it will currently just bail out when it notices that we're reusing an
      existing superblock. Since the existing superblock is already set up and
      presumably in use, we can't go overwriting its context with the one from
      the "original" sb. Because of this, the second context= option in this
      case cannot take effect.
      
      This patch fixes this by turning security_sb_clone_mnt_opts into an int
      return operation. When it finds that the "new" superblock that it has
      been handed is already set up, it checks to see whether the contexts on
      the old superblock match it. If it does, then it will just return
      success, otherwise it'll return -EBUSY and emit a printk to tell the
      admin why the second mount failed.
      
      Note that this patch may cause casualties. The NFSv4 code relies on
      being able to walk down to an export from the pseudoroot. If you mount
      filesystems that are nested within one another with different contexts,
      then this patch will make those mounts fail in new and "exciting" ways.
      
      For instance, suppose that /export is a separate filesystem on the
      server:
      
          # mount server:/ /mnt/test1
          # mount salusa:/export /mnt/test2 -o context=system_u:object_r:tmp_t:s0
          mount.nfs: an incorrect mount option was specified
      
      ...with the printk in the ring buffer. Because we *might* eventually
      walk down to /mnt/test1/export, the mount is denied due to this patch.
      The second mount needs the pseudoroot superblock, but that's already
      present with the wrong context.
      
      OTOH, if we mount these in the reverse order, then both mounts work,
      because the pseudoroot superblock created when mounting /export is
      discarded once that mount is done. If we then however try to walk into
      that directory, the automount fails for the similar reasons:
      
          # cd /mnt/test1/scratch/
          -bash: cd: /mnt/test1/scratch: Device or resource busy
      
      The story I've gotten from the SELinux folks that I've talked to is that
      this is desirable behavior. In SELinux-land, mounting the same data
      under different contexts is wrong -- there can be only one.
      
      Cc: Steve Dickson <steved@redhat.com>
      Cc: Stephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Acked-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <james.l.morris@oracle.com>
      094f7b69
  2. 01 4月, 2013 1 次提交
  3. 26 3月, 2013 1 次提交
  4. 20 3月, 2013 5 次提交
    • I
      Fix NULL pointer dereference in smack_inode_unlink() and smack_inode_rmdir() · cdb56b60
      Igor Zhbanov 提交于
      This patch fixes kernel Oops because of wrong common_audit_data type
      in smack_inode_unlink() and smack_inode_rmdir().
      
      When SMACK security module is enabled and SMACK logging is on (/smack/logging
      is not zero) and you try to delete the file which
      1) you cannot delete due to SMACK rules and logging of failures is on
      or
      2) you can delete and logging of success is on,
      
      you will see following:
      
      	Unable to handle kernel NULL pointer dereference at virtual address 000002d7
      
      	[<...>] (strlen+0x0/0x28)
      	[<...>] (audit_log_untrustedstring+0x14/0x28)
      	[<...>] (common_lsm_audit+0x108/0x6ac)
      	[<...>] (smack_log+0xc4/0xe4)
      	[<...>] (smk_curacc+0x80/0x10c)
      	[<...>] (smack_inode_unlink+0x74/0x80)
      	[<...>] (security_inode_unlink+0x2c/0x30)
      	[<...>] (vfs_unlink+0x7c/0x100)
      	[<...>] (do_unlinkat+0x144/0x16c)
      
      The function smack_inode_unlink() (and smack_inode_rmdir()) need
      to log two structures of different types. First of all it does:
      
      	smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_DENTRY);
      	smk_ad_setfield_u_fs_path_dentry(&ad, dentry);
      
      This will set common audit data type to LSM_AUDIT_DATA_DENTRY
      and store dentry for auditing (by function smk_curacc(), which in turn calls
      dump_common_audit_data(), which is actually uses provided data and logs it).
      
      	/*
      	 * You need write access to the thing you're unlinking
      	 */
      	rc = smk_curacc(smk_of_inode(ip), MAY_WRITE, &ad);
      	if (rc == 0) {
      		/*
      		 * You also need write access to the containing directory
      		 */
      
      Then this function wants to log anoter data:
      
      		smk_ad_setfield_u_fs_path_dentry(&ad, NULL);
      		smk_ad_setfield_u_fs_inode(&ad, dir);
      
      The function sets inode field, but don't change common_audit_data type.
      
      		rc = smk_curacc(smk_of_inode(dir), MAY_WRITE, &ad);
      	}
      
      So the dump_common_audit() function incorrectly interprets inode structure
      as dentry, and Oops will happen.
      
      This patch reinitializes common_audit_data structures with correct type.
      Also I removed unneeded
      	smk_ad_setfield_u_fs_path_dentry(&ad, NULL);
      initialization, because both dentry and inode pointers are stored
      in the same union.
      Signed-off-by: NIgor Zhbanov <i.zhbanov@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      cdb56b60
    • R
      Smack: add support for modification of existing rules · e05b6f98
      Rafal Krypa 提交于
      Rule modifications are enabled via /smack/change-rule. Format is as follows:
      "Subject Object rwaxt rwaxt"
      
      First two strings are subject and object labels up to 255 characters.
      Third string contains permissions to enable.
      Fourth string contains permissions to disable.
      
      All unmentioned permissions will be left unchanged.
      If no rule previously existed, it will be created.
      
      Targeted for git://git.gitorious.org/smack-next/kernel.gitSigned-off-by: NRafal Krypa <r.krypa@samsung.com>
      e05b6f98
    • J
      smack: SMACK_MAGIC to include/uapi/linux/magic.h · cee7e443
      Jarkko Sakkinen 提交于
      SMACK_MAGIC moved to a proper place for easy user space access
      (i.e. libsmack).
      Signed-off-by: NJarkko Sakkinen <jarkko.sakkinen@iki.fi>
      cee7e443
    • R
      Smack: add missing support for transmute bit in smack_str_from_perm() · a87d79ad
      Rafal Krypa 提交于
      This fixes audit logs for granting or denial of permissions to show
      information about transmute bit.
      
      Targeted for git://git.gitorious.org/smack-next/kernel.gitSigned-off-by: NRafal Krypa <r.krypa@samsung.com>
      a87d79ad
    • R
      Smack: prevent revoke-subject from failing when unseen label is written to it · d15d9fad
      Rafal Krypa 提交于
      Special file /smack/revoke-subject will silently accept labels that are not
      present on the subject label list. Nothing has to be done for such labels,
      as there are no rules for them to revoke.
      
      Targeted for git://git.gitorious.org/smack-next/kernel.gitSigned-off-by: NRafal Krypa <r.krypa@samsung.com>
      d15d9fad
  5. 18 3月, 2013 2 次提交
  6. 11 3月, 2013 2 次提交
  7. 10 3月, 2013 2 次提交
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace · 72932611
      Linus Torvalds 提交于
      Pull namespace bugfixes from Eric Biederman:
       "This is three simple fixes against 3.9-rc1.  I have tested each of
        these fixes and verified they work correctly.
      
        The userns oops in key_change_session_keyring and the BUG_ON triggered
        by proc_ns_follow_link were found by Dave Jones.
      
        I am including the enhancement for mount to only trigger requests of
        filesystem modules here instead of delaying this for the 3.10 merge
        window because it is both trivial and the kind of change that tends to
        bit-rot if left untouched for two months."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        proc: Use nd_jump_link in proc_ns_follow_link
        fs: Limit sys_mount to only request filesystem modules (Part 2).
        fs: Limit sys_mount to only request filesystem modules.
        userns: Stop oopsing in key_change_session_keyring
      72932611
    • L
      Atmel MXT touchscreen: increase reset timeouts · 8343bce1
      Linus Torvalds 提交于
      There is a more complete atmel patch-series out by Nick Dyer that fixes
      this and other things, but in the meantime this is the minimal thing to
      get the touchscreen going on (at least my) Pixel Chromebook.
      
      Not that I want my dirty fingers near that beautiful screen, but it
      seems that a non-initialized touchscreen will also end up being a
      constant wakeup source, so you have to disable it to go to sleep.  And
      it's easier to just fix the initialization sequence.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8343bce1
  8. 09 3月, 2013 23 次提交
  9. 08 3月, 2013 3 次提交
    • L
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 47b3bc90
      Linus Torvalds 提交于
      Pull x86 fixes from Peter Anvin:
       "Several boot fixes (MacBook, legacy EFI bootloaders), another
        please-don't-brick fix, and some minor stuff."
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86: Do not try to sync identity map for non-mapped pages
        x86, doc: Be explicit about what the x86 struct boot_params requires
        x86: Don't clear efi_info even if the sentinel hits
        x86, mm: Make sure to find a 2M free block for the first mapped area
        x86: Fix 32-bit *_cpu_data initializers
        efivarfs: return accurate error code in efivarfs_fill_super()
        efivars: efivarfs_valid_name() should handle pstore syntax
        efi: be more paranoid about available space when creating variables
        iommu, x86: Add DMA remap fault reason
        x86, smpboot: Remove unused variable
      47b3bc90
    • L
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · af2841cd
      Linus Torvalds 提交于
      Pull drm fixes from Dave Airlie:
       "Misc radeon, nouveau, mgag200 and intel fixes.
      
        The intel fixes should contain the fix for the touchpad on the
        Chromebook - hey I'm an input maintainer now!"
      
      Hate to pee on your parade, Dave, but I don't think being an input
      maintainer is necessarily something to strive for..
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (25 commits)
        drm/tegra: drop "select DRM_HDMI"
        drm: Documentation typo fixes
        drm/mgag200: Bug fix: Renesas board now selects native resolution.
        drm/mgag200: Reject modes that are too big for VRAM
        drm/mgag200: 'fbdev_list' in 'struct mga_fbdev' is not used
        drm/radeon: don't check mipmap alignment if MIP_ADDRESS is FMASK
        drm/radeon: skip MC reset as it's probably not hung
        drm/radeon: add primary dac adj quirk for R200 board
        drm/radeon: don't set hpd, afmt interrupts when interrupts are disabled
        drm/i915: Turn off hsync and vsync on ADPA when disabling crt
        drm/i915: Fix incorrect definition of ADPA HSYNC and VSYNC bits
        drm/i915: also disable south interrupts when handling them
        drm/i915: enable irqs earlier when resuming
        drm/i915: Increase the RC6p threshold.
        DRM/i915: On G45 enable cursor plane briefly after enabling the display plane.
        drm/nv50-: prevent some races between modesetting and page flipping
        drm/nouveau/i2c: drop parent refcount when creating ports
        drm/nv84: fix regression in page flipping
        drm/nouveau: Fix typo in init_idx_addr_latched().
        drm/nouveau: Disable AGP on PowerPC again.
        ...
      af2841cd
    • L
      Merge tag 'pm+acpi-3.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · c89b148f
      Linus Torvalds 提交于
      Pull ACPI and power management fixes from Rafael J Wysocki:
      
       - Two fixes for the new intel_pstate driver from Dirk Brandewie.
      
       - Fix for incorrect usage of the .find_bridge() callback from struct
         acpi_bus_type in the USB core and subsequent removal of that callback
         from Rafael J Wysocki.
      
       - ACPI processor driver cleanups from Chen Gang and Syam Sidhardhan.
      
       - ACPI initialization and error messages fix from Joe Perches.
      
       - Operating Performance Points documentation improvement from Nishanth
         Menon.
      
       - Fixes for memory leaks and potential concurrency issues and sysfs
        attributes leaks during device removal in the core device PM QoS code
        from Rafael J Wysocki.
      
       - Calxeda Highbank cpufreq driver simplification from Emilio López.
      
       - cpufreq comment cleanup from Namhyung Kim.
      
       - Fix for a section mismatch in Calxeda Highbank interprocessor
         communication code from Mark Langsdorf (this is not a PM fix strictly
         speaking, but the code in question went in through the PM tree).
      
      * tag 'pm+acpi-3.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq / intel_pstate: Do not load on VM that does not report max P state.
        cpufreq / intel_pstate: Fix intel_pstate_init() error path
        ACPI / glue: Drop .find_bridge() callback from struct acpi_bus_type
        ACPI / glue: Add .match() callback to struct acpi_bus_type
        ACPI / porocessor: Beautify code, pr->id is u32 which is never < 0
        ACPI / processor: Remove redundant NULL check before kfree
        ACPI / Sleep: Avoid interleaved message on errors
        PM / QoS: Remove device PM QoS sysfs attributes at the right place
        PM / QoS: Fix concurrency issues and memory leaks in device PM QoS
        cpufreq: highbank: do not initialize array with a loop
        PM / OPP: improve introductory documentation
        cpufreq: Fix a typo in comment
        mailbox, pl320-ipc: remove __init from probe function
      c89b148f