netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: nhorman@tuxdriver.com
Cc: David.Laight@ACULAB.COM, vyasevich@gmail.com,
	netdev@vger.kernel.org, linux-sctp@vger.kernel.org
Subject: Re: [PATCH] sctp: Clean up type-punning in sctp_cmd_t union
Date: Mon, 29 Oct 2012 15:04:44 -0400 (EDT)	[thread overview]
Message-ID: <20121029.150444.905377521761602639.davem@davemloft.net> (raw)
In-Reply-To: <20121029185932.GC10177@hmsreliant.think-freely.org>

From: Neil Horman <nhorman@tuxdriver.com>
Date: Mon, 29 Oct 2012 14:59:32 -0400

> I don't think thats whats going on at all.  The problem, as commit
> 19c7e9eef503dc1ae926f3d26c56f88bee568d7b describes it, is that ia64 was
> speculatively loading a value from memory of type sctp_arg_t.  If the
> initialization step set the value of one of the smaller members of the union
> (say a short), then the load stage may still load a larger amount of data (given
> that the union is larger than its smallest members).  That results in part of
> the load being uninitalized, and ia64 declaring it Not A Thing, and consequently
> trapping out.

Agreed.

> The fix previously was to just initazlie the unsigned long member zero in that
> union before setting the actuall type member that was requried so as to ensure
> all the data was initalized.  That works well enough, but it presumes that
> unsigned long is the largest member of the union, which is risky.  Its better to
> memset the union to 0 for sizeof bytes to ensure future proofing.

Also agreed.

  reply	other threads:[~2012-10-29 19:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25 20:47 [PATCH] sctp: Clean up type-punning in sctp_cmd_t union Neil Horman
2012-10-25 21:42 ` Vlad Yasevich
2012-10-25 23:58   ` Neil Horman
2012-10-26  3:48     ` Vlad Yasevich
2012-10-26 13:24       ` Neil Horman
2012-10-26 19:12         ` Vlad Yasevich
2012-10-26 20:35           ` Neil Horman
2012-10-26 21:10             ` David Miller
2012-10-27  1:42               ` Neil Horman
2012-10-27  2:16                 ` Vlad Yasevich
2012-10-29 15:07               ` David Laight
2012-10-29 18:59                 ` Neil Horman
2012-10-29 19:04                   ` David Miller [this message]
2012-10-26  9:00 ` David Laight
2012-10-26 13:28   ` Neil Horman
2012-10-26 13:41 ` [PATCH v2] " Neil Horman
2012-10-26 19:12   ` Vlad Yasevich
2012-10-29 16:35     ` Neil Horman

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=20121029.150444.905377521761602639.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=David.Laight@ACULAB.COM \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=vyasevich@gmail.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 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).