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


Groups > linux.kernel > #1252716

Re: [PATCH net-next 2/2] xfrm: Fix unaligned access in xfrm_notify_sa() for DELSA

From Sowmini Varadhan <sowmini.varadhan@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH net-next 2/2] xfrm: Fix unaligned access in xfrm_notify_sa() for DELSA
Date 2015-10-21 13:00 +0200
Message-ID <qlZhE-FD-13@gated-at.bofh.it> (permalink)
References <qlqad-8it-7@gated-at.bofh.it> <qlqae-8it-43@gated-at.bofh.it> <qlVxn-3Et-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On (10/21/15 08:57), Steffen Klassert wrote:
> > --- a/net/xfrm/xfrm_user.c
> > +++ b/net/xfrm/xfrm_user.c
> > @@ -2659,7 +2659,7 @@ static int xfrm_notify_sa(struct xfrm_state *x, const struct km_event *c)
> >  		if (attr == NULL)
> >  			goto out_free_skb;
> >  
> > -		p = nla_data(attr);
> > +		p = PTR_ALIGN(nla_data(attr), __alignof__(*p));
> 
> Hm, this breaks userspace notifications on 64-bit systems.
> Userspace expects this to be aligned to 4, with your patch
> it is aligned to 8 on 64-bit.
> 
> Without your patch I get the correct notification when deleting a SA:
> 

But __alignof__(*p) is 8 on sparc, and without the patch I get
all types of unaligned access. So what do you suggest as the fix?

(and openswan/pluto dont flag any errors with the patch, which is
a separate bug).

--Sowmini

--
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 | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] xfrm/crypto: unaligned access fixes Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2015-10-19 23:30 +0200
  [PATCH net-next 2/2] xfrm: Fix unaligned access in xfrm_notify_sa() for DELSA Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2015-10-19 23:30 +0200
    Re: [PATCH net-next 2/2] xfrm: Fix unaligned access in  xfrm_notify_sa() for DELSA Steffen Klassert <steffen.klassert@secunet.com> - 2015-10-21 09:00 +0200
      Re: [PATCH net-next 2/2] xfrm: Fix unaligned access in  xfrm_notify_sa() for DELSA Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2015-10-21 13:00 +0200
        Re: [PATCH net-next 2/2] xfrm: Fix unaligned access in  xfrm_notify_sa() for DELSA Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2015-10-21 14:40 +0200
          Re: [PATCH net-next 2/2] xfrm: Fix unaligned access in  xfrm_notify_sa() for DELSA David Miller <davem@davemloft.net> - 2015-10-21 15:10 +0200
            Re: [PATCH net-next 2/2] xfrm: Fix unaligned access in  xfrm_notify_sa() for DELSA Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2015-10-21 15:20 +0200
        Re: [PATCH net-next 2/2] xfrm: Fix unaligned access in  xfrm_notify_sa() for DELSA David Miller <davem@davemloft.net> - 2015-10-21 15:10 +0200
      Re: [PATCH net-next 2/2] xfrm: Fix unaligned access in  xfrm_notify_sa() for DELSA David Miller <davem@davemloft.net> - 2015-10-21 15:00 +0200

csiph-web