From patchwork Sat Sep 29 23:56:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Schmitz X-Patchwork-Id: 10621025 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 6C4DF913 for ; Sat, 29 Sep 2018 23:56:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4772B29D01 for ; Sat, 29 Sep 2018 23:56:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A01629D06; Sat, 29 Sep 2018 23:56:30 +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 DD53E29D01 for ; Sat, 29 Sep 2018 23:56:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726575AbeI3G0y (ORCPT ); Sun, 30 Sep 2018 02:26:54 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35687 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726009AbeI3G0y (ORCPT ); Sun, 30 Sep 2018 02:26:54 -0400 Received: by mail-pg1-f196.google.com with SMTP id v133-v6so6969348pgb.2; Sat, 29 Sep 2018 16:56:27 -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=2+3L/NVjSmUtXBntseS7G8i1V5VfD7uapu1lykLEGAU=; b=G38088yD5inPtYh7pzMDnEEPQeoV/P48DAaiHGc64Vq+Hlhf4WJouQlsWfUGgw4o+b VePfDSzqNzPBFG7usfD0jIuylkwBtRbx84wtyqL3mJCcuKYsOCaZah6GZ4W3WsinC+OO Y8DtAuoovFiwpGimSaCAy6ClUd0b5dOwgaoxxfR3FW81krigzefcKC9gjD3KFodlLsXt dLUf3W4eFlxuB8WCUJvcw64Lv91Ss3QBgNoeCGXsckQ5hnAYRuqRLGmiunCf4nMnxAzA wgTjpD0jFN4aU0XzYy03pj5Y8A3AnUaXA0LAGLFgKvM/GO10VskMJ93R/YLwakr/IKU0 dY5A== 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=2+3L/NVjSmUtXBntseS7G8i1V5VfD7uapu1lykLEGAU=; b=I1WBrEfANFH8DYVza4pjNQJMrQ3sk01n3JlNIIJHfjf3vwJZypOf+BPdLslj4zKCIK QPXymEGBEyv37Pdfb68hBQeo+lGCTq95wgEhJyQauCsB/SnOKA/rvFhzv0YQFtlZtaAH 8zPKP+SbrQ515KShLe09uCHHt81MSh5hFCKDVeCEnCUrlDZ5AmZrwnAOywyDbiUbOHVl F7Vxj3r2OmoRlwvSg0TNA8pux49zug6XPMDTel4tI45RP/KpbcreYpSJn63WHieF/Vha qT9K3i8cbR98r0TeqVPqbUolIJsxXs/wjBTF9e65d2binUaRxcGnhngFW45MxNotoMql ehcw== X-Gm-Message-State: ABuFfojJ7xfaNGBX+GHXFSDANy4tJ0MprC2Vd7bBn/MiZS0ykXLHhFx1 gWPogxgnSW1Arn3qDz6Wj5P9NBSi X-Google-Smtp-Source: ACcGV60TevTi6D1SyVptbkKrvzYU46NNWTw18G81W6kzOt3LpvvyF1zxw3l2EHB8d6lLMx0D5aCvvw== X-Received: by 2002:a63:7419:: with SMTP id p25-v6mr4571022pgc.395.1538265386707; Sat, 29 Sep 2018 16:56:26 -0700 (PDT) Received: from xplor.waratah.dyndns.org (222-154-41-72-adsl.sparkbb.co.nz. [222.154.41.72]) by smtp.gmail.com with ESMTPSA id b29-v6sm2439238pfj.183.2018.09.29.16.56.25 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 29 Sep 2018 16:56:26 -0700 (PDT) Received: by xplor.waratah.dyndns.org (Postfix, from userid 1000) id 570F0360081; Sun, 30 Sep 2018 12:56:22 +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 v4 0/2] Amiga RDB partition support fixes Date: Sun, 30 Sep 2018 12:56:16 +1300 Message-Id: <1538265378-20544-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 Jens, as suggested, here's a 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. 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