From patchwork Fri Oct 12 00:26:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Schmitz X-Patchwork-Id: 10637671 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 9FFEE1869 for ; Fri, 12 Oct 2018 00:27:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D3822C393 for ; Fri, 12 Oct 2018 00:27:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 807B62C39C; Fri, 12 Oct 2018 00:27:09 +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 1FF2E2C393 for ; Fri, 12 Oct 2018 00:27:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726061AbeJLH4t (ORCPT ); Fri, 12 Oct 2018 03:56:49 -0400 Received: from mail-pf1-f171.google.com ([209.85.210.171]:45507 "EHLO mail-pf1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbeJLH4s (ORCPT ); Fri, 12 Oct 2018 03:56:48 -0400 Received: by mail-pf1-f171.google.com with SMTP id u12-v6so5225400pfn.12; Thu, 11 Oct 2018 17:27:07 -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=bMuH5JLj+IOZSlI+j9KB4Nq7CfiDAFlZ4DqCH53l/ms=; b=ldrXehT9WveUk8wVnQkX6gWLGv8gyfEcmKEYAVg/6HyBxmeXaJ1o3n6uDLaSCZjpa5 il65iIyG6xCBKN8wrg91QjsxSL849Tg0pU9koVPt5MZzlVY0peIJQwfQw9PHRk6vmgj5 tsROe5/WXlDMtjYdzNwZxan/tzLY+3GZu+QzqwQHK/3tqfqygJEzRVuoFk/e9oyHT2vH xgM+Y+WqhcWGFhYIrDzk3JtNmns8Yvhf9M5/0WD+Mgw/NBCJ6fHhyfVMOFOLcjiKNZJ4 aBYSZhEvT+30Br8EqjL1NmfPWsvwh3MupQYL0CtfV8j/XVzCPpVhY1wjwhzSbXi2AuSM AJRQ== 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=bMuH5JLj+IOZSlI+j9KB4Nq7CfiDAFlZ4DqCH53l/ms=; b=DOd58SEYmSxOa9JeLewdmSsGQxVwAFRDCPAeH/zStGYQaUBS1+uNpzR2Z8iRruroxM Fz5SQX0eaUuMi44B2DrztjI4h+wC7/C5eT7l+hf0mzgehaVVKzJUzvW7J81wTEPNGufZ XQKC6xi5hudr9MCMUftx3o/vlJ4/hPqPdFwj43C652ySXW59QMnowpOm+bfAFcSIbUFs Oz1JcCVTKayeKrRRCdoV4fCg3a5IgjbE2xgQ7KWBynDrx8hN5zqa4fqHPFsYSntQ5LqT IapgTQ6P1GukPm49ZIH7aWuwMHyyCXD43tkA4Vk3VppO0xmuJ6/p82NNSerlCFwlcHK4 86YQ== X-Gm-Message-State: ABuFfojA4TQcCf8mXfTwv9xC4uVUFYJdui6LAictbxBz6Ri5Jb8FgTrh yhSBGrPabyQLG0gWUXUsF28= X-Google-Smtp-Source: ACcGV62RkDT1G+4g5AxN8UJ7lHiAK+IXZy6DQpBacJJim/9ei1b1BLz/TJmDc8BoaEX+ZMUSzJq/qw== X-Received: by 2002:a63:1555:: with SMTP id 21-v6mr3332836pgv.383.1539304027529; Thu, 11 Oct 2018 17:27:07 -0700 (PDT) Received: from xplor.waratah.dyndns.org (122-58-183-253-adsl.sparkbb.co.nz. [122.58.183.253]) by smtp.gmail.com with ESMTPSA id h5-v6sm35877775pfo.135.2018.10.11.17.27.06 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 11 Oct 2018 17:27:06 -0700 (PDT) Received: by xplor.waratah.dyndns.org (Postfix, from userid 1000) id 91C75360081; Fri, 12 Oct 2018 13:27:02 +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 v5 0/2] Amiga RDB partition support fixes Date: Fri, 12 Oct 2018 13:26:56 +1300 Message-Id: <1539304018-11786-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 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. This change should be incontroversial (I hope). 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. The use of u64 instead of sector_t in the second patch is required to catch overflows even in cases where sector_t is 32 bit wide (i.e. no LBD support). Cheers, Michael