Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1254470

Re: [PATCH v2 net-next] xfrm: Fix unaligned access to stats in copy_to_user_state()

From Steffen Klassert <steffen.klassert@secunet.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 net-next] xfrm: Fix unaligned access to stats in copy_to_user_state()
Date 2015-10-23 12:40 +0200
Message-ID <qmHVo-7dR-25@gated-at.bofh.it> (permalink)
References <qm3Oi-7q3-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Oct 21, 2015 at 11:48:25AM -0400, Sowmini Varadhan wrote:
> 
> On sparc, deleting established SAs (e.g., by restarting ipsec)
> results in unaligned access messages via xfrm_del_sa -> 
> km_state_notify -> xfrm_send_state_notify().
> 
> Even though struct xfrm_usersa_info is aligned on 8-byte boundaries,
> netlink attributes are fundamentally only 4 byte aligned, and this
> cannot be changed for nla_data() that is passed up to userspace.
> As a result, the put_unaligned() macro needs to be used to
> set up potentially unaligned fields such as the xfrm_stats in
> copy_to_user_state()
> 
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
> ---
> v2: review comment from thread: cannot use PTR_ALIGN as this would break
>     userspace assumptions about 4 byte alignment. Use *_unaligned() macros
>     as needed, instead.

This works on intel 32-bit and 64-bit as expected.
Patch applied to ipsec-next, thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2 net-next] xfrm: Fix unaligned access to stats in  copy_to_user_state() Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2015-10-21 17:50 +0200
  Re: [PATCH v2 net-next] xfrm: Fix unaligned access to stats in  copy_to_user_state() Steffen Klassert <steffen.klassert@secunet.com> - 2015-10-23 12:40 +0200

csiph-web