04 Jan, 2014

2 commits


03 Jan, 2014

2 commits


13 Dec, 2013

2 commits

  • There is an inconsistency in the handling of SUID/SGID file
    bits after chown() between NFS and other local file systems.

    Local file systems (for example, ext3, ext4, xfs, btrfs) revoke
    SUID/SGID bits after chown() on a regular file even if
    the owner/group of the file has not been changed:

    ~# touch file; chmod ug+s file; chmod u+x file
    ~# ls -l file
    -rwsr-Sr-- 1 root root 0 Dec 6 04:49 file
    ~# chown root file; ls -l file
    -rwxr-Sr-- 1 root root 0 Dec 6 04:49 file

    but NFS doesn't do that:

    ~# touch file; chmod ug+s file; chmod u+x file
    ~# ls -l file
    -rwsr-Sr-- 1 root root 0 Dec 6 04:49 file
    ~# chown root file; ls -l file
    -rwsr-Sr-- 1 root root 0 Dec 6 04:49 file

    NFS does that only if the owner/group has been changed:

    ~# touch file; chmod ug+s file; chmod u+x file
    ~# ls -l file
    -rwsr-Sr-- 1 root root 0 Dec 6 05:02 file
    ~# chown bin file; ls -l file
    -rwxr-Sr-- 1 bin root 0 Dec 6 05:02 file

    See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html

    "If the specified file is a regular file, one or more of
    the S_IXUSR, S_IXGRP, or S_IXOTH bits of the file mode are set,
    and the process has appropriate privileges, it is
    implementation-defined whether the set-user-ID and set-group-ID
    bits are altered."

    So both variants are acceptable by POSIX.

    This patch makes NFS to behave like local file systems.

    Signed-off-by: Stanislav Kholmanskikh
    Signed-off-by: J. Bruce Fields

    Stanislav Kholmanskikh
     
  • hex_pack_byte() is a fast way to convert a byte in its ASCII representation. We
    may use it instead of custom approach.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: J. Bruce Fields

    Andy Shevchenko
     

12 Dec, 2013

1 commit


11 Dec, 2013

5 commits

  • Signed-off-by: Weng Meiling
    Signed-off-by: J. Bruce Fields

    Weng Meiling
     
  • Signed-off-by: Christoph Hellwig
    Signed-off-by: J. Bruce Fields

    Christoph Hellwig
     
  • The Linux NFS server replies among other things to a "Check access permission"
    the following:

    NFS: File type = 2 (Directory)
    NFS: Mode = 040755

    A netapp server replies here:
    NFS: File type = 2 (Directory)
    NFS: Mode = 0755

    The RFC 1813 i read:
    fattr3

    struct fattr3 {
    ftype3 type;
    mode3 mode;
    uint32 nlink;
    ...
    For the mode bits only the lowest 9 are defined in the RFC

    As far as I can tell, knfsd has always done this, so apparently it's harmless.
    Nevertheless, it appears to be wrong.

    Note this is already correct in the NFSv4 case, only v2 and v3 need
    fixing.

    Signed-off-by: J. Bruce Fields

    Albert Fluegel
     
  • This has gone a little stale.

    Reported-by: Christoph Hellwig
    Reviewed-by: Christoph Hellwig
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • The DRC code will attempt to reuse an existing, expired cache entry in
    preference to allocating a new one. It'll then search the cache, and if
    it gets a hit it'll then free the cache entry that it was going to
    reuse.

    The cache code doesn't unhash the entry that it's going to reuse
    however, so it's possible for it end up designating an entry for reuse
    and then subsequently freeing the same entry after it finds it. This
    leads it to a later use-after-free situation and usually some list
    corruption warnings or an oops.

    Fix this by simply unhashing the entry that we intend to reuse. That
    will mean that it's not findable via a search and should prevent this
    situation from occurring.

    Cc: stable@vger.kernel.org # v3.10+
    Reported-by: Christoph Hellwig
    Reported-by: g. artim
    Signed-off-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Jeff Layton
     

07 Dec, 2013

6 commits

  • Linus Torvalds
     
  • …t/rostedt/linux-trace

    Pull tracing fix from Steven Rostedt:
    "A regression showed up that there's a large delay when enabling all
    events. This was prevalent when FTRACE_SELFTEST was enabled which
    enables all events several times, and caused the system bootup to
    pause for over a minute.

    This was tracked down to an addition of a synchronize_sched()
    performed when system call tracepoints are unregistered.

    The synchronize_sched() is needed between the unregistering of the
    system call tracepoint and a deletion of a tracing instance buffer.
    But placing the synchronize_sched() in the unreg of *every* system
    call tracepoint is a bit overboard. A single synchronize_sched()
    before the deletion of the instance is sufficient"

    * tag 'trace-fixes-3.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    tracing: Only run synchronize_sched() at instance deletion time

    Linus Torvalds
     
  • Pull aio fix from Benjamin LaHaise:
    "AIO fix from Gu Zheng that fixes a GPF that Dave Jones uncovered with
    trinity"

    * git://git.kvack.org/~bcrl/aio-next:
    aio: clean up aio ring in the fail path

    Linus Torvalds
     
  • Pull SCSI fixes from James Bottomley:
    "This is a set of nine fixes (and one author update).

    The libsas one should fix discovery in eSATA devices, the WRITE_SAME
    one is the largest, but it should fix a lot of problems we've been
    getting with the emulated RAID devices (they've been effectively lying
    about support and then firmware has been choking on the commands).

    The rest are various crash, hang or warn driver fixes"

    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
    [SCSI] bfa: Fix crash when symb name set for offline vport
    [SCSI] enclosure: fix WARN_ON in dual path device removing
    [SCSI] pm80xx: Tasklets synchronization fix.
    [SCSI] pm80xx: Resetting the phy state.
    [SCSI] pm80xx: Fix for direct attached device.
    [SCSI] pm80xx: Module author addition
    [SCSI] hpsa: return 0 from driver probe function on success, not 1
    [SCSI] hpsa: do not discard scsi status on aborted commands
    [SCSI] Disable WRITE SAME for RAID and virtual host adapter drivers
    [SCSI] libsas: fix usage of ata_tf_to_fis

    Linus Torvalds
     
  • Pull IMA fixes from James Morris:
    "Here are two more fixes for IMA"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
    ima: properly free ima_template_entry structures
    ima: Do not free 'entry' before it is initialized

    Linus Torvalds
     
  • Pull devicetree fixes from Rob Herring:
    - Various DT binding documentation updates
    - Add Kumar Gala and remove Stephen Warren as DT binding maintainers

    * tag 'dt-fixes-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
    dt: binding: reword PowerPC 8xxx GPIO documentation
    ARM: tegra: delete nvidia,tegra20-spi.txt binding
    hwmon: ntc_thermistor: Fix typo (pullup-uV -> pullup-uv)
    of: add vendor prefix for GMT
    clk: exynos: Fix typos in DT bindings documentation
    of: Add vendor prefix for LG Corporation
    Documentation: net: fsl-fec.txt: Add phy-supply entry
    ARM: dts: doc: Document missing binding for omap5-mpu
    dt-bindings: add ARMv8 PMU binding
    MAINTAINERS: remove swarren from DT bindings
    MAINTAINERS: Add Kumar to Device Tree Binding maintainers group

    Linus Torvalds
     

06 Dec, 2013

15 commits

  • Clean up the aio ring file in the fail path of aio_setup_ring
    and ioctx_alloc. And maybe it can fix the GPF issue reported by
    Dave Jones:
    https://lkml.org/lkml/2013/11/25/898

    Signed-off-by: Gu Zheng
    Signed-off-by: Benjamin LaHaise

    Gu Zheng
     
  • …r/linux-integrity into for-linus

    James Morris
     
  • Pull power management fixes from Rafael Wysocki:

    - cpufreq regression fix from Bjørn Mork restoring the pre-3.12
    behavior of the framework during system suspend/hibernation to avoid
    garbage sysfs files from being left behind in case of a suspend error

    - PNP regression fix to restore the correct states of devices after
    resume from hibernation broken in 3.12. From Dmitry Torokhov.

    - cpuidle fix to prevent cpuidle device unregistration from crashing
    due to a NULL pointer dereference if cpuidle has been disabled from
    the kernel command line. From Konrad Rzeszutek Wilk.

    - intel_idle fix for the C6 state definition on Intel Avoton/Rangeley
    processors from Arne Bockholdt.

    - Power capping framework fix to make the energy_uj sysfs attribute
    work in accordance with the documentation. From Srinivas Pandruvada.

    - epoll fix to make it ignore the EPOLLWAKEUP flag if the kernel has
    been compiled with CONFIG_PM_SLEEP unset (in which case that flag
    should not have any effect). From Amit Pundir.

    - cpufreq fix to prevent governor sysfs files from being lost over
    system suspend/resume in some (arguably unusual) situations. From
    Viresh Kumar.

    * tag 'pm-3.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    PowerCap: Fix mode for energy counter
    PNP: fix restoring devices after hibernation
    cpuidle: Check for dev before deregistering it.
    epoll: drop EPOLLWAKEUP if PM_SLEEP is disabled
    cpufreq: fix garbage kobjects on errors during suspend/resume
    cpufreq: suspend governors on system suspend/hibernate
    intel_idle: Fixed C6 state on Avoton/Rangeley processors

    Linus Torvalds
     
  • * pm-epoll:
    epoll: drop EPOLLWAKEUP if PM_SLEEP is disabled

    * pnp:
    PNP: fix restoring devices after hibernation

    * powercap:
    PowerCap: Fix mode for energy counter

    Rafael J. Wysocki
     
  • * pm-cpuidle:
    cpuidle: Check for dev before deregistering it.
    intel_idle: Fixed C6 state on Avoton/Rangeley processors

    * pm-cpufreq:
    cpufreq: fix garbage kobjects on errors during suspend/resume
    cpufreq: suspend governors on system suspend/hibernate

    Rafael J. Wysocki
     
  • Pull arch/tile ftrace bug fix from Chris Metcalf:
    "This fixes a build failure with allyesconfig reported by Fengguang Wu
    and fixed by Tony Lu"

    * 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
    ftrace: default to tilegx if ARCH=tile is specified

    Linus Torvalds
     
  • Pull block layer fixes from Jens Axboe:
    "A small collection of fixes for the current series. It contains:

    - A fix for a use-after-free of a request in blk-mq. From Ming Lei

    - A fix for a blk-mq bug that could attempt to dereference a NULL rq
    if allocation failed

    - Two xen-blkfront small fixes

    - Cleanup of submit_bio_wait() type uses in the kernel, unifying
    that. From Kent

    - A fix for 32-bit blkg_rwstat reading. I apologize for this one
    looking mangled in the shortlog, it's entirely my fault for missing
    an empty line between the description and body of the text"

    * 'for-linus' of git://git.kernel.dk/linux-block:
    blk-mq: fix use-after-free of request
    blk-mq: fix dereference of rq->mq_ctx if allocation fails
    block: xen-blkfront: Fix possible NULL ptr dereference
    xen-blkfront: Silence pfn maybe-uninitialized warning
    block: submit_bio_wait() conversions
    Update of blkg_stat and blkg_rwstat may happen in bh context

    Linus Torvalds
     
  • Pull NFS client bugfixes from Trond Myklebust:
    - Stable fix for a NFSv4.1 delegation and state recovery deadlock
    - Stable fix for a loop on irrecoverable errors when returning
    delegations
    - Fix a 3-way deadlock between layoutreturn, open, and state recovery
    - Update the MAINTAINERS file with contact information for Trond
    Myklebust
    - Close needs to handle NFS4ERR_ADMIN_REVOKED
    - Enabling v4.2 should not recompile nfsd and lockd
    - Fix a couple of compile warnings

    * tag 'nfs-for-3.13-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
    nfs: fix do_div() warning by instead using sector_div()
    MAINTAINERS: Update contact information for Trond Myklebust
    NFSv4.1: Prevent a 3-way deadlock between layoutreturn, open and state recovery
    SUNRPC: do not fail gss proc NULL calls with EACCES
    NFSv4: close needs to handle NFS4ERR_ADMIN_REVOKED
    NFSv4: Update list of irrecoverable errors on DELEGRETURN
    NFSv4 wait on recovery for async session errors
    NFS: Fix a warning in nfs_setsecurity
    NFS: Enabling v4.2 should not recompile nfsd and lockd

    Linus Torvalds
     
  • This matches the existing behavior in arch/tile/Makefile for defconfig.

    Reported-by: fengguang.wu@intel.com
    Acked-by: Steven Rostedt
    Signed-off-by: Tony Lu
    Signed-off-by: Chris Metcalf

    Tony Lu
     
  • It has been reported that boot up with FTRACE_SELFTEST enabled can take a
    very long time. There can be stalls of over a minute.

    This was tracked down to the synchronize_sched() called when a system call
    event is disabled. As the self tests enable and disable thousands of events,
    this makes the synchronize_sched() get called thousands of times.

    The synchornize_sched() was added with d562aff93bfb53 "tracing: Add support
    for SOFT_DISABLE to syscall events" which caused this regression (added
    in 3.13-rc1).

    The synchronize_sched() is to protect against the events being accessed
    when a tracer instance is being deleted. When an instance is being deleted
    all the events associated to it are unregistered. The synchronize_sched()
    makes sure that no more users are running when it finishes.

    Instead of calling synchronize_sched() for all syscall events, we only
    need to call it once, after the events are unregistered and before the
    instance is deleted. The event_mutex is held during this action to
    prevent new users from enabling events.

    Link: http://lkml.kernel.org/r/20131203124120.427b9661@gandalf.local.home

    Reported-by: Petr Mladek
    Acked-by: Tom Zanussi
    Acked-by: Petr Mladek
    Tested-by: Petr Mladek
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • Pull btrfs MAINTAINERS file update:
    "I'm still getting settled into new devel hardware etc, but I do have
    one commit for the next rc.

    This changes my email over to fb.com, and adds a MAINTAINERS entry for
    Josef as well"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
    Btrfs: update the MAINTAINERS file

    Linus Torvalds
     
  • Pull minor fbdev fixes from Tomi Valkeinen.

    * tag 'fbdev-fixes-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux:
    video: vt8500: fix error handling in probe()
    atmel_lcdfb: fix module autoload
    fbdev: sh_mobile_meram: Fix defined but not used compiler warnings
    video: kyro: fix incorrect sizes when copying to userspace
    ARM: OMAPFB: panel-sony-acx565akm: fix bad unlock balance

    Linus Torvalds
     
  • Pull sound fixes from Takashi Iwai:
    "A usual pattern of half ASoC and half HD-audio fixes, although
    HD-audio fixups have more volumes, in addition to a couple of trivial
    fixes. Nothing to worry much is found here.

    For ASoC side: a few fixes for PCM rate constraints calculations,
    regmap byte-order fix, the rest driver specific fixes (atmel, fsl,
    omap, kirkwood, wm codecs).

    For HD-audio: Dell headset and mono out fix, ELD update in polling
    mode, ALC283 Chromebook fixes, a few fixes for old AD codecs and
    MBA2, one regression fix"

    * tag 'sound-3.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (30 commits)
    ALSA: hda - Fix silent output on MacBook Air 2,1
    ALSA: hda - Fix missing ELD info when using jackpoll_ms parameter
    ALSA: hda/realtek - remove hp_automute_hook from alc283_fixup_chromebook
    ASoC: wm8731: fix dsp mode configuration
    ALSA: hda/realtek - Independent of model for HP
    ALSA: hda - Fix headset mic input after muted internal mic (Dell/Realtek)
    ALSA: hda - Use always amps for auto-mute on AD1986A codec
    ALSA: hda/analog - Handle inverted EAPD properly in vmaster hook
    ALSA: hda - Another fixup for ASUS laptop with ALC660 codec
    ALSA: atmel: Fix possible array overflow
    ALSA: hda - Fix complete_all() timing in deferred probes
    ALSA: hda - Fix bad EAPD setup for HP machines with AD1984A
    ASoC: core: fix devres parameter in devm_snd_soc_register_card()
    ASoC: omap: n810: Convert to clk_prepare_enable/clk_disable_unprepare
    ASoC: fsl: set correct platform drvdata in pcm030_fabric_probe()
    ASoC: fsl: imx-pcm-fiq: Remove unused 'runtime' variable
    ASoC: fsl: imx-pcm-fiq: remove bogus period delta calculation
    ALSA: hda - Fix silent output on ASUS W7J laptop
    ASoC: core: Use consistent byte ordering in snd_soc_bytes_get
    ALSA: dice: fix array limits in dice_proc_read()
    ...

    Linus Torvalds
     
  • Pull pin control fixes from Linus Walleij:

    - Minor bug fixes for the Rockchip, ST-Ericsson abx500, Renesas PFC
    r8a7740 and sh7372.

    - Compilation warning fixes.

    * tag 'pinctrl-v3.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
    sh-pfc: sh7372: Fix pin bias setup
    sh-pfc: r8a7740: Fix pin bias setup
    pinctrl: abx500: Fix header file include guard
    pinctrl: rockchip: missing unlock on error in rockchip_set_pull()
    pinctrl: abx500: fix some more bitwise AND tests
    pinctrl: rockchip: testing the wrong variable

    Linus Torvalds
     
  • If accounting is on, we will do the IO completion accounting after
    we have freed the request. Fix that by moving it sooner instead.

    Signed-off-by: Jens Axboe

    Ming Lei
     

05 Dec, 2013

7 commits

  • Pull x86 and EFI fixes from Peter Anvin:
    "Half of these are EFI-related:

    The by far biggest change is the change to hold off the deletion of a
    sysfs entry while a backend scan is in progress. This is to avoid
    calling kmemdup() while under a spinlock.

    The other major change is for each entry in the EFI pstore backend to
    get a unique identifier, as required by the pstore filesystem proper.

    The other changes are:

    A fix to the recent consolidation and optimization of using "asm goto"
    with read-modify-write operation, which broke the bitops; specifically
    in such a way that we could end up generating invalid code.

    A build hack to make sure we compile with -mno-sse. icc, and most
    likely future versions of gcc, can generate SSE instructions unless we
    tell it not to.

    A comment-only patch to a change the was due in part to an unpublished
    erratum; now when the erratum is published we want to add a comment
    explaining why"

    * 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/apic, doc: Justification for disabling IO APIC before Local APIC
    x86, bitops: Correct the assembly constraints to testing bitops
    x86-64, build: Always pass in -mno-sse
    efi-pstore: Make efi-pstore return a unique id
    x86/efi: Fix earlyprintk off-by-one bug
    efivars, efi-pstore: Hold off deletion of sysfs entry until the scan is completed

    Linus Torvalds
     
  • Since erratum AVR31 in "Intel Atom Processor C2000 Product Family
    Specification Update" is now published, I added a justification
    comment for disabling IO APIC before Local APIC, as changed in commit:

    522e66464467 x86/apic: Disable I/O APIC before shutdown of the local APIC

    Signed-off-by: Fenghua Yu
    Link: http://lkml.kernel.org/r/1386202069-51515-1-git-send-email-fenghua.yu@intel.com
    Signed-off-by: H. Peter Anvin

    Fenghua Yu
     
  • As per the documentation of powercap sysfs, energy_uj field is read only,
    if it can't be reset. Currently it always allows write but will fail,
    if there is no reset callback.
    Changing mode field, to read only if there is no reset callback.

    Signed-off-by: Srinivas Pandruvada
    Reported-by: Dirk Brandewie
    Signed-off-by: Rafael J. Wysocki

    Srinivas Pandruvada
     
  • On returning from hibernation 'restore' callback is called,
    not 'resume'. Fix it.

    Fixes: eaf140b60ec9 (PNP: convert PNP driver bus legacy pm_ops to dev_pm_ops)
    Signed-off-by: Dmitry Torokhov
    Cc: 3.12+ # 3.12+
    Signed-off-by: Rafael J. Wysocki

    Dmitry Torokhov
     
  • In checkin:

    0c44c2d0f459 x86: Use asm goto to implement better modify_and_test() functions

    the various functions which do modify and test were unified and
    optimized using "asm goto". However, this change missed the detail
    that the bitops require an "Ir" constraint rather than an "er"
    constraint ("I" = integer constant from 0-31, "e" = signed 32-bit
    integer constant). This would cause code to miscompile if these
    functions were used on constant bit positions 32-255 and the build to
    fail if used on constant bit positions above 255.

    Add the constraints as a parameter to the GEN_BINARY_RMWcc() macro to
    avoid this problem.

    Reported-by: Jesse Brandeburg
    Signed-off-by: H. Peter Anvin
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/529E8719.4070202@zytor.com

    H. Peter Anvin
     
  • When compiling a 32bit kernel with CONFIG_LBDAF=n the compiler complains like
    shown below. Fix this warning by instead using sector_div() which is provided
    by the kernel.h header file.

    fs/nfs/blocklayout/extents.c: In function ‘normalize’:
    include/asm-generic/div64.h:43:28: warning: comparison of distinct pointer types lacks a cast [enabled by default]
    fs/nfs/blocklayout/extents.c:47:13: note: in expansion of macro ‘do_div’
    nfs/blocklayout/extents.c:47:2: warning: right shift count >= width of type [enabled by default]
    fs/nfs/blocklayout/extents.c:47:2: warning: passing argument 1 of ‘__div64_32’ from incompatible pointer type [enabled by default]
    include/asm-generic/div64.h:35:17: note: expected ‘uint64_t *’ but argument is of type ‘sector_t *’
    extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);

    Signed-off-by: Helge Deller
    Signed-off-by: Trond Myklebust

    Helge Deller
     
  • Signed-off-by: Trond Myklebust

    Trond Myklebust