Re: [PATCH net] sctp: get sctphdr by offset in sctp_compute_cksum

2019-02-27 Thread Neil Horman
On Wed, Feb 27, 2019 at 08:53:26PM +0800, Xin Long wrote: > On Tue, Feb 26, 2019 at 8:29 PM Neil Horman wrote: > > > > On Tue, Feb 26, 2019 at 12:15:54AM +0800, Xin Long wrote: > > > On Mon, Feb 25, 2019 at 10:08 PM Neil Horman > > > wrote: > > > > > > > > On Mon, Feb 25, 2019 at 09:20:44PM

Re: [PATCH net] sctp: get sctphdr by offset in sctp_compute_cksum

2019-02-27 Thread Xin Long
On Tue, Feb 26, 2019 at 8:29 PM Neil Horman wrote: > > On Tue, Feb 26, 2019 at 12:15:54AM +0800, Xin Long wrote: > > On Mon, Feb 25, 2019 at 10:08 PM Neil Horman wrote: > > > > > > On Mon, Feb 25, 2019 at 09:20:44PM +0800, Xin Long wrote: > > > > On Mon, Feb 25, 2019 at 8:47 PM Neil Horman > >

Re: [PATCH net] sctp: get sctphdr by offset in sctp_compute_cksum

2019-02-26 Thread Neil Horman
On Tue, Feb 26, 2019 at 12:15:54AM +0800, Xin Long wrote: > On Mon, Feb 25, 2019 at 10:08 PM Neil Horman wrote: > > > > On Mon, Feb 25, 2019 at 09:20:44PM +0800, Xin Long wrote: > > > On Mon, Feb 25, 2019 at 8:47 PM Neil Horman wrote: > > > > > > > > On Mon, Feb 25, 2019 at 07:25:37PM +0800, Xin

Re: [PATCH net] sctp: get sctphdr by offset in sctp_compute_cksum

2019-02-25 Thread Xin Long
On Mon, Feb 25, 2019 at 10:08 PM Neil Horman wrote: > > On Mon, Feb 25, 2019 at 09:20:44PM +0800, Xin Long wrote: > > On Mon, Feb 25, 2019 at 8:47 PM Neil Horman wrote: > > > > > > On Mon, Feb 25, 2019 at 07:25:37PM +0800, Xin Long wrote: > > > > sctp_hdr(skb) only works when

Re: [PATCH net] sctp: get sctphdr by offset in sctp_compute_cksum

2019-02-25 Thread Neil Horman
On Mon, Feb 25, 2019 at 09:20:44PM +0800, Xin Long wrote: > On Mon, Feb 25, 2019 at 8:47 PM Neil Horman wrote: > > > > On Mon, Feb 25, 2019 at 07:25:37PM +0800, Xin Long wrote: > > > sctp_hdr(skb) only works when skb->transport_header is set properly. > > > > > > But in the path of

Re: [PATCH net] sctp: get sctphdr by offset in sctp_compute_cksum

2019-02-25 Thread Xin Long
On Mon, Feb 25, 2019 at 8:47 PM Neil Horman wrote: > > On Mon, Feb 25, 2019 at 07:25:37PM +0800, Xin Long wrote: > > sctp_hdr(skb) only works when skb->transport_header is set properly. > > > > But in the path of nf_conntrack_in: sctp_packet() -> sctp_error() > > > > skb->transport_header is not

Re: [PATCH net] sctp: get sctphdr by offset in sctp_compute_cksum

2019-02-25 Thread Neil Horman
On Mon, Feb 25, 2019 at 07:25:37PM +0800, Xin Long wrote: > sctp_hdr(skb) only works when skb->transport_header is set properly. > > But in the path of nf_conntrack_in: sctp_packet() -> sctp_error() > > skb->transport_header is not guaranteed to be right value for sctp. > It will cause to fail

[PATCH net] sctp: get sctphdr by offset in sctp_compute_cksum

2019-02-25 Thread Xin Long
sctp_hdr(skb) only works when skb->transport_header is set properly. But in the path of nf_conntrack_in: sctp_packet() -> sctp_error() skb->transport_header is not guaranteed to be right value for sctp. It will cause to fail to check the checksum for sctp packets. So fix it by using offset,