Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2979206imu; Sun, 9 Dec 2018 14:10:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/UW7ot6aoU2f4Pipy+P8byWbQqayvfrpbgakbrtU1G+CF3y9t/svNNwPEpC8E6YqXsozvvz X-Received: by 2002:a63:1b1f:: with SMTP id b31mr8773377pgb.66.1544393417855; Sun, 09 Dec 2018 14:10:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544393417; cv=none; d=google.com; s=arc-20160816; b=DBb1qmkuKqv90xlQs7APORLh3FvQ5zJVxClEtEVB/2VEEAytJA44LrnuF1KzUAkXvp pZEyK3ifk2QjAYc0ZTtRteCD9V0cwkWYZO1kv55j/C8MqUEp306mVr49U86q7fCCzZWH g4DkwA5OEVabfKS8XeqdLxL9emDpkq5lTha0C8BNnpKk89oInGX8oxbtOQ/mOpJsVLP5 QCpgKJjqUAKnEsz4iGDzXPPDVTq1wd+TtWo4xP8tN1R70h6YXYix4CLeZf3BqSTV2umi HWFRV7GfG19aF6Sa9AjJQG5PgPHC1lpE1NYTqBvqISnfh3YOg+CgHp5URmJRFMqZz4mJ HJlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=QQIxo+OZ0qmkKSiKEycvva35xkTFVmB6WAVOVnQ2K4Q=; b=JSfS/VLY0zRR5UdGE8fkeoLSiN8Ob7c24UXGoy39ls0CsV0m4HM9RO5AkZ9MXiNZ/M qsrpHWRs0sPxlX1xf0rbTK5Awww1aof7qeiOVgovb5QTgxBeoT74DLZwWIACjshTQn9/ d99+/F2RC8k0FPqxGw75O66HMhWw6rKtv98caGqcS17LNCY6dkfJB7kCQydIvjOucw8B WnHQfMqtQByG7/Fpk6arUeEHCEdyss+RTWPT5fX1L7sCit5bkweOh42tG09zPeoqhf0V PnyaVCGFQQPpjY3XZe92u7/NOM6eVYk/y6xJLtL4EijV/BmYbxJVfADwq+iufp4l+C5R c1ZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k62si8782862pfc.208.2018.12.09.14.10.02; Sun, 09 Dec 2018 14:10:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727767AbeLIWIp (ORCPT + 99 others); Sun, 9 Dec 2018 17:08:45 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:37352 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726424AbeLIWIm (ORCPT ); Sun, 9 Dec 2018 17:08:42 -0500 Received: from pub.yeoldevic.com ([81.174.156.145] helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gW73J-0002ib-FU; Sun, 09 Dec 2018 21:55:53 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gW72b-0003Ii-4L; Sun, 09 Dec 2018 21:55:09 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Mauricio Faria de Oliveira" , "Jens Axboe" , "Daniel J. Axtens" Date: Sun, 09 Dec 2018 21:50:33 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 082/328] partitions/aix: append null character to print data from disk In-Reply-To: X-SA-Exim-Connect-IP: 81.174.156.145 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.62-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Mauricio Faria de Oliveira commit d43fdae7bac2def8c4314b5a49822cb7f08a45f1 upstream. Even if properly initialized, the lvname array (i.e., strings) is read from disk, and might contain corrupt data (e.g., lack the null terminating character for strings). So, make sure the partition name string used in pr_warn() has the null terminating character. Fixes: 6ceea22bbbc8 ("partitions: add aix lvm partition support files") Suggested-by: Daniel J. Axtens Signed-off-by: Mauricio Faria de Oliveira Signed-off-by: Jens Axboe Signed-off-by: Ben Hutchings --- block/partitions/aix.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/block/partitions/aix.c +++ b/block/partitions/aix.c @@ -282,10 +282,14 @@ int aix_partition(struct parsed_partitio next_lp_ix += 1; } for (i = 0; i < state->limit; i += 1) - if (lvip[i].pps_found && !lvip[i].lv_is_contiguous) + if (lvip[i].pps_found && !lvip[i].lv_is_contiguous) { + char tmp[sizeof(n[i].name) + 1]; // null char + + snprintf(tmp, sizeof(tmp), "%s", n[i].name); pr_warn("partition %s (%u pp's found) is " "not contiguous\n", - n[i].name, lvip[i].pps_found); + tmp, lvip[i].pps_found); + } kfree(pvd); } kfree(n);