Actions
Bug #3194
closedmisaligned access error in build_ipcp_pco() msgb_put_u8(msg, ipcp->id);
Start date:
04/22/2018
Due date:
% Done:
0%
Spec Reference:
Description
Found with a real-hardware test using address sanitizer built osmo-ggsn
../../../src/osmo-ggsn/ggsn/ggsn.c:507:23: runtime error: member access within misaligned address 0x7feccdd43d57 for type 'struct ipcp_hdr', which requires 2 byte alignment 0x7feccdd43d57: note: pointer points here 65 80 21 16 01 01 00 16 03 06 00 00 00 00 81 06 00 00 00 00 83 06 00 00 00 00 00 00 00 00 00 00 ^
at ggsn.c
static int build_ipcp_pco(struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *msg) { [...] msgb_put_u8(msg, 0x02); /* ACK */ msgb_put_u8(msg, ipcp->id); /* ID: Needs to match request */ ...............................^ here msgb_put_u8(msg, 0x00); /* Length MSB */ len2 = msgb_put(msg, 1); /* Length LSB: delay */
Surrounding log (including some temporary hacky logging)
20180422145741987 DLGLOBAL NOTICE telnet_interface.c:104 telnet at 127.0.0.1 4260 20180422145741987 DLCTRL NOTICE control_if.c:863 CTRL at 127.0.0.1 4257 20180422153628215 DLGTP DEBUG gtp.c:1570 gtp_create_pdp_ind: Before pdp_tidget 20180422153628215 DLGTP DEBUG pdp.c:275 Begin pdp_tidget tid = 5207410000007109 20180422153628216 DLGTP DEBUG pdp.c:283 Begin pdp_tidget. Not found 20180422153628216 DLGTP DEBUG pdp.c:237 Begin pdp_tidset tid = 5207410000007109 20180422153628216 DLGTP DEBUG pdp.c:246 End pdp_tidset 20180422153628216 DGGSN DEBUG ggsn.c:604 PDP(901700000014702:5): Processing create PDP context request for APN 'internet.beeline.ru' 20180422153628216 DGGSN ERROR ggsn.c:541 PDP(901700000014702:5): XXXXXXXXXXX using APN internet ../../../src/osmo-ggsn/ggsn/ggsn.c:507:23: runtime error: member access within misaligned address 0x7feccdd43d57 for type 'struct ipcp_hdr', which requires 2 byte alignment 0x7feccdd43d57: note: pointer points here 65 80 21 16 01 01 00 16 03 06 00 00 00 00 81 06 00 00 00 00 83 06 00 00 00 00 00 00 00 00 00 00 ^ ../../../src/osmo-ggsn/ggsn/ggsn.c:407:44: runtime error: member access within misaligned address 0x7feccdd43d57 for type 'struct ipcp_hdr', which requires 2 byte alignment 0x7feccdd43d57: note: pointer points here 65 80 21 16 01 01 00 16 03 06 00 00 00 00 81 06 00 00 00 00 83 06 00 00 00 00 00 00 00 00 00 00 ^ ../../../src/osmo-ggsn/ggsn/ggsn.c:407:44: runtime error: member access within misaligned address 0x7feccdd43d57 for type 'struct ipcp_hdr', which requires 2 byte alignment 0x7feccdd43d57: note: pointer points here 65 80 21 16 01 01 00 16 03 06 00 00 00 00 81 06 00 00 00 00 83 06 00 00 00 00 00 00 00 00 00 00 ^ 20180422153628217 DGGSN ERROR ggsn.c:556 PDP(901700000014702:5): XXXXXXXXXXX pco_contains_proto(v4) = 0 20180422153628217 DGGSN INFO ggsn.c:719 PDP(901700000014702:5): Successful PDP Context Creation: APN=internet.beeline.ru(internet), TEIC=1, IPv4=192.168.42.1, IPv6=none 20180422153628217 DLGTP DEBUG gtp.c:1250 XXXXXXXXXXXXXX Create PDP Context Reponse version=1 cause=128 20180422153650963 DGGSN INFO ggsn.c:360 PDP(901700000014702:5): Deleting PDP context 20180422153650964 DLGTP DEBUG pdp.c:255 Begin pdp_tiddel tid = 5207410000007109
Related issues
Updated by neels about 6 years ago
- Related to Bug #3195: misaligned access error in pcp_contains_option() added
Updated by laforge almost 6 years ago
- Assignee set to stsp
- Priority changed from Normal to Low
Updated by stsp almost 6 years ago
- Related to deleted (Bug #3195: misaligned access error in pcp_contains_option())
Updated by stsp almost 6 years ago
- Has duplicate Bug #3195: misaligned access error in pcp_contains_option() added
Updated by stsp almost 6 years ago
Disregard the previously proposed fix, which was wrong and has been abandoned.
A new proposal is at https://gerrit.osmocom.org/#/c/osmo-ggsn/+/10028
Updated by stsp almost 6 years ago
- Status changed from In Progress to Resolved
Actions