From patchwork Mon Oct 15 02:32:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Schmitz X-Patchwork-Id: 10641035 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 C5A0714BD for ; Mon, 15 Oct 2018 02:32:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7D47295AF for ; Mon, 15 Oct 2018 02:32:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B903295B7; Mon, 15 Oct 2018 02:32:36 +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 6337C295AF for ; Mon, 15 Oct 2018 02:32:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726357AbeJOKPn (ORCPT ); Mon, 15 Oct 2018 06:15:43 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:37060 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbeJOKPn (ORCPT ); Mon, 15 Oct 2018 06:15:43 -0400 Received: by mail-pl1-f194.google.com with SMTP id u6-v6so5774154plz.4; Sun, 14 Oct 2018 19:32:34 -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=iycaAcCs2yYbQtxJI/jjNaBl1bXkM9DaCDTGw+nYYnQ=; b=r/cZAdvDFqOs32eqljasgR4y0yarRkJXXaRFwW+7DkDV4KR8vkKUeza/yLfs0cWgIo WY1GfTROx2o2984HJkqSsj6JzzkS+hEtZFb+gvR6Mok5wjCNYbi350tb/SPwbjDVdzYq SBgub2bkojuTmDMNXos5BDOiHJw+4XLD6XOQgBV+mmHqq8EzFfk9w3FPM9FDbEibnaHD 0qWbX9pnfmaS2U09JtUR2t6aqo5QMUJOPCOJOfjUsY+VJxxH4W18W2McP/i6PH4ukb7z XJfFdf9kto+4yy1s1etQV5L9jeNebNCZdsccGR/YcZDH47pEdsLGfQdfRZMxT374IZqu pjZQ== 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=iycaAcCs2yYbQtxJI/jjNaBl1bXkM9DaCDTGw+nYYnQ=; b=Oo4ulLiXL9sTRFbM6/ioSJ8gFoTQrDGIMnZPnVPOqqxdu6XVB7fac26gl1vndRrTIB DdhqpK0WpllNESRe5oQmfUPNz9n37hBt4NKse54gLWMkVSZmpDbLcurh+dDYdNuV6WzG LNLPNCR2AAO4gSRIhUc1ZuyoJYsRsXV5ZrHD+197KvOcy6BPO17kTbYPXd/svxOOfHn/ iIYHHITWI+/f9/vDVgbjLLnmm26Y90hd/bdy1zDo/+Z84nbuy7qinr/kO75uL9r3vamo h+qu7gSDQZahBn13stkQedthTOBCGtFm8PQE0f1LrNkElT96HfDgDOGlV/L1JoVPZtt1 1Efw== X-Gm-Message-State: ABuFfoh+eDxr63dFUYwcGdjOwT00FqZe+2ubz6g5vv46LNZam7JbBlRf J26QODyeLiwBUjWGs2jw28o= X-Google-Smtp-Source: ACcGV61IU48nh2rGf6vJKaG+JmImnppY1p97SQoovtLkCRMXu+CLDWwqlZvATmz+fR8hupmKmR3Z8A== X-Received: by 2002:a17:902:b198:: with SMTP id s24-v6mr14590343plr.70.1539570753888; Sun, 14 Oct 2018 19:32:33 -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 i21-v6sm11297130pgj.55.2018.10.14.19.32.32 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 14 Oct 2018 19:32:33 -0700 (PDT) Received: by xplor.waratah.dyndns.org (Postfix, from userid 1000) id 0EE0F360081; Mon, 15 Oct 2018 15:32:29 +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 v7 0/2] Amiga RDB partition support fixes Date: Mon, 15 Oct 2018 15:32:25 +1300 Message-Id: <1539570747-19906-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 (hopefully) final version of the Amiga RDB partition table patch follows. 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. Comments by Geert have been addressed in full. Both patches now reviewed by Geert - Reviewed-by tags added. Cheers, Michael