24 Jan, 2014

1 commit


09 Jan, 2014

1 commit


08 Jan, 2014

5 commits


07 Jan, 2014

7 commits

  • If failed after calling alloc_session but before init_session, nfsd will call __free_session to
    free se_slots in session. But, session->se_fchannel.maxreqs is not initialized (value is zero).
    So that, the memory malloced for slots will be lost in free_session_slots for maxreqs is zero.

    This path sets the information for channel in alloc_session after mallocing slots succeed,
    instead in init_session.

    Signed-off-by: Kinglong Mee
    Signed-off-by: J. Bruce Fields

    Kinglong Mee
     
  • We can achieve the same result with a cmpxchg(). This also fixes a
    potential race in use_gss_proxy(). The value of sn->use_gss_proxy could
    go from -1 to 1 just after we check it in use_gss_proxy() but before we
    acquire the spinlock. The procfile write would end up returning success
    but the value would flip to 0 soon afterward. With this method we not
    only avoid locking but the first "setter" always wins.

    Signed-off-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Jeff Layton
     
  • An nfsd thread can call use_gss_proxy and find it set to '1' but find
    gssp_clnt still NULL, so that when it attempts the upcall the result
    will be an unnecessary -EIO.

    So, ensure that gssp_clnt is created first, and set the use_gss_proxy
    variable only if that succeeds.

    Signed-off-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Jeff Layton
     
  • It doesn't make much sense to make reads from this procfile hang. As
    far as I can tell, only gssproxy itself will open this file and it
    never reads from it. Change it to just give the present setting of
    sn->use_gss_proxy without waiting for anything.

    Note that we do not want to call use_gss_proxy() in this codepath
    since an inopportune read of this file could cause it to be disabled
    prematurely.

    Cc: stable@vger.kernel.org
    Signed-off-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Jeff Layton
     
  • Signed-off-by: Kinglong Mee
    Signed-off-by: J. Bruce Fields

    Kinglong Mee
     
  • Signed-off-by: Kinglong Mee
    Signed-off-by: J. Bruce Fields

    Kinglong Mee
     
  • Without CONFIG_NFSD_V3, compile will get warning as,

    fs/nfsd/nfssvc.c: In function 'nfsd_svc':
    >> fs/nfsd/nfssvc.c:246:60: warning: array subscript is above array bounds [-Warray-bounds]
    return (nfsd_versions[2] != NULL) || (nfsd_versions[3] != NULL);
    ^

    Reported-by: kbuild test robot
    Signed-off-by: Kinglong Mee
    Signed-off-by: J. Bruce Fields

    Kinglong Mee
     

04 Jan, 2014

9 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

1 commit

  • 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