From patchwork Sun Oct 14 04:48:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Schmitz X-Patchwork-Id: 10640511 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 149F6933 for ; Sun, 14 Oct 2018 04:48:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E87292A42A for ; Sun, 14 Oct 2018 04:48:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D62B42A42F; Sun, 14 Oct 2018 04:48:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CECA2A41F for ; Sun, 14 Oct 2018 04:48:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726012AbeJNM2W (ORCPT ); Sun, 14 Oct 2018 08:28:22 -0400 Received: from mail-pl1-f180.google.com ([209.85.214.180]:36384 "EHLO mail-pl1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbeJNM2W (ORCPT ); Sun, 14 Oct 2018 08:28:22 -0400 Received: by mail-pl1-f180.google.com with SMTP id y11-v6so7705773plt.3; Sat, 13 Oct 2018 21:48:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=tOcZykztiWMgUEHCKGAbHY9ykgTgP03U4rvSxMA7sUs=; b=ORR/uVF1WYVA0vUk3B7IP80lBss4lzdjZixozo3kt5sqU+YemrhKTvZf6GshT20/1i ZuT3RCiiZ/SMXthRlZ4xZV0loM3oFu9DAs7d+HilE8Jre01pF77LA//pXLg6rdoaWpG3 EuYXtqixpJHphCLgFncOxf/biq5g9GNRi+KbYTgOK/qUJstcr45Vs+u936An1hEpsWle G4l3Jd/duB9VGnY9qxngJoPIR7G+bU7npCZ/dlkxmmrZ19EbtRSHY3NOhLtNQqnfAdpV QtTLxZsDVk9GjkWa5UoFMDNU8lqjBxDetkRv9RhnL2F2C89GQJ59uPC0bPIyrjVft6ZA 6Kmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=tOcZykztiWMgUEHCKGAbHY9ykgTgP03U4rvSxMA7sUs=; b=LzH2STM8AO3ivCfuHwXJUkpBeC+FRR5vmdiY+Lky+BLK7ZeENJTaUCB/L27swQo81q JDyHipZDbPfN65p3Q5erQC+rgDu/ExCt+H3SFTYJy341mc3RjY+WokmAh4lVRWL3z+7l YhYsMmbIlPB+cHOR94gA+lLv27FpHHtaOWcqMb1M8DdGgKe52TMkPD4nj+R/lNQOLt+4 TtxSvrZwA1AqYjnQ0la9814iqw/7zYBw9rlr5PuJ945xJgDgKDqJ1LAVrguz0HyqYTjt HzTZBx+ZJ6A4ZzGZyM/BxcLAp9KD5Wj/a+AI7ujcbXyTbPK0cLInzkodSbYkKKyvyBXG OxIQ== X-Gm-Message-State: ABuFfogB4My1yS7E9NJSruZpUUbFu6RwTXzzxVs3plhY5zTOHilbhqv9 szY8p3Rzi0fiPpRHUKKbnETPFmf7 X-Google-Smtp-Source: ACcGV60nIQP+W7rHFaSCagbc5WiBo6Ewwx5AbaFnEsZ/k0UKFNLbkyV/OgMlAsLRIT687/n4+tpO+g== X-Received: by 2002:a17:902:7d98:: with SMTP id a24-v6mr11998544plm.271.1539492522101; Sat, 13 Oct 2018 21:48:42 -0700 (PDT) Received: from xplor.waratah.dyndns.org (122-62-216-69-adsl.sparkbb.co.nz. [122.62.216.69]) by smtp.gmail.com with ESMTPSA id d7-v6sm9645610pfm.23.2018.10.13.21.48.40 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 13 Oct 2018 21:48:41 -0700 (PDT) Received: by xplor.waratah.dyndns.org (Postfix, from userid 1000) id 1598B360081; Sun, 14 Oct 2018 17:48:37 +1300 (NZDT) From: Michael Schmitz To: linux-block@vger.kernel.org, axboe@kernel.dk Cc: linux-m68k@vger.kernel.org, geert@linux-m68k.org Subject: [PATCH v6 0/2] Date: Sun, 14 Oct 2018 17:48:33 +1300 Message-Id: <1539492515-1782-1-git-send-email-schmitzmic@gmail.com> X-Mailer: git-send-email 1.7.0.4 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP and yet another new version of the Amiga RDB partition table patch. I've split off the part fixing the incorrect use of signed int for partition start address and size as separate patch. It does fix the bug that Martin Steigerwald reported six years ago for a 2 TB disk. I have tested this patch with the identical RDB partition data that Martin saw the bug with. I have incorporated Andreas' feedback on proper use of casts to avoid integer overflow in this version. The simple fix still leaves ample room for overflows in calculating start address and size of a RDB partition, though such overflows should only be seen in rather unusual cases. To address these potential overflows, checks are added in the second patch of this series. Again, misuse of casts have been corrected, and yet another (highly unlikely) potential 32 bit multiplication overflow caused by use of signed int instead of sector (spotted by Geert Uytterhoeven) has been fixed and a check has been added in this version. I've added Geert's Reviewed-by tag to patch 1,as there were no further changes to that patch. Cheers, Michael