From: Mikael Pettersson <mikpe@csd.uu.se>
To: "Jordan Crouse" <jordan.crouse@amd.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: PATCH: Fix poor pointer math in devinet_sysctl_register
Date: Thu, 17 Nov 2005 11:53:07 +0100 [thread overview]
Message-ID: <17276.24851.194332.590736@alkaid.it.uu.se> (raw)
In-Reply-To: <20051116232345.GA872@cosmic.amd.com>
Jordan Crouse writes:
> This patch fixes pointer math that under certain circumstances, results
> in really bad pointers. This was encountered on a system compiled for i486, so
> other compilers may differ, but I don't think it hurts anyone.
>
> Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
> ---
>
> net/ipv4/devinet.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
> index 4ec4b2c..7585fce 100644
> --- a/net/ipv4/devinet.c
> +++ b/net/ipv4/devinet.c
> @@ -1454,7 +1454,7 @@ static void devinet_sysctl_register(stru
> return;
> memcpy(t, &devinet_sysctl, sizeof(*t));
> for (i = 0; i < ARRAY_SIZE(t->devinet_vars) - 1; i++) {
> - t->devinet_vars[i].data += (char *)p - (char *)&ipv4_devconf;
> + t->devinet_vars[i].data += (int)((char *)p - (char *)&ipv4_devconf);
> t->devinet_vars[i].de = NULL;
> }
This is the same code which broke due to a known gcc-4.0.0 bug:
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21173>. If you're
indeed using gcc-4.0.0, then it's time to upgrade.
/Mikael
next prev parent reply other threads:[~2005-11-17 10:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-16 23:23 Jordan Crouse
2005-11-17 6:14 ` Andrew Morton
2005-11-17 7:13 ` David S. Miller
2005-11-17 10:53 ` Mikael Pettersson [this message]
2005-11-17 15:04 ` Jordan Crouse
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=17276.24851.194332.590736@alkaid.it.uu.se \
--to=mikpe@csd.uu.se \
--cc=jordan.crouse@amd.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®