freebsd-dev/sys/netinet
Zbigniew Bodek 8018ac153f Change struct attribute to avoid aligned operations mismatch
Previous __alignment(4) allowed compiler to assume that operations are
performed on aligned region. On ARM processor, this led to alignment fault
as shown below:
trapframe: 0xda9e5b10
FSR=00000001, FAR=a67b680e, spsr=60000113
r0 =00000000, r1 =00000068, r2 =0000007c, r3 =00000000
r4 =a67b6826, r5 =a67b680e, r6 =00000014, r7 =00000068
r8 =00000068, r9 =da9e5bd0, r10=00000011, r11=da9e5c10
r12=da9e5be0, ssp=da9e5b60, slr=a054f164, pc =a054f2cc
<...>
udp_input+0x264: ldmia r5, {r0-r3, r6}
udp_input+0x268: stmia r12, {r0-r3, r6}

This was due to instructions which do not support unaligned access,
whereas for __alignment(2) compiler replaced ldmia/stmia with some
logically equivalent memcpy operations.
In fact, the assumption that 'struct ip' is always 4-byte aligned
is definitely false, as we have no impact on data alignment of packet
stream received.

Another possible solution would be to explicitely perform memcpy()
on objects of 'struct ip' type, which, however, would suffer from
performance drop, and be merely a problem hiding.

Please, note that this has nothing to do with
ARM32_DISABLE_ALIGNMENT_FAULTS option, but is related strictly to
compiler behaviour.

Submitted by:  Wojciech Macek <wma@semihalf.com>
Reviewed by:   glebius, ian
Obtained from: Semihalf
2015-02-24 12:57:03 +00:00
..
cc DCTCP (Data Center TCP) implementation. 2015-01-12 08:33:04 +00:00
khelp The TCP PAWS fix for kernels with fast tick rates (r231767) changed the TCP 2012-08-17 01:49:51 +00:00
libalias It'll be okay to use LibAliasDetachHandlers() here, relying 2013-12-25 09:43:51 +00:00
accf_data.c Rework socket upcalls to close some races with setup/teardown of upcalls. 2009-06-01 21:17:03 +00:00
accf_dns.c In preparation of merging projects/sendfile, transform bare access to 2014-11-12 09:57:15 +00:00
accf_http.c In preparation of merging projects/sendfile, transform bare access to 2014-11-12 09:57:15 +00:00
cc.h DCTCP (Data Center TCP) implementation. 2015-01-12 08:33:04 +00:00
icmp6.h Migrate structs in6_ifstat and icmp6_ifstat to PCPU counters. 2013-07-09 09:59:46 +00:00
icmp_var.h Remove more constants related to static sysctl nodes. The MAXID constants 2014-02-25 18:44:33 +00:00
if_atm.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
if_atm.h Add const qualifier to the dst parameter of the ifnet if_output method. 2013-04-26 12:50:32 +00:00
if_ether.c This fixes a bug in the way that the LLE timers for nd6 2015-02-09 19:28:11 +00:00
if_ether.h Do not return unlocked/unreferenced lle in arpresolve/nd6_storelladdr - 2014-11-27 23:06:25 +00:00
igmp_var.h - Rename 'struct igmp_ifinfo' into 'struct igmp_ifsoftc', since it really 2015-02-19 22:35:23 +00:00
igmp.c - Rename 'struct igmp_ifinfo' into 'struct igmp_ifsoftc', since it really 2015-02-19 22:35:23 +00:00
igmp.h These are no longer referenced in the tree, so can be safely removed. 2009-06-10 18:12:15 +00:00
in_cksum.c nobody uses this file except the userspace ipfw code, but the cast 2012-07-31 08:04:49 +00:00
in_debug.c
in_gif.c Extern declarations in C files loses compile-time checking that 2014-12-25 21:32:37 +00:00
in_kdtrace.c dtrace sdt: remove the ugly sname parameter of SDT_PROBE_DEFINE 2013-11-26 08:46:27 +00:00
in_kdtrace.h dtrace sdt: remove the ugly sname parameter of SDT_PROBE_DEFINE 2013-11-26 08:46:27 +00:00
in_mcast.c Fix build with KTR after r278978. 2015-02-19 15:41:23 +00:00
in_pcb.c Refactor / restructure the RSS code into generic, IPv4 and IPv6 specific 2015-01-18 18:06:40 +00:00
in_pcb.h Start process of removing the use of the deprecated "M_FLOWID" flag 2014-12-01 11:45:24 +00:00
in_pcbgroup.c Refactor / restructure the RSS code into generic, IPv4 and IPv6 specific 2015-01-18 18:06:40 +00:00
in_proto.c Finish r274118: remove useless fields from struct domain. 2014-11-06 14:39:04 +00:00
in_rmx.c Kill custom in_matroute() radix mathing function removing one rte mutex lock. 2014-11-11 02:52:40 +00:00
in_rss.c Refactor / restructure the RSS code into generic, IPv4 and IPv6 specific 2015-01-18 18:06:40 +00:00
in_rss.h Refactor / restructure the RSS code into generic, IPv4 and IPv6 specific 2015-01-18 18:06:40 +00:00
in_systm.h Where appropriate, use the modern terms for the one true time base 2014-12-21 05:07:11 +00:00
in_var.h The last userland piece of in_var.h is now 'struct in_aliasreq'. Move 2015-02-19 23:59:27 +00:00
in.c This fixes a bug in the way that the LLE timers for nd6 2015-02-09 19:28:11 +00:00
in.h Kill custom in_matroute() radix mathing function removing one rte mutex lock. 2014-11-11 02:52:40 +00:00
ip6.h Eliminate use of M_EXT in IP6_EXTHDR_CHECK() by trimming a redundant 2014-10-05 06:28:53 +00:00
ip_carp.c Log hardware interface up/down as "hardware" rather than just "hw". 2015-01-23 14:30:24 +00:00
ip_carp.h Merge 'struct ip6protosw' and 'struct protosw' into one. Now we have 2014-08-08 01:57:15 +00:00
ip_divert.c Update ip_divert.ko to depend on version 3 of ipfw. 2014-10-11 16:08:54 +00:00
ip_divert.h
ip_dummynet.h ECN marking implenetation for dummynet. 2014-06-01 07:28:24 +00:00
ip_ecn.c Add FBSDID to all files in netinet so that people can more 2007-10-07 20:44:24 +00:00
ip_ecn.h
ip_encap.c Merge 'struct ip6protosw' and 'struct protosw' into one. Now we have 2014-08-08 01:57:15 +00:00
ip_encap.h Merge 'struct ip6protosw' and 'struct protosw' into one. Now we have 2014-08-08 01:57:15 +00:00
ip_fastfwd.c Remove incorrect layering violating code that: 2015-01-12 09:41:12 +00:00
ip_fw.h Fix matching default rule on clear/show commands. 2014-10-13 13:49:28 +00:00
ip_gre.c Extern declarations in C files loses compile-time checking that 2014-12-25 21:32:37 +00:00
ip_icmp.c Where appropriate, use the modern terms for the one true time base 2014-12-21 05:07:11 +00:00
ip_icmp.h Where appropriate, use the modern terms for the one true time base 2014-12-21 05:07:11 +00:00
ip_id.c Back out r249318, r249320 and r249327 due to a heisenbug most 2013-05-06 16:42:18 +00:00
ip_input.c Refactor / restructure the RSS code into generic, IPv4 and IPv6 specific 2015-01-18 18:06:40 +00:00
ip_ipsec.c Use ipsec4_in_reject() to simplify ip_ipsec_fwd() and ip_ipsec_input(). 2014-12-11 18:55:54 +00:00
ip_ipsec.h Remove flag/flags argument from the following functions: 2014-12-11 18:35:34 +00:00
ip_mroute.c Remove SYSCTL_VNET_* macros, and simply put CTLFLAG_VNET where needed. 2014-11-07 09:39:05 +00:00
ip_mroute.h Migrate structs arpstat, icmpstat, mrtstat, pimstat and udpstat to PCPU 2013-07-09 09:50:15 +00:00
ip_options.c Use M_WRITABLE() and M_LEADINGSPACE() rather than checking M_EXT and 2015-01-06 14:32:28 +00:00
ip_options.h Make net.inet.ip.sourceroute, net.inet.ip.accept_sourceroute, and 2014-09-15 07:20:40 +00:00
ip_output.c The flowid and hashtype should be copied from the originating packet 2015-02-02 17:32:50 +00:00
ip_var.h Add a flag to ip_output() - IP_NODEFAULTFLOWID - which prevents it from 2014-09-09 00:19:02 +00:00
ip.h Change struct attribute to avoid aligned operations mismatch 2015-02-24 12:57:03 +00:00
pim_var.h Merge 'struct ip6protosw' and 'struct protosw' into one. Now we have 2014-08-08 01:57:15 +00:00
pim.h /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
raw_ip.c Remove SYSCTL_VNET_* macros, and simply put CTLFLAG_VNET where needed. 2014-11-07 09:39:05 +00:00
sctp_asconf.c Add protection code to free memory in case of processing an address which 2015-01-18 20:53:20 +00:00
sctp_asconf.h
sctp_auth.c Use a consistent type for the number of HMAC algorithms. 2014-09-16 14:20:33 +00:00
sctp_auth.h Use a consistent type for the number of HMAC algorithms. 2014-09-16 14:20:33 +00:00
sctp_bsd_addr.c Minimize the usage of SCTP_BUF_IS_EXTENDED. 2015-01-10 20:49:57 +00:00
sctp_bsd_addr.h
sctp_cc_functions.c Small cleanup which addresses a warning regaring the truncation 2014-09-16 13:48:46 +00:00
sctp_constants.h Fix the handling of sysctl variables when used with VIMAGE. 2014-09-06 19:12:14 +00:00
sctp_crc32.c Use consistent text at the begining of the files. 2012-05-23 11:26:28 +00:00
sctp_crc32.h Use consistent text at the begining of the files. 2012-05-23 11:26:28 +00:00
sctp_dtrace_declare.h - For kernel compiled only with KDTRACE_HOOKS and not any lock debugging 2013-11-25 07:38:45 +00:00
sctp_dtrace_define.h dtrace sdt: remove the ugly sname parameter of SDT_PROBE_DEFINE 2013-11-26 08:46:27 +00:00
sctp_header.h Fix the reported streams in a SCTP_STREAM_RESET_EVENT, if a 2014-10-16 15:36:04 +00:00
sctp_indata.c Minimize the usage of SCTP_BUF_IS_EXTENDED. 2015-01-10 20:49:57 +00:00
sctp_indata.h Code cleanups. 2013-07-03 18:48:43 +00:00
sctp_input.c Fix SCTP stream reset vulnerability. 2015-01-27 19:35:38 +00:00
sctp_input.h Fix the reported streams in a SCTP_STREAM_RESET_EVENT, if a 2014-10-16 15:36:04 +00:00
sctp_lock_bsd.h
sctp_os_bsd.h Retire SCTP_BUF_EXTEND_SIZE. This patch was suggested by 2015-01-10 13:56:26 +00:00
sctp_os.h
sctp_output.c Fix a bug which only shows up when an mbuf allocation failed. 2015-01-18 22:00:39 +00:00
sctp_output.h Ensure that the list of streams sent in a stream reset parameter fits 2014-10-08 15:30:59 +00:00
sctp_pcb.c Remove dead code. 2015-01-11 21:55:30 +00:00
sctp_pcb.h Do the renaming of sb_cc to sb_ccc in a way with less code changes by 2014-12-02 20:29:29 +00:00
sctp_peeloff.c Add support for the SCTP_AUTH_SUPPORTED and SCTP_ASCONF_SUPPORTED 2014-08-12 11:30:16 +00:00
sctp_peeloff.h
sctp_ss_functions.c
sctp_structs.h This is the SCTP specific companion of 2014-12-04 21:17:50 +00:00
sctp_syscalls.c Avoid dynamic syscall overhead for statically compiled modules. 2014-10-26 19:42:44 +00:00
sctp_sysctl.c Remove comparisons which are not necessary. 2015-01-20 19:08:55 +00:00
sctp_sysctl.h Fix the handling of sysctl variables when used with VIMAGE. 2014-09-06 19:12:14 +00:00
sctp_timer.c Code cleanup. 2015-01-19 11:52:08 +00:00
sctp_timer.h Use consistent text at the begining of the files. 2012-05-23 11:26:28 +00:00
sctp_uio.h Add support for the SCTP_PR_STREAM_STATUS and SCTP_PR_ASSOC_STATUS 2014-08-13 15:50:16 +00:00
sctp_usrreq.c Whitespace change. 2015-01-27 21:30:24 +00:00
sctp_var.h Do the renaming of sb_cc to sb_ccc in a way with less code changes by 2014-12-02 20:29:29 +00:00
sctp.h Add support for the SCTP_PR_STREAM_STATUS and SCTP_PR_ASSOC_STATUS 2014-08-13 15:50:16 +00:00
sctputil.c Remove dead code. 2015-01-12 07:39:52 +00:00
sctputil.h Minimize the usage of SCTP_BUF_IS_EXTENDED. 2015-01-10 20:49:57 +00:00
siftr.c In preparation of merging projects/sendfile, transform bare access to 2014-11-12 09:57:15 +00:00
tcp_debug.c
tcp_debug.h
tcp_fsm.h Make tcpstates[] static, and make sure TCPSTATES is defined before 2007-07-30 11:06:42 +00:00
tcp_hostcache.c Use an sbuf to generate the output of the net.inet.tcp.hostcache.list 2015-01-25 19:45:44 +00:00
tcp_hostcache.h Add scope zone id to the in_endpoints and hc_metrics structures. 2014-09-10 16:26:18 +00:00
tcp_input.c DCTCP (Data Center TCP) implementation. 2015-01-12 08:33:04 +00:00
tcp_lro.c Merge r254336 from user/np/cxl_tuning. 2013-08-28 23:00:34 +00:00
tcp_lro.h Merge r254336 from user/np/cxl_tuning. 2013-08-28 23:00:34 +00:00
tcp_offload.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
tcp_offload.h - Updated TOE support in the kernel. 2012-06-19 07:34:13 +00:00
tcp_output.c To ease changes to underlying mbuf structure and the mbuf allocator, reduce 2015-01-05 09:58:32 +00:00
tcp_reass.c Merge from projects/sendfile: extend protocols API to support 2014-11-30 13:24:21 +00:00
tcp_sack.c Remove SYSCTL_VNET_* macros, and simply put CTLFLAG_VNET where needed. 2014-11-07 09:39:05 +00:00
tcp_seq.h
tcp_subr.c Remove kernel handling of ICMP_SOURCEQUENCH. 2014-11-10 23:10:01 +00:00
tcp_syncache.c Make syncookie_mac() use 'tcp_seq irs' in computing hash. 2015-01-30 17:29:07 +00:00
tcp_syncache.h Introduce spares in the TCP syncache and timewait structures 2013-09-21 10:01:51 +00:00
tcp_timer.c Refactor / restructure the RSS code into generic, IPv4 and IPv6 specific 2015-01-18 18:06:40 +00:00
tcp_timer.h Fix a race condition in TCP timewait between tcp_tw_2msl_reuse() and 2014-10-30 08:53:56 +00:00
tcp_timewait.c Remove SYSCTL_VNET_* macros, and simply put CTLFLAG_VNET where needed. 2014-11-07 09:39:05 +00:00
tcp_usrreq.c Merge from projects/sendfile: 2014-11-30 13:43:52 +00:00
tcp_var.h Re-introduce padding fields removed with r264321 to keep 2014-11-17 14:56:02 +00:00
tcp.h
tcpip.h /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
toecore.c Do not return unlocked/unreferenced lle in arpresolve/nd6_storelladdr - 2014-11-27 23:06:25 +00:00
toecore.h
udp_usrreq.c Refactor / restructure the RSS code into generic, IPv4 and IPv6 specific 2015-01-18 18:06:40 +00:00
udp_var.h Add context pointer and source address to the UDP tunnel callback 2014-10-10 06:08:59 +00:00
udp.h
udplite.h Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks. 2014-04-07 01:53:03 +00:00