1. 01 Sep, 2008 2 commits
    • Cyrill Gorcunov's avatar
      sunrpc: fix possible overrun on read of /proc/sys/sunrpc/transports · 27df6f25
      Cyrill Gorcunov authored
      Vegard Nossum reported
      ----------------------
      > I noticed that something weird is going on with /proc/sys/sunrpc/transports.
      > This file is generated in net/sunrpc/sysctl.c, function proc_do_xprt(). When
      > I "cat" this file, I get the expected output:
      >    $ cat /proc/sys/sunrpc/transports
      >    tcp 1048576
      >    udp 32768
      
      > But I think that it does not check the length of the buffer supplied by
      > userspace to read(). With my original program, I found that the stack was
      > being overwritten by the characters above, even when the length given to
      > read() was just 1.
      
      David Wagner added (among other things) that copy_to_user could be
      probably used here.
      
      Ingo Oeser suggested to use simple_read_from_buffer() here.
      
      The conclusion is that proc_do_xprt doesn't check for userside buffer
      size indeed so fix this by using Ingo's suggestion.
      Reported-by: default avatarVegard Nossum <vegard.nossum@gmail.com>
      Signed-off-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
      CC: Ingo Oeser <ioe-lkml@rameria.de>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Chuck Lever <chuck.lever@oracle.com>
      Cc: Greg Banks <gnb@sgi.com>
      Cc: Tom Tucker <tom@opengridcomputing.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      27df6f25
    • Andy Adamson's avatar
      nfsd: fix compound state allocation error handling · c228c24b
      Andy Adamson authored
      Move the cstate_alloc call so that if it fails, the response is setup to
      encode the NFS error. The out label now means that the
      nfsd4_compound_state has not been allocated.
      Signed-off-by: default avatarAndy Adamson <andros@netapp.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      c228c24b
  2. 13 Aug, 2008 2 commits
    • Tom Tucker's avatar
      svcrdma: Fix race between svc_rdma_recvfrom thread and the dto_tasklet · 24b8b447
      Tom Tucker authored
      RDMA_READ completions are kept on a separate queue from the general
      I/O request queue. Since a separate lock is used to protect the RDMA_READ
      completion queue, a race exists between the dto_tasklet and the
      svc_rdma_recvfrom thread where the dto_tasklet sets the XPT_DATA
      bit and adds I/O to the read-completion queue. Concurrently, the
      recvfrom thread checks the generic queue, finds it empty and resets
      the XPT_DATA bit. A subsequent svc_xprt_enqueue will fail to enqueue
      the transport for I/O and cause the transport to "stall".
      
      The fix is to protect both lists with the same lock and set the XPT_DATA
      bit with this lock held.
      Signed-off-by: default avatarTom Tucker <tom@opengridcomputing.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      24b8b447
    • Linus Torvalds's avatar
      Linux 2.6.27-rc3 · 30a2f3c6
      Linus Torvalds authored
      30a2f3c6
  3. 12 Aug, 2008 36 commits