[Pkg-samba-maint] liburing 2.3 breaks binary compatibility

Michael Tokarev mjt at tls.msk.ru
Tue Nov 8 12:51:17 GMT 2022


Source: liburing
Version: 2.3-1
Severity: grave

liburing 2.3 broke binary compatibility without bumping the soname.

In liburing.h in 2.3, structures io_uring_cq and io_uring_sq changed
their sizes. Both of these structures are parts of io_uring structure
which the main part of the API.  Here's the difference:

@@ -43,7 +79,9 @@
 struct io_uring_sq {
        unsigned *khead;
        unsigned *ktail;
+       // Deprecated: use `ring_mask` instead of `*kring_mask`
        unsigned *kring_mask;
+       // Deprecated: use `ring_entries` instead of `*kring_entries`
        unsigned *kring_entries;
        unsigned *kflags;
        unsigned *kdropped;
@@ -56,13 +94,18 @@
        size_t ring_sz;
        void *ring_ptr;
 
-       unsigned pad[4];
+       unsigned ring_mask;
+       unsigned ring_entries;
+
+       unsigned pad[2];
 };

...
struct io_uring {
  struct io_uring_sq sq;
  struct io_uring_cq cq;
  ...
}

So, a program which uses struct io_uring compiled with version 2.2 of the
library is completely incompatible when run with version 2.3 of the library,
and vise versa - since many user-visible members of this structure, even when
manipulated by the inline functions offered by uring.h, are completely
incompatible.

This breaks other software.  For example, samba compiled against liburing 2.3
will silently break when liburing 2.2 is used at the run time, and there's no
way for apt/dpkg to tell that liburing2.so upgrade is needed.  The same way,
samba compiled against liburing 2.2 breaks when liburing is upgraded to 2.3,
but in a different way.



More information about the Pkg-samba-maint mailing list