From patchwork Tue Aug 21 14:01:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauricio Faria de Oliveira X-Patchwork-Id: 960557 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vxPh6cV1z9s8f; Wed, 22 Aug 2018 02:45:44 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1fs9mk-00035Z-FX; Tue, 21 Aug 2018 16:45:38 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1fs7Ea-0002dx-2o for kernel-team@lists.ubuntu.com; Tue, 21 Aug 2018 14:02:12 +0000 Received: from mail-qt0-f198.google.com ([209.85.216.198]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fs7EZ-0006p7-PD for kernel-team@lists.ubuntu.com; Tue, 21 Aug 2018 14:02:11 +0000 Received: by mail-qt0-f198.google.com with SMTP id a15-v6so16537471qtj.15 for ; Tue, 21 Aug 2018 07:02:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=Gu9SeQhAGZvV3sk1gxr/H/uM9Q8S2+1c5vlOHsdwkgQ=; b=VXsvglektdOiLyBlgIN/E6du7a0vdL5Rax6EpQcQFHjssDI2yFsGmF9uibhvX4VZfS kDEOcawJal2Q4J8GBhIZPzF8r9lABcmDhMPAJWGxl7mWuIzYndmr3bhFCHrtEZQQcHj9 8wXTyNs4p3lzun+zXkwGZsXyMnxblbM5FDqo36PFVEmIGRiCyk4fJaJCSgmLpOMicUCV QhvSPQwaddms3BSet4pP397Z0qHaSxaCO+PogYSvYqEcyXqzh67CxnSyezalUQzan1Fo TCO0XKCMEBjqFDJxT20qb1nBq+g1NZE2g3eVX0SpstI2f9BzD7Rrd3XPJq+PI9XZxiUi RoWg== X-Gm-Message-State: AOUpUlH1g5ClN7T6d/x/S5x3UuB/L6PGqKPQDCyDrXO657oQN1lz7I9v bKukyGZsSn+zDyY2vs3a/kAUMwgaV3GtazI6wpxgp2wXNE6dD8dJ6xg799kpZxEvca8KndqN4G4 9MEcse64CZ9qEEh+LvUJKeji37Z9Sh7ERnJit7kqbZw== X-Received: by 2002:aed:2a6a:: with SMTP id k39-v6mr8203764qtf.102.1534860130431; Tue, 21 Aug 2018 07:02:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZyXVMW2+gD7MHQfYQQbq55aV7AaW593+Q3TMavazdwC7nM4ChzyUl/JvCpBoM+yMlvTOrF0A== X-Received: by 2002:aed:2a6a:: with SMTP id k39-v6mr8203744qtf.102.1534860130193; Tue, 21 Aug 2018 07:02:10 -0700 (PDT) Received: from localhost.localdomain ([179.159.57.206]) by smtp.gmail.com with ESMTPSA id e65-v6sm5286664qkf.39.2018.08.21.07.02.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Aug 2018 07:02:09 -0700 (PDT) From: Mauricio Faria de Oliveira To: kernel-team@lists.ubuntu.com Subject: [Cosmic][SRU Bionic/Xenial/Trusty][PATCH 0/2] Fixes for partition scan of corrupted AIX disk Date: Tue, 21 Aug 2018 11:01:51 -0300 Message-Id: <20180821140153.2848-1-mfo@canonical.com> X-Mailer: git-send-email 2.17.1 X-Mailman-Approved-At: Tue, 21 Aug 2018 16:45:26 +0000 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1787281 [Impact] * Users with disks/LUNs used for AIX operating system installations previously, which possibly undergone overwrites/corruption on the partition table, might hit kernel failures during partition scan of such disk/LUN, and possibly hang the system (seen with retries). * The Linux kernel should be robust to corrupted disk data, performing a better sanitization/checks and not failing. * The fix are a couple of simple logic changes to make the code of the AIX partition table parser more robust. [Test Case] * Run the partition scan on the (trimmed) disk image of the AIX lun. (It's not provided here since it contains customer data), with this command: $ sudo losetup --find --show --partscan rlv_grkgld.1mb * On failure, the command hangs, and messages like these are printed to the console, depending on the kernel version (see tests below) [ 270.506420] partition (null) (3 pp's found) is not contiguous [ 270.597428] BUG: unable to handle kernel paging request at 0000000000001000 [ 270.599525] IP: [] strnlen+0xd/0x40 * On success, the command prints a loop device name, for example: /dev/loop0 [Regression Potential] * Low. Both changes are simple improvements in logic. * This affects users which mount disks/LUNs from the AIX OS; it should only change behavior for users which relied on a uninitialized variables to work correctly during partition scan of those disks/LUNs which should be rare as the code is likely to fail as we observe in this scenario. * This has been tested on Cosmic, Bionic, Xenial, and Trusty. Mauricio Faria de Oliveira (2): partitions/aix: fix usage of uninitialized lv_info and lvname structures partitions/aix: append null character to print data from disk block/partitions/aix.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) Acked-by: Seth Forshee Acked-by: Stefan Bader