Skip to content

Commit 3eef3c9

Browse files
committed
Merge branch 'maint'
* maint: erts: fix out-of-bounds read on distributed priority send of a fragmented message
2 parents 40b3a3d + 1f46109 commit 3eef3c9

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

erts/emulator/beam/erl_proc_sig_queue.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6188,8 +6188,10 @@ handle_altact_msg(Process *c_p, ErtsSigRecvTracing *tracing,
61886188
/* drop faulty encoded external message... */
61896189
return cnt;
61906190
}
6191-
cnt += insert_prepared_prio_msg(c_p, tracing, mp, ERL_MESSAGE_TERM(mp),
6192-
token, next_nm_sig);
6191+
cnt += insert_prepared_prio_msg_attached(c_p, tracing, mp,
6192+
mp->data.attached,
6193+
ERL_MESSAGE_TERM(mp), token,
6194+
next_nm_sig);
61936195
}
61946196
break;
61956197
}

erts/emulator/test/signal_SUITE.erl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,6 +1826,7 @@ priority_messages_order_test(Node) ->
18261826
{priority_messages, true} = proc_info(Rcvr, priority_messages),
18271827

18281828
{priority_alias, PrioAlias} = receive {priority_alias, _} = PA -> PA end,
1829+
Large = binary:copy(<<0>>, 1 bsl 20),
18291830

18301831
{priority_messages, true} = proc_info(Rcvr, priority_messages),
18311832

@@ -1850,7 +1851,7 @@ priority_messages_order_test(Node) ->
18501851
PrioAlias ! {msg, 6},
18511852
erlang:send(PrioAlias, {prio_msg, 1}, [priority]),
18521853
erlang:send(PrioAlias, {msg, 7}, []),
1853-
erlang:send(PrioAlias, prio_msg_2, [priority]),
1854+
erlang:send(PrioAlias, {prio_msg, Large}, [priority]),
18541855
erlang:send(Rcvr, {msg, 8}, [priority]),
18551856
wait_until(fun () -> msg_received(Rcvr, {msg, 8}) end),
18561857
exit_signal(LinkProc4, {link_exit, 2}),
@@ -1868,7 +1869,7 @@ priority_messages_order_test(Node) ->
18681869
{'DOWN', Mon1, process, MonProc1, prio_down_1},
18691870
{'EXIT', Parent, prio_func_exit_1},
18701871
{prio_msg, 1},
1871-
prio_msg_2,
1872+
{prio_msg, Large},
18721873
{'EXIT', LinkProc3, {prio_link_exit, 2}},
18731874
{'DOWN', Mon3, process, MonProc3, {prio_down, 2}},
18741875

0 commit comments

Comments
 (0)