Re: [PATCH net-next v3] net: starfire: fix ioaddr sign-extension causing ioremap() failure
From: Simon Horman
Date: Thu Sep 10 2026 - 05:50:09 EST
On Tue, Sep 08, 2026 at 06:28:29PM -0600, Ivy Lopez wrote:
> ioaddr is declared as a signed long, but is assigned the result of
> pci_resource_start(), which returns an unsigned resource_size_t.
> On configurations where the BAR address has its high bit set, the
> value sign-extends when passed to ioremap(), producing a bogus
> 64-bit address and causing device probe to fail:
>
> ioremap: invalid physical address fffffffffe480000
> starfire 0000:08:04.0: cannot Remap 0x80000 @ 0xfe480000, aborting
>
> Change ioaddr to resource_size_t, matching both the return type of
> pci_resource_start() and the type ioremap() expects for its physical
> address argument, rather than unsigned long, which is not guaranteed
> to be wide enough on all configurations. Switch the associated error
> print to %pa accordingly.
Sorry for not noticing this earlier, but probably this should
have a Fixes tag. No need to repost just for this but I think
it should be:
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=198035
> Signed-off-by: Ivy Lopez <skunkolee@xxxxxxxxx>
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
> ---
> ---
> v2: use resource_size_t instead of unsigned long, and switch the
> error print to %pa, per Simon Horman's review.
> v3: rebase against net-next, no content changes, per Simon Horman.
...