All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4
@ 2015-07-09 14:57 Paolo Bonzini
  2015-07-09 14:57 ` [Qemu-devel] [PULL 1/2] migration: fix RCU deadlock Paolo Bonzini
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Paolo Bonzini @ 2015-07-09 14:57 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit acf7b7fdf31fa76b53803790917c8acf23a2badb:

  Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2015-07-08 20:46:35 +0100)

are available in the git repository at:

  git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 4f4f6976d80614e2d81cea4385885876f24bb257:

  crypto: fix builtin qcrypto_cipher_free (2015-07-09 16:53:45 +0200)

----------------------------------------------------------------
Fixes for two bad bugs.  For 2.4-rc0.

----------------------------------------------------------------
Paolo Bonzini (2):
      migration: fix RCU deadlock
      crypto: fix builtin qcrypto_cipher_free

 crypto/cipher-builtin.c | 4 +++-
 migration/ram.c         | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)
-- 
2.4.3

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PULL 1/2] migration: fix RCU deadlock
  2015-07-09 14:57 [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4 Paolo Bonzini
@ 2015-07-09 14:57 ` Paolo Bonzini
  2015-07-09 14:57 ` [Qemu-devel] [PULL 2/2] crypto: fix builtin qcrypto_cipher_free Paolo Bonzini
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2015-07-09 14:57 UTC (permalink / raw)
  To: qemu-devel

migration_end calls synchronize_rcu() within a critical section.
That causes a deadlock; move the call after rcu_read_unlock().

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 migration/ram.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/migration/ram.c b/migration/ram.c
index c696814..1e58cd3 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1266,9 +1266,10 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
 
     flush_compressed_data(f);
     ram_control_after_iterate(f, RAM_CONTROL_FINISH);
-    migration_end();
 
     rcu_read_unlock();
+
+    migration_end();
     qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
 
     return 0;
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PULL 2/2] crypto: fix builtin qcrypto_cipher_free
  2015-07-09 14:57 [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4 Paolo Bonzini
  2015-07-09 14:57 ` [Qemu-devel] [PULL 1/2] migration: fix RCU deadlock Paolo Bonzini
@ 2015-07-09 14:57 ` Paolo Bonzini
  2015-07-09 15:04   ` Aurelien Jarno
  2015-07-09 15:19 ` [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4 Christian Borntraeger
  2015-07-09 16:28 ` Peter Maydell
  3 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2015-07-09 14:57 UTC (permalink / raw)
  To: qemu-devel

This was dereferencing a pointer before checking if it was NULL.

Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reported-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 crypto/cipher-builtin.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/crypto/cipher-builtin.c b/crypto/cipher-builtin.c
index c625cb4..912c1b9 100644
--- a/crypto/cipher-builtin.c
+++ b/crypto/cipher-builtin.c
@@ -354,11 +354,13 @@ QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg,
 
 void qcrypto_cipher_free(QCryptoCipher *cipher)
 {
-    QCryptoCipherBuiltin *ctxt = cipher->opaque;
+    QCryptoCipherBuiltin *ctxt;
+
     if (!cipher) {
         return;
     }
 
+    ctxt = cipher->opaque;
     ctxt->free(cipher);
     g_free(cipher);
 }
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PULL 2/2] crypto: fix builtin qcrypto_cipher_free
  2015-07-09 14:57 ` [Qemu-devel] [PULL 2/2] crypto: fix builtin qcrypto_cipher_free Paolo Bonzini
@ 2015-07-09 15:04   ` Aurelien Jarno
  0 siblings, 0 replies; 7+ messages in thread
From: Aurelien Jarno @ 2015-07-09 15:04 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On 2015-07-09 16:57, Paolo Bonzini wrote:
> This was dereferencing a pointer before checking if it was NULL.
> 
> Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
> Reported-by: Aurelien Jarno <aurelien@aurel32.net>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  crypto/cipher-builtin.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/crypto/cipher-builtin.c b/crypto/cipher-builtin.c
> index c625cb4..912c1b9 100644
> --- a/crypto/cipher-builtin.c
> +++ b/crypto/cipher-builtin.c
> @@ -354,11 +354,13 @@ QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg,
>  
>  void qcrypto_cipher_free(QCryptoCipher *cipher)
>  {
> -    QCryptoCipherBuiltin *ctxt = cipher->opaque;
> +    QCryptoCipherBuiltin *ctxt;
> +
>      if (!cipher) {
>          return;
>      }
>  
> +    ctxt = cipher->opaque;
>      ctxt->free(cipher);
>      g_free(cipher);
>  }

Thanks for the quick fix.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4
  2015-07-09 14:57 [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4 Paolo Bonzini
  2015-07-09 14:57 ` [Qemu-devel] [PULL 1/2] migration: fix RCU deadlock Paolo Bonzini
  2015-07-09 14:57 ` [Qemu-devel] [PULL 2/2] crypto: fix builtin qcrypto_cipher_free Paolo Bonzini
@ 2015-07-09 15:19 ` Christian Borntraeger
  2015-07-09 15:21   ` Peter Maydell
  2015-07-09 16:28 ` Peter Maydell
  3 siblings, 1 reply; 7+ messages in thread
From: Christian Borntraeger @ 2015-07-09 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Paolo Bonzini, qemu-devel

Am 09.07.2015 um 16:57 schrieb Paolo Bonzini:
> The following changes since commit acf7b7fdf31fa76b53803790917c8acf23a2badb:
> 
>   Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2015-07-08 20:46:35 +0100)
> 
> are available in the git repository at:
> 
>   git://github.com/bonzini/qemu.git tags/for-upstream
> 
> for you to fetch changes up to 4f4f6976d80614e2d81cea4385885876f24bb257:
> 
>   crypto: fix builtin qcrypto_cipher_free (2015-07-09 16:53:45 +0200)
> 
> ----------------------------------------------------------------
> Fixes for two bad bugs.  For 2.4-rc0.
> 
> ----------------------------------------------------------------
> Paolo Bonzini (2):
>       migration: fix RCU deadlock
>       crypto: fix builtin qcrypto_cipher_free
> 
>  crypto/cipher-builtin.c | 4 +++-
>  migration/ram.c         | 3 ++-
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 

CC Peter missing?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4
  2015-07-09 15:19 ` [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4 Christian Borntraeger
@ 2015-07-09 15:21   ` Peter Maydell
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Maydell @ 2015-07-09 15:21 UTC (permalink / raw)
  To: Christian Borntraeger; +Cc: Paolo Bonzini, QEMU Developers

On 9 July 2015 at 16:19, Christian Borntraeger <borntraeger@de.ibm.com> wrote:
> Am 09.07.2015 um 16:57 schrieb Paolo Bonzini:
>> The following changes since commit acf7b7fdf31fa76b53803790917c8acf23a2badb:
>>
>>   Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2015-07-08 20:46:35 +0100)
>>
>> are available in the git repository at:
>>
>>   git://github.com/bonzini/qemu.git tags/for-upstream
>>
>> for you to fetch changes up to 4f4f6976d80614e2d81cea4385885876f24bb257:
>>
>>   crypto: fix builtin qcrypto_cipher_free (2015-07-09 16:53:45 +0200)
>>
>> ----------------------------------------------------------------
>> Fixes for two bad bugs.  For 2.4-rc0.
>>
>> ----------------------------------------------------------------
>> Paolo Bonzini (2):
>>       migration: fix RCU deadlock
>>       crypto: fix builtin qcrypto_cipher_free
>>
>>  crypto/cipher-builtin.c | 4 +++-
>>  migration/ram.c         | 3 ++-
>>  2 files changed, 5 insertions(+), 2 deletions(-)
>>
>
> CC Peter missing?

I filter these via the magic words in the standard
pull request format, so I don't need to be cc'd...

-- PMM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4
  2015-07-09 14:57 [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4 Paolo Bonzini
                   ` (2 preceding siblings ...)
  2015-07-09 15:19 ` [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4 Christian Borntraeger
@ 2015-07-09 16:28 ` Peter Maydell
  3 siblings, 0 replies; 7+ messages in thread
From: Peter Maydell @ 2015-07-09 16:28 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers

On 9 July 2015 at 15:57, Paolo Bonzini <pbonzini@redhat.com> wrote:
> The following changes since commit acf7b7fdf31fa76b53803790917c8acf23a2badb:
>
>   Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2015-07-08 20:46:35 +0100)
>
> are available in the git repository at:
>
>   git://github.com/bonzini/qemu.git tags/for-upstream
>
> for you to fetch changes up to 4f4f6976d80614e2d81cea4385885876f24bb257:
>
>   crypto: fix builtin qcrypto_cipher_free (2015-07-09 16:53:45 +0200)
>
> ----------------------------------------------------------------
> Fixes for two bad bugs.  For 2.4-rc0.
>

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-07-09 16:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-09 14:57 [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4 Paolo Bonzini
2015-07-09 14:57 ` [Qemu-devel] [PULL 1/2] migration: fix RCU deadlock Paolo Bonzini
2015-07-09 14:57 ` [Qemu-devel] [PULL 2/2] crypto: fix builtin qcrypto_cipher_free Paolo Bonzini
2015-07-09 15:04   ` Aurelien Jarno
2015-07-09 15:19 ` [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4 Christian Borntraeger
2015-07-09 15:21   ` Peter Maydell
2015-07-09 16:28 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.