Skip to content

Commit 650d110

Browse files
committed
seccomp: move mmap variant to correct thread
During this commit: a3f5d47, the mmap call was mistakenly added to the vmm thread, as opposed to the API thread to which it was intended. Also fix the regression test. There was a bug in it, which lead to this issue being hidden. Signed-off-by: alindima <alindima@amazon.com>
1 parent 3cb75c7 commit 650d110

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

resources/seccomp/aarch64-unknown-linux-musl.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -189,19 +189,6 @@
189189
}
190190
]
191191
},
192-
{
193-
"syscall": "mmap",
194-
"comment": "Used for large buffers sent to api_server",
195-
"args": [
196-
{
197-
"index": 3,
198-
"type": "dword",
199-
"op": "eq",
200-
"val": 34,
201-
"comment": " libc::MAP_ANONYMOUS | libc::MAP_PRIVATE"
202-
}
203-
]
204-
},
205192
{
206193
"syscall": "mmap",
207194
"comment": "Used for reading the timezone in LocalTime::now()",
@@ -537,6 +524,19 @@
537524
}
538525
]
539526
},
527+
{
528+
"syscall": "mmap",
529+
"comment": "Used for large buffers sent to api_server",
530+
"args": [
531+
{
532+
"index": 3,
533+
"type": "dword",
534+
"op": "eq",
535+
"val": 34,
536+
"comment": " libc::MAP_ANONYMOUS | libc::MAP_PRIVATE"
537+
}
538+
]
539+
},
540540
{
541541
"syscall": "rt_sigaction",
542542
"comment": "rt_sigaction is used by libc::abort during a panic to install the default handler for SIGABRT",

tests/integration_tests/functional/test_api.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
# Disable pylint C0302: Too many lines in module
66
# pylint: disable=C0302
7-
import array
8-
import itertools
97
import os
108
import platform
119
import resource
@@ -1227,6 +1225,8 @@ def test_map_private_seccomp_regression(test_microvm_with_ssh):
12271225
@type: regression
12281226
"""
12291227
test_microvm = test_microvm_with_ssh
1228+
test_microvm.jailer.extra_args.update(
1229+
{'http-api-max-payload-size': str(1024 * 1024 * 2)})
12301230
test_microvm.spawn()
12311231
test_microvm.api_session.untime()
12321232

@@ -1237,13 +1237,10 @@ def test_map_private_seccomp_regression(test_microvm_with_ssh):
12371237
data_store = {
12381238
'latest': {
12391239
'meta-data': {
1240+
'ami-id': 'b' * (1024 * 1024)
12401241
}
12411242
}
12421243
}
12431244

1244-
slice_1mb = array.array('u', itertools.repeat('b', 1024 * 1024))
1245-
chars = array.array('u')
1246-
chars = [chars.extend(slice_1mb) for _ in range(190)]
1247-
data_store["latest"]["meta-data"]["ami-id"] = chars
12481245
response = test_microvm.mmds.put(json=data_store)
12491246
assert test_microvm.api_session.is_status_no_content(response.status_code)

0 commit comments

Comments
 (0)