From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Subrahmanya Lingappa <l.subrahmanya@mobiveil.co.in>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] PCI: mobiveil: integer overflow in IB_WIN_SIZE
Date: Thu, 26 Jul 2018 11:56:17 +0100 [thread overview]
Message-ID: <20180726105617.GA6181@red-moon> (raw)
In-Reply-To: <20180705094539.xkmtfffbzl3kooum@kili.mountain>
On Thu, Jul 05, 2018 at 12:45:39PM +0300, Dan Carpenter wrote:
> IB_WIN_SIZE is larger than INT_MAX so we need to cast it to u64.
>
> Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Untested... Possibly the problem is that there are too many multiplies
> by * 1024.
>
> diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c
Applied to pci/mobiveil for v4.19 (it is still not fixing anything
given that the driver lacks a Kconfig and Makefile entries - that
must be fixed with urgency), thanks.
Lorenzo
> index 4d6c20e47bed..cf0aa7cee5b0 100644
> --- a/drivers/pci/controller/pcie-mobiveil.c
> +++ b/drivers/pci/controller/pcie-mobiveil.c
> @@ -107,7 +107,7 @@
> #define CFG_WINDOW_TYPE 0
> #define IO_WINDOW_TYPE 1
> #define MEM_WINDOW_TYPE 2
> -#define IB_WIN_SIZE (256 * 1024 * 1024 * 1024)
> +#define IB_WIN_SIZE ((u64)256 * 1024 * 1024 * 1024)
> #define MAX_PIO_WINDOWS 8
>
> /* Parameters for the waiting for link up routine */
next prev parent reply other threads:[~2018-07-26 12:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-05 9:45 [PATCH] PCI: mobiveil: integer overflow in IB_WIN_SIZE Dan Carpenter
2018-07-06 11:26 ` Lorenzo Pieralisi
2018-07-09 10:25 ` Subrahmanya Lingappa
2018-07-09 11:42 ` Lorenzo Pieralisi
2018-07-16 6:40 ` Subrahmanya Lingappa
2018-07-26 9:46 ` Lorenzo Pieralisi
2018-07-26 10:56 ` Lorenzo Pieralisi [this message]
2018-08-01 7:07 ` Subrahmanya Lingappa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180726105617.GA6181@red-moon \
--to=lorenzo.pieralisi@arm.com \
--cc=bhelgaas@google.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=l.subrahmanya@mobiveil.co.in \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).