Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 May 2009 13:23:46 +0000 (UTC)
From:      Rafal Jaworowski <raj@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/opencrypto cryptodev.c
Message-ID:  <200905231323.n4NDNtZO040360@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
raj         2009-05-23 13:23:46 UTC

  FreeBSD src repository

  Modified files:
    sys/opencrypto       cryptodev.c 
  Log:
  SVN rev 192636 on 2009-05-23 13:23:46Z by raj
  
  Fix cryptodev UIO creation.
  
  Cryptodev uses UIO structure do get data from userspace and pass it to
  cryptographic engines. Initially UIO size is equal to size of data passed to
  engine, but if UIO is prepared for hash calculation an additional small space
  is created to hold result of operation.
  
  While creating space for the result, UIO I/O vector size is correctly
  extended, but uio_resid field in UIO structure is not modified.
  
  As bus_dma code uses uio_resid field to determine size of UIO DMA mapping,
  resulting mapping hasn't correct size. This leads to a crash if all the
  following conditions are met:
  
       1. Hardware cryptographic accelerator writes result of hash operation
          using DMA.
       2. Size of input data is less or equal than (n * PAGE_SIZE),
       3. Size of input data plus size of hash result is grather than
          (n * PAGE_SIZE, where n is the same as in point 2.
  
  This patch fixes this problem by adding size of the extenstion to uio_resid
  field in UIO structure.
  
  Submitted by:   Piotr Ziecik kosmo ! semihalf dot com
  Reviewed by:    philip
  Obtained from:  Semihalf
  
  Revision  Changes    Path
  1.40      +3 -1      src/sys/opencrypto/cryptodev.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905231323.n4NDNtZO040360>