1. 13 11月, 2007 38 次提交
  2. 12 11月, 2007 2 次提交
    • J
      Fix memory leak in discard case of sctp_sf_abort_violation() · 9abed245
      Jesper Juhl 提交于
      In net/sctp/sm_statefuns.c::sctp_sf_abort_violation() we may leak
      the storage allocated for 'abort' by returning from the function
      without using or freeing it. This happens in case
      "sctp_auth_recv_cid(SCTP_CID_ABORT, asoc)" is true and we jump to
      the 'discard' label.
      Spotted by the Coverity checker.
      
      The simple fix is to simply move the creation of the "abort chunk"
      to after the possible jump to the 'discard' label. This way we don't
      even have to allocate the memory at all in the problem case.
      Signed-off-by: NJesper Juhl <jesper.juhl@gmail.com>
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      9abed245
    • R
      virtio: Force use of power-of-two for descriptor ring sizes · 42b36cc0
      Rusty Russell 提交于
      The virtio descriptor rings of size N-1 were nicely set up to be
      aligned to an N-byte boundary.  But as Anthony Liguori points out, the
      free-running indices used by virtio require that the sizes be a power
      of 2, otherwise we get problems on wrap (demonstrated with lguest).
      
      So we replace the clever "2^n-1" scheme with a simple "align to page
      boundary" scheme: this means that all virtio rings take at least two
      pages, but it's safer than guessing cache alignment.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      42b36cc0