All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pseudo: Fix attr errors due to incorrect library resolution issues
@ 2020-06-22 17:19 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2020-06-22 17:19 UTC (permalink / raw)
  To: openembedded-core

On a tumbleweed system, "install X Y" was showing the error:

pseudo: ENOSYS for 'fsetxattr'.

which was being caused by dlsym() for that function returning NULL. This
appears to be due to it finding an unresolved symbol in libacl for this
symbol in libattr. It hasn't been resolved so its NULL. dlerror() returns
nothing since this is a valid symbol entry, its just not the one we want.

We can add the glibc version string for the symbol we actually want so we get
that version rather than the libattr/libacl one. The calls in libattr are just
wrappers around the libc version so our attaching to the libc versions should
intercept any accesses via these too.

[YOCTO #13952]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 .../pseudo/files/xattr_version.patch          | 54 +++++++++++++++++++
 meta/recipes-devtools/pseudo/pseudo_git.bb    |  1 +
 2 files changed, 55 insertions(+)
 create mode 100644 meta/recipes-devtools/pseudo/files/xattr_version.patch

diff --git a/meta/recipes-devtools/pseudo/files/xattr_version.patch b/meta/recipes-devtools/pseudo/files/xattr_version.patch
new file mode 100644
index 00000000000..a8b14bdd699
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/xattr_version.patch
@@ -0,0 +1,54 @@
+On a tumbleweed system, "install X Y" was showing the error:
+
+pseudo: ENOSYS for 'fsetxattr'.
+
+which was being caused by dlsym() for that function returning NULL. This
+appears to be due to it finding an unresolved symbol in libacl for this 
+symbol in libattr. It hasn't been resolved so its NULL. dlerror() returns
+nothing since this is a valid symbol entry, its just not the one we want.
+
+We can add the glibc version string for the symbol we actually want so we get
+that version rather than the libattr/libacl one.
+
+To quote libattr:
+"""
+ These dumb wrappers are for backwards compatibility only.
+ Actual syscall wrappers are long gone to libc.
+"""
+and they are simply wrappers around the libc version so our attaching
+to the libc versions should intercept any accesses via these too.
+
+RP 2020/06/22
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org
+Upstream-Status: Pending [discussed with seebs on irc and appears the correct fix]
+
+
+Index: git/ports/linux/xattr/wrapfuncs.in
+===================================================================
+--- git.orig/ports/linux/xattr/wrapfuncs.in
++++ git/ports/linux/xattr/wrapfuncs.in
+@@ -1,12 +1,12 @@
+-ssize_t getxattr(const char *path, const char *name, void *value, size_t size); /* flags=0 */
+-ssize_t lgetxattr(const char *path, const char *name, void *value, size_t size); /* flags=AT_SYMLINK_NOFOLLOW */
+-ssize_t fgetxattr(int filedes, const char *name, void *value, size_t size);
+-int setxattr(const char *path, const char *name, const void *value, size_t size, int xflags); /* flags=0 */
+-int lsetxattr(const char *path, const char *name, const void *value, size_t size, int xflags); /* flags=AT_SYMLINK_NOFOLLOW */
+-int fsetxattr(int filedes, const char *name, const void *value, size_t size, int xflags);
+-ssize_t listxattr(const char *path, char *list, size_t size); /* flags=0 */
+-ssize_t llistxattr(const char *path, char *list, size_t size); /* flags=AT_SYMLINK_NOFOLLOW */
+-ssize_t flistxattr(int filedes, char *list, size_t size);
+-int removexattr(const char *path, const char *name); /* flags=0 */
+-int lremovexattr(const char *path, const char *name); /* flags=AT_SYMLINK_NOFOLLOW */
+-int fremovexattr(int filedes, const char *name);
++ssize_t getxattr(const char *path, const char *name, void *value, size_t size); /* flags=0, version="GLIBC_2.3" */ 
++ssize_t lgetxattr(const char *path, const char *name, void *value, size_t size); /* flags=AT_SYMLINK_NOFOLLOW, version="GLIBC_2.3" */
++ssize_t fgetxattr(int filedes, const char *name, void *value, size_t size); /* version="GLIBC_2.3" */
++int setxattr(const char *path, const char *name, const void *value, size_t size, int xflags); /* flags=0, version="GLIBC_2.3" */
++int lsetxattr(const char *path, const char *name, const void *value, size_t size, int xflags); /* flags=AT_SYMLINK_NOFOLLOW, version="GLIBC_2.3" */
++int fsetxattr(int filedes, const char *name, const void *value, size_t size, int xflags); /* version="GLIBC_2.3" */
++ssize_t listxattr(const char *path, char *list, size_t size); /* flags=0, version="GLIBC_2.3" */
++ssize_t llistxattr(const char *path, char *list, size_t size); /* flags=AT_SYMLINK_NOFOLLOW, version="GLIBC_2.3" */
++ssize_t flistxattr(int filedes, char *list, size_t size); /* version="GLIBC_2.3" */
++int removexattr(const char *path, const char *name); /* flags=0, version="GLIBC_2.3" */
++int lremovexattr(const char *path, const char *name); /* flags=AT_SYMLINK_NOFOLLOW, version="GLIBC_2.3" */
++int fremovexattr(int filedes, const char *name); /* version="GLIBC_2.3" */
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
index 324ae9071fe..419bac19fec 100644
--- a/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -13,6 +13,7 @@ SRC_URI = "git://git.yoctoproject.org/pseudo \
            file://seccomp.patch \
            file://0001-pseudo-On-a-DB-fixup-remove-files-that-do-not-exist-.patch \
            file://0001-pseudo_ipc.h-Fix-enum-typedef.patch \
+           file://xattr_version.patch \
            "
 
 SRCREV = "060058bb29f70b244e685b3c704eb0641b736f73"
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-22 17:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-22 17:19 [PATCH] pseudo: Fix attr errors due to incorrect library resolution issues Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.