Public bug reported:

---Problem Description---

On s390x, the iconv modules based on sysdeps/s390/multiarch/8bit-
generic.c like IBM1047.so may segfault in __to_generic_vx. There the
inline assembly declares R_TMP as plain output ("=d") without an early-
clobber, so the compiler may give it the same register as one of the
inputs. This is currently seen if glibc is build with -O1, but there is
no reason why it cannot happen with -O2/-O3/-Os (here it is just luck).
In this case, writing to the buffer with vst leads to writing to address
0x0 which segfaults.

Reproducer, when glibc built with -O1:
head -c16 /dev/zero | tr '\0' A | iconv -f UTF-8 -t IBM1047

See also upstream glibc bugzilla:
"Bug 34952 - s390x: ICE at -O1 caused by iconv segfault in __to_generic_vx"
https://sourceware.org/bugzilla/show_bug.cgi?id=34952

and upstream glibc commit which marks R_TMP as early-clobber ("=&d"):
"s390: Fix missing early-clobber in __to_generic_vx [BZ #34952]"
https://sourceware.org/git/?p=glibc.git;a=commit;h=ff45d05f8b0f3c8f576b2d3992263aad06488d40

** Affects: linux (Ubuntu)
     Importance: Undecided
     Assignee: Skipper Bug Screeners (skipper-screen-team)
         Status: New


** Tags: architecture-s39064 bugnameltc-225890 severity-high 
targetmilestone-inin---

** Tags added: architecture-s39064 bugnameltc-225890 severity-high
targetmilestone-inin---

** Changed in: ubuntu
     Assignee: (unassigned) => Skipper Bug Screeners (skipper-screen-team)

** Package changed: ubuntu => linux (Ubuntu)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2176181

Title:
  [UBUNTU 24.04] glibc: s390x: segfault in 8bit-generic.c iconv modules
  like IBM1047

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2176181/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to