-
Notifications
You must be signed in to change notification settings - Fork 68
Add overlaybd sysext #3157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add overlaybd sysext #3157
Conversation
8a91765
to
1f59719
Compare
9131fcc
to
9c1c61f
Compare
Edit: Resolved by putting ISAL support behind a USE flag. |
Build action triggered: https://github.com/flatcar/scripts/actions/runs/16813069920 |
When testing I'm seeing multiple
This happens in the Systemd restarts systemd-coredump helpfully hints at an
objdump for
which corresponds to line 131 in 127
128 switch (cmd->cdb[0]) {
129 case INQUIRY:
130 photon::thread_yield();
131 ret = tcmu_emulate_inquiry(dev, NULL, cmd->cdb, cmd->iovec, cmd->iov_cnt);
132 tcmulib_command_complete(dev, cmd, ret);
133 break;
134 |
9c1c61f
to
d00bba7
Compare
Signed-off-by: James Le Cuirot <[email protected]>
* A custom CTR for pulling accelerated container images * An image converter * A snapshotter Signed-off-by: James Le Cuirot <[email protected]>
Signed-off-by: James Le Cuirot <[email protected]>
d00bba7
to
bac06fe
Compare
So the failing code seems to be this one in https://github.com/data-accelerator/photon-libtcmu/blob/main/scsi.cpp#L255-L256: len = snprintf(&ptr[4], sizeof(data) - used - 4, "%s",
tcmu_dev_get_cfgstring(dev));
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
__glibc_objsize (__s), __fmt,
__va_arg_pack ()); The failing check is this code inside
My guess is that
Possibly a workaround could be to lower the fortification configuration we use, or do a strdup of the device's cfgstring and pass the result to |
Another possible workaround could be increasing size of |
This seems cleaner to me since it would ensure that |
Is it possible that the string is not null terminated? |
That was my first guess/idea, but no. The string was null terminated, had length of 101 characters. The string was something like |
@krnowak I patched diff --git a/scsi.cpp b/scsi.cpp
index d8c27a9..0113eb2 100644
--- a/scsi.cpp
+++ b/scsi.cpp
@@ -181,7 +181,7 @@ int tcmu_emulate_evpd_inquiry(
break;
case 0x83: /* Device identification */
{
- char data[512];
+ char data[PATH_MAX+512]; //tcmu_dev_get_cfgstring(dev) may be up to PATH_MAX length
char *ptr, *p, *wwn;
size_t len, used = 0;
uint16_t *tot_len = (uint16_t*) &data[2]; and I can still see the issue - same buffer overflow, same stack trace. |
Bah, I'll add some debug symbols for glibc and investigate more tomorrow. |
So I did a bit of |
This adds overlaybd, a user space container-optimised block device implementing a novel layering block-level image format, which is designed for containers, with security and performance in mind.
Documentation is available at https://containerd.github.io/overlaybd/.
sys-fs/overlaybd ships the low-level user space block device (https://github.com/containerd/overlaybd) as well as low-level tooling for operating it.
app-containers/accelerated-container-image (https://github.com/containerd/accelerated-container-image) ships integration with containerd.
Both are part of the Containerd CNCF project.
BUILDING
Rebuilding
After an initial build only the sysext needs to be rebuilt.
To limit the scope of system-dependent sysext builds it is useful to set
EXTRA_SYSEXTS=( "overlaybd|sys-fs/overlaybd,app-containers/accelerated-container-image" )
in
build_library/prod_image_util.sh
.To pick up modifications in
overlaybd
, runSimilarly, to include
accelerated-container-image
changes, useThen rebuild the sysext(s):
The new
flatcar-overlaybd.raw
sysext is now available in__build__/images/images/amd64-usr/latest
.TESTING
Testing is manual at this point because
kola
cannot (yet?) provision arbitrary system extensions to qemu test instances. Also, testing is limited to AMD64 as no overlaybd enabled ARM64 images are available on dockerhub.flatcar-overlaybd
extension on test instance. The sysext bakery'sbakery.sh boot
is particularly useful. In__build__/images/images/amd64-usr/latest
, run~/code/sysext-bakery/bakery.sh boot flatcar-overlaybd.raw
https://github.com/containerd/accelerated-container-image/blob/main/docs/QUICKSTART.md#run-overlaybd-images
and on a separate console run