From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752651AbbDULcQ (ORCPT ); Tue, 21 Apr 2015 07:32:16 -0400 Received: from forward-corp1m.cmail.yandex.net ([5.255.216.100]:49603 "EHLO forward-corp1m.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750987AbbDULcN (ORCPT ); Tue, 21 Apr 2015 07:32:13 -0400 Authentication-Results: smtpcorp1m.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Subject: [PATCH] pstore: do not use message compression without lock From: Konstantin Khlebnikov To: Tony Luck , Anton Vorontsov , linux-kernel@vger.kernel.org, Kees Cook , Colin Cross Date: Tue, 21 Apr 2015 14:32:09 +0300 Message-ID: <20150421113209.24606.17013.stgit@buzz> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pstore_compress() uses static stream buffer for zlib-deflate which easily crashes when several concurrent threads use one shared state. Signed-off-by: Konstantin Khlebnikov --- fs/pstore/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index c4c9a10c5760..de525ec0b490 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -299,7 +299,7 @@ static void pstore_dump(struct kmsg_dumper *dumper, bool compressed; size_t total_len; - if (big_oops_buf) { + if (big_oops_buf && is_locked) { dst = big_oops_buf; hsize = sprintf(dst, "%s#%d Part%u\n", why, oopscount, part);