1. 05 2月, 2013 1 次提交
  2. 11 10月, 2012 1 次提交
    • P
      tpm: Propagate error from tpm_transmit to fix a timeout hang · abce9ac2
      Peter Huewe 提交于
      tpm_write calls tpm_transmit without checking the return value and
      assigns the return value unconditionally to chip->pending_data, even if
      it's an error value.
      This causes three bugs.
      
      So if we write to /dev/tpm0 with a tpm_param_size bigger than
      TPM_BUFSIZE=0x1000 (e.g. 0x100a)
      and a bufsize also bigger than TPM_BUFSIZE (e.g. 0x100a)
      tpm_transmit returns -E2BIG which is assigned to chip->pending_data as
      -7, but tpm_write returns that TPM_BUFSIZE bytes have been successfully
      been written to the TPM, altough this is not true (bug #1).
      
      As we did write more than than TPM_BUFSIZE bytes but tpm_write reports
      that only TPM_BUFSIZE bytes have been written the vfs tries to write
      the remaining bytes (in this case 10 bytes) to the tpm device driver via
      tpm_write which then blocks at
      
       /* cannot perform a write until the read has cleared
       either via tpm_read or a user_read_timer timeout */
       while (atomic_read(&chip->data_pending) != 0)
      	 msleep(TPM_TIMEOUT);
      
      for 60 seconds, since data_pending is -7 and nobody is able to
      read it (since tpm_read luckily checks if data_pending is greater than
      0) (#bug 2).
      
      After that the remaining bytes are written to the TPM which are
      interpreted by the tpm as a normal command. (bug #3)
      So if the last bytes of the command stream happen to be a e.g.
      tpm_force_clear this gets accidentally sent to the TPM.
      
      This patch fixes all three bugs, by propagating the error code of
      tpm_write and returning -E2BIG if the input buffer is too big,
      since the response from the tpm for a truncated value is bogus anyway.
      Moreover it returns -EBUSY to userspace if there is a response ready to be
      read.
      Signed-off-by: NPeter Huewe <peter.huewe@infineon.com>
      Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
      abce9ac2
  3. 10 10月, 2012 1 次提交
  4. 05 9月, 2012 1 次提交
  5. 23 8月, 2012 4 次提交
  6. 21 8月, 2012 1 次提交
    • T
      workqueue: deprecate flush[_delayed]_work_sync() · 43829731
      Tejun Heo 提交于
      flush[_delayed]_work_sync() are now spurious.  Mark them deprecated
      and convert all users to flush[_delayed]_work().
      
      If you're cc'd and wondering what's going on: Now all workqueues are
      non-reentrant and the regular flushes guarantee that the work item is
      not pending or running on any CPU on return, so there's no reason to
      use the sync flushes at all and they're going away.
      
      This patch doesn't make any functional difference.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Mattia Dongili <malattia@linux.it>
      Cc: Kent Yoder <key@linux.vnet.ibm.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Karsten Keil <isdn@linux-pingi.de>
      Cc: Bryan Wu <bryan.wu@canonical.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Alasdair Kergon <agk@redhat.com>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: linux-wireless@vger.kernel.org
      Cc: Anton Vorontsov <cbou@mail.ru>
      Cc: Sangbeom Kim <sbkim73@samsung.com>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Eric Van Hensbergen <ericvh@gmail.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Petr Vandrovec <petr@vandrovec.name>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Avi Kivity <avi@redhat.com> 
      43829731
  7. 11 7月, 2012 1 次提交
  8. 13 6月, 2012 3 次提交
  9. 15 2月, 2012 1 次提交
  10. 19 1月, 2012 1 次提交
  11. 16 11月, 2011 5 次提交
  12. 23 9月, 2011 2 次提交
    • P
      TPM: Zero buffer after copying to userspace · 3321c07a
      Peter Huewe 提交于
      Since the buffer might contain security related data it might be a good idea to
      zero the buffer after we have copied it to userspace.
      
      This got assigned CVE-2011-1162.
      Signed-off-by: NRajiv Andrade <srajiv@linux.vnet.ibm.com>
      Cc: Stable Kernel <stable@kernel.org>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      3321c07a
    • P
      TPM: Call tpm_transmit with correct size · 6b07d30a
      Peter Huewe 提交于
      This patch changes the call of tpm_transmit by supplying the size of the
      userspace buffer instead of TPM_BUFSIZE.
      
      This got assigned CVE-2011-1161.
      
      [The first hunk didn't make sense given one could expect
       way less data than TPM_BUFSIZE, so added tpm_transmit boundary
       check over bufsiz instead
       The last parameter of tpm_transmit() reflects the amount
       of data expected from the device, and not the buffer size
       being supplied to it. It isn't ideal to parse it directly,
       so we just set it to the maximum the input buffer can handle
       and let the userspace API to do such job.]
      Signed-off-by: NRajiv Andrade <srajiv@linux.vnet.ibm.com>
      Cc: Stable Kernel <stable@kernel.org>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      6b07d30a
  13. 24 8月, 2011 1 次提交
  14. 13 7月, 2011 8 次提交
  15. 30 3月, 2011 1 次提交
  16. 02 3月, 2011 1 次提交
    • L
      Revert "TPM: Long default timeout fix" · 8d1dc20e
      Linus Torvalds 提交于
      This reverts commit c4ff4b82.
      
      Ted Ts'o reports:
      
       "TPM is working for me so I can log into employer's network in 2.6.37.
        It broke when I tried 2.6.38-rc6, with the following relevant lines
        from my dmesg:
      
        [   11.081627] tpm_tis 00:0b: 1.2 TPM (device-id 0x0, rev-id 78)
        [   25.734114] tpm_tis 00:0b: Operation Timed out
        [   78.040949] tpm_tis 00:0b: Operation Timed out
      
        This caused me to get suspicious, especially since the _other_ TPM
        commit in 2.6.38 had already been reverted, so I tried reverting
        commit c4ff4b82: "TPM: Long default timeout fix".  With this commit
        reverted, my TPM on my Lenovo T410 is once again working."
      Requested-and-tested-by: NTheodore Ts'o <tytso@mit.edu>
      Acked-by: NRajiv Andrade <srajiv@linux.vnet.ibm.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8d1dc20e
  17. 21 2月, 2011 1 次提交
    • L
      Revert "tpm_tis: Use timeouts returned from TPM" · e5871372
      Linus Torvalds 提交于
      This reverts commit 9b29050f.
      
      It has caused hibernate regressions, for example Juri Sladby's report:
      
        "I'm unable to hibernate 2.6.37.1 unless I rmmod tpm_tis:
         [10974.074587] Suspending console(s) (use no_console_suspend to debug)
         [10974.103073] tpm_tis 00:0c: Operation Timed out
         [10974.103089] legacy_suspend(): pnp_bus_suspend+0x0/0xa0 returns -62
         [10974.103095] PM: Device 00:0c failed to freeze: error -62"
      
      and Rafael points out that some of the new conditionals in that commit
      seem to make no sense.  This commit needs more work and testing, let's
      revert it for now.
      Reported-by: NNorbert Preining <preining@logic.at>
      Reported-and-requested-by: NJiri Slaby <jirislaby@gmail.com>
      Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
      Cc: Guillaume Chazarain <guichaz@gmail.com>
      Cc: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
      Acked-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e5871372
  18. 11 2月, 2011 1 次提交
  19. 24 1月, 2011 1 次提交
  20. 24 12月, 2010 1 次提交
  21. 29 11月, 2010 2 次提交
  22. 21 10月, 2010 1 次提交