1. 31 5月, 2014 8 次提交
  2. 30 10月, 2013 2 次提交
    • J
      nfsd: -EINVAL on invalid anonuid/gid instead of silent failure · 6f6cc320
      J. Bruce Fields 提交于
      If we're going to refuse to accept these it would be polite of us to at
      least say so....
      
      This introduces a slight complication since we need to grandfather in
      exportfs's ill-advised use of -1 uid and gid on its test_export.
      
      If it turns out there are other users passing down -1 we may need to
      do something else.
      
      Best might be to drop the checks entirely, but I'm not sure if other
      parts of the kernel might assume that a task can't run as uid or gid -1.
      
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      6f6cc320
    • J
      nfsd: return better errors to exportfs · 427d6c66
      J. Bruce Fields 提交于
      Someone noticed exportfs happily accepted exports that would later be
      rejected when mountd tried to give them to the kernel.  Fix this.
      
      This is a regression from 4c1e1b34
      "nfsd: Store ex_anon_uid and ex_anon_gid as kuids and kgids".
      
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: stable@vger.kernel.org
      Reported-by: NYin.JianHong <jiyin@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      427d6c66
  3. 15 2月, 2013 2 次提交
  4. 13 2月, 2013 1 次提交
  5. 04 2月, 2013 1 次提交
    • J
      nfsd: initialize the exp->ex_uuid field in svc_export_init · 2eeb9b2a
      Jeff Layton 提交于
      commit 885c91f7 in Bruce's tree was causing oopses for me:
      
      general protection fault: 0000 [#1] SMP
      Modules linked in: nfsd(OF) nfs_acl(OF) auth_rpcgss(OF) lockd(OF) sunrpc(OF) kvm_amd kvm microcode i2c_piix4 virtio_net virtio_balloon cirrus drm_kms_helper ttm drm virtio_blk i2c_core
      CPU 0
      Pid: 564, comm: exportfs Tainted: GF          O 3.8.0-0.rc5.git2.1.fc19.x86_64 #1 Bochs Bochs
      RIP: 0010:[<ffffffff811b1509>]  [<ffffffff811b1509>] kfree+0x49/0x280
      RSP: 0018:ffff88007a3d7c50  EFLAGS: 00010203
      RAX: 01adaf8dadadad80 RBX: 6b6b6b6b6b6b6b6b RCX: 0000000000000001
      RDX: ffffffff7fffffff RSI: 0000000000000000 RDI: 6b6b6b6b6b6b6b6b
      RBP: ffff88007a3d7c80 R08: 6b6b6b6b6b6b6b6b R09: 0000000000000000
      R10: 0000000000000018 R11: 0000000000000000 R12: ffff88006a117b50
      R13: ffffffffa01a589c R14: ffff8800631b0f50 R15: 01ad998dadadad80
      FS:  00007fcaa3616740(0000) GS:ffff88007fc00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 00007f5d84b6fdd8 CR3: 0000000064db4000 CR4: 00000000000006f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process exportfs (pid: 564, threadinfo ffff88007a3d6000, task ffff88006af28000)
      Stack:
       ffff88007a3d7c80 ffff88006a117b68 ffff88006a117b50 0000000000000000
       ffff8800631b0f50 ffff88006a117b50 ffff88007a3d7ca0 ffffffffa01a589c
       ffff880036be1148 ffff88007a3d7cf8 ffff88007a3d7e28 ffffffffa01a6a98
      Call Trace:
       [<ffffffffa01a589c>] svc_export_put+0x5c/0x70 [nfsd]
       [<ffffffffa01a6a98>] svc_export_parse+0x328/0x7e0 [nfsd]
       [<ffffffffa016f1c7>] cache_do_downcall+0x57/0x70 [sunrpc]
       [<ffffffffa016f25e>] cache_downcall+0x7e/0x100 [sunrpc]
       [<ffffffffa016f338>] cache_write_procfs+0x58/0x90 [sunrpc]
       [<ffffffffa016f2e0>] ? cache_downcall+0x100/0x100 [sunrpc]
       [<ffffffff8123b0e5>] proc_reg_write+0x75/0xb0
       [<ffffffff811ccecf>] vfs_write+0x9f/0x170
       [<ffffffff811cd089>] sys_write+0x49/0xa0
       [<ffffffff816e0919>] system_call_fastpath+0x16/0x1b
      Code: 66 66 66 90 48 83 fb 10 0f 86 c3 00 00 00 48 89 df 49 bf 00 00 00 00 00 ea ff ff e8 f2 12 ea ff 48 c1 e8 0c 48 c1 e0 06 49 01 c7 <49> 8b 07 f6 c4 80 0f 85 1d 02 00 00 49 8b 07 a8 80 0f 84 ee 01
      RIP  [<ffffffff811b1509>] kfree+0x49/0x280
       RSP <ffff88007a3d7c50>
      
      I think Majianpeng's patch is correct, but incomplete. In order for it
      to be safe to free the ex_uuid unconditionally in svc_export_put, we
      need to make sure it's initialized to NULL in the init routine.
      
      Cc: majianpeng <majianpeng@gmail.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      2eeb9b2a
  6. 30 1月, 2013 1 次提交
  7. 28 7月, 2012 1 次提交
  8. 25 7月, 2012 1 次提交
  9. 01 6月, 2012 2 次提交
  10. 12 4月, 2012 10 次提交
  11. 04 2月, 2012 1 次提交
  12. 08 12月, 2011 1 次提交
  13. 07 12月, 2011 1 次提交
    • S
      nfsd: Fix oops when parsing a 0 length export · b2ea70af
      Sasha Levin 提交于
      expkey_parse() oopses when handling a 0 length export. This is easily
      triggerable from usermode by writing 0 bytes into
      '/proc/[proc id]/net/rpc/nfsd.fh/channel'.
      
      Below is the log:
      
      [ 1402.286893] BUG: unable to handle kernel paging request at ffff880077c49fff
      [ 1402.287632] IP: [<ffffffff812b4b99>] expkey_parse+0x28/0x2e1
      [ 1402.287632] PGD 2206063 PUD 1fdfd067 PMD 1ffbc067 PTE 8000000077c49160
      [ 1402.287632] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
      [ 1402.287632] CPU 1
      [ 1402.287632] Pid: 20198, comm: trinity Not tainted 3.2.0-rc2-sasha-00058-gc65cd37 #6
      [ 1402.287632] RIP: 0010:[<ffffffff812b4b99>]  [<ffffffff812b4b99>] expkey_parse+0x28/0x2e1
      [ 1402.287632] RSP: 0018:ffff880077f0fd68  EFLAGS: 00010292
      [ 1402.287632] RAX: ffff880077c49fff RBX: 00000000ffffffea RCX: 0000000001043400
      [ 1402.287632] RDX: 0000000000000000 RSI: ffff880077c4a000 RDI: ffffffff82283de0
      [ 1402.287632] RBP: ffff880077f0fe18 R08: 0000000000000001 R09: ffff880000000000
      [ 1402.287632] R10: 0000000000000000 R11: 0000000000000001 R12: ffff880077c4a000
      [ 1402.287632] R13: ffffffff82283de0 R14: 0000000001043400 R15: ffffffff82283de0
      [ 1402.287632] FS:  00007f25fec3f700(0000) GS:ffff88007d400000(0000) knlGS:0000000000000000
      [ 1402.287632] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      [ 1402.287632] CR2: ffff880077c49fff CR3: 0000000077e1d000 CR4: 00000000000406e0
      [ 1402.287632] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [ 1402.287632] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [ 1402.287632] Process trinity (pid: 20198, threadinfo ffff880077f0e000, task ffff880077db17b0)
      [ 1402.287632] Stack:
      [ 1402.287632]  ffff880077db17b0 ffff880077c4a000 ffff880077f0fdb8 ffffffff810b411e
      [ 1402.287632]  ffff880000000000 ffff880077db17b0 ffff880077c4a000 ffffffff82283de0
      [ 1402.287632]  0000000001043400 ffffffff82283de0 ffff880077f0fde8 ffffffff81111f63
      [ 1402.287632] Call Trace:
      [ 1402.287632]  [<ffffffff810b411e>] ? lock_release+0x1af/0x1bc
      [ 1402.287632]  [<ffffffff81111f63>] ? might_fault+0x97/0x9e
      [ 1402.287632]  [<ffffffff81111f1a>] ? might_fault+0x4e/0x9e
      [ 1402.287632]  [<ffffffff81a8bcf2>] cache_do_downcall+0x3e/0x4f
      [ 1402.287632]  [<ffffffff81a8c950>] cache_write.clone.16+0xbb/0x130
      [ 1402.287632]  [<ffffffff81a8c9df>] ? cache_write_pipefs+0x1a/0x1a
      [ 1402.287632]  [<ffffffff81a8c9f8>] cache_write_procfs+0x19/0x1b
      [ 1402.287632]  [<ffffffff8118dc54>] proc_reg_write+0x8e/0xad
      [ 1402.287632]  [<ffffffff8113fe81>] vfs_write+0xaa/0xfd
      [ 1402.287632]  [<ffffffff8114142d>] ? fget_light+0x35/0x9e
      [ 1402.287632]  [<ffffffff8113ff8b>] sys_write+0x48/0x6f
      [ 1402.287632]  [<ffffffff81bbdb92>] system_call_fastpath+0x16/0x1b
      [ 1402.287632] Code: c0 c9 c3 55 48 63 d2 48 89 e5 48 8d 44 32 ff 41 57 41 56 41 55 41 54 53 bb ea ff ff ff 48 81 ec 88 00 00 00 48 89 b5 58 ff ff ff
      [ 1402.287632]  38 0a 0f 85 89 02 00 00 c6 00 00 48 8b 3d 44 4a e5 01 48 85
      [ 1402.287632] RIP  [<ffffffff812b4b99>] expkey_parse+0x28/0x2e1
      [ 1402.287632]  RSP <ffff880077f0fd68>
      [ 1402.287632] CR2: ffff880077c49fff
      [ 1402.287632] ---[ end trace 368ef53ff773a5e3 ]---
      
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Neil Brown <neilb@suse.de>
      Cc: linux-nfs@vger.kernel.org
      Cc: stable@kernel.org
      Signed-off-by: NSasha Levin <levinsasha928@gmail.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      b2ea70af
  14. 14 9月, 2011 2 次提交
  15. 31 8月, 2011 1 次提交
  16. 16 7月, 2011 1 次提交
    • N
      nfsd: Remove deprecated nfsctl system call and related code. · 49b28684
      NeilBrown 提交于
      As promised in feature-removal-schedule.txt it is time to
      remove the nfsctl system call.
      
      Userspace has perferred to not use this call throughout 2.6 and it has been
      excluded in the default configuration since 2.6.36 (9 months ago).
      
      So this patch removes all the code that was being compiled out.
      
      There are still references to sys_nfsctl in various arch systemcall tables
      and related code.  These should be cleaned out too, probably in the next
      merge window.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      49b28684
  17. 30 4月, 2011 1 次提交
    • J
      nfsd4: fix wrongsec handling for PUTFH + op cases · 68d93184
      J. Bruce Fields 提交于
      When PUTFH is followed by an operation that uses the filehandle, and
      when the current client is using a security flavor that is inconsistent
      with the given filehandle, we have a choice: we can return WRONGSEC
      either when the current filehandle is set using the PUTFH, or when the
      filehandle is first used by the following operation.
      
      Follow the recommendations of RFC 5661 in making this choice.
      
      (Our current behavior prevented the client from doing security
      negotiation by returning WRONGSEC on PUTFH+SECINFO_NO_NAME.)
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      68d93184
  18. 08 3月, 2011 1 次提交
  19. 14 1月, 2011 1 次提交
    • J
      nfsd: don't support msnfs export option · 9ce137ee
      J. Bruce Fields 提交于
      We've long had these pointless #ifdef MSNFS's sprinkled throughout the
      code--pointless because MSNFS is always defined (and we give no config
      option to make that easy to change).  So we could just remove the
      ifdef's and compile the resulting code unconditionally.
      
      But as long as we're there: why not just rip out this code entirely?
      The only purpose is to implement the "msnfs" export option which turns
      on Windows-like behavior in some cases, and:
      
      	- the export option isn't documented anywhere;
      	- the userland utilities (which would need to be able to parse
      	  "msnfs" in an export file) don't support it;
      	- I don't know how to maintain this, as I don't know what the
      	  proper behavior is; and
      	- google shows no evidence that anyone has ever used this.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      9ce137ee
  20. 27 9月, 2010 1 次提交