From: Tony Lindgren <tony@atomide.com>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>,
Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>,
Kevin Hilman <khilman@deeprootsystems.com>,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH][next] ARM: OMAP2+: Fix -Warray-bounds warning in _pwrdm_state_switch()
Date: Wed, 14 Jun 2023 11:07:40 +0300 [thread overview]
Message-ID: <20230614080740.GH14287@atomide.com> (raw)
In-Reply-To: <ZIFVGwImU3kpaGeH@work>
* Gustavo A. R. Silva <gustavoars@kernel.org> [230608 07:11]:
> If function pwrdm_read_prev_pwrst() returns -EINVAL, we will end
> up accessing array pwrdm->state_counter through negative index
> -22. This is wrong and the compiler is legitimately warning us
> about this potential problem.
>
> Fix this by sanity checking the value stored in variable _prev_
> before accessing array pwrdm->state_counter.
>
> Address the following -Warray-bounds warning:
> arch/arm/mach-omap2/powerdomain.c:178:45: warning: array subscript -22 is below array bounds of 'unsigned int[4]' [-Warray-bounds]
Thanks applying into omap-for-v6.5/cleanup, seems this can wait
for the merge window.
Regards,
Tony
WARNING: multiple messages have this Message-ID (diff)
From: Tony Lindgren <tony@atomide.com>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>,
Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>,
Kevin Hilman <khilman@deeprootsystems.com>,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH][next] ARM: OMAP2+: Fix -Warray-bounds warning in _pwrdm_state_switch()
Date: Wed, 14 Jun 2023 11:07:40 +0300 [thread overview]
Message-ID: <20230614080740.GH14287@atomide.com> (raw)
In-Reply-To: <ZIFVGwImU3kpaGeH@work>
* Gustavo A. R. Silva <gustavoars@kernel.org> [230608 07:11]:
> If function pwrdm_read_prev_pwrst() returns -EINVAL, we will end
> up accessing array pwrdm->state_counter through negative index
> -22. This is wrong and the compiler is legitimately warning us
> about this potential problem.
>
> Fix this by sanity checking the value stored in variable _prev_
> before accessing array pwrdm->state_counter.
>
> Address the following -Warray-bounds warning:
> arch/arm/mach-omap2/powerdomain.c:178:45: warning: array subscript -22 is below array bounds of 'unsigned int[4]' [-Warray-bounds]
Thanks applying into omap-for-v6.5/cleanup, seems this can wait
for the merge window.
Regards,
Tony
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-06-14 8:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-08 4:12 [PATCH][next] ARM: OMAP2+: Fix -Warray-bounds warning in _pwrdm_state_switch() Gustavo A. R. Silva
2023-06-08 4:12 ` Gustavo A. R. Silva
2023-06-08 8:09 ` Ard Biesheuvel
2023-06-08 8:09 ` Ard Biesheuvel
2023-06-14 8:07 ` Tony Lindgren [this message]
2023-06-14 8:07 ` Tony Lindgren
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=20230614080740.GH14287@atomide.com \
--to=tony@atomide.com \
--cc=gustavoars@kernel.org \
--cc=khilman@deeprootsystems.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=peter.de-schrijver@nokia.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.