[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Illegal Instruction Using sudo in Bookworm on i686



Hello all,

I have recently encountered a case where a VIA C3 Nehemaiah CPU returns "Illegal Instruction" when trying to run 'sudo' or 'visudo'.

After some poking around, I discovered that the FreeBSD folks have encountered this as well, and that it appears to be an issue with GCC where the --fcf-protection option results in the use of the ENDBR32 instruction, which is not supported on the VIA C3 Nehemaiah processor (despite being otherwise i686-compatible).

Here are the relevant threads that I found:

Similar issue in Gentoo:
https://bugs.gentoo.org/show_bug.cgi?id=862201

Similar issue in FreeBSD, more recent, but different processor:
https://forums.freebsd.org/threads/illegal-instruction-after-12-4-upgrade-i386.89353/

Relevant GCC commit:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=77d372abec0fbf2cfe922e3140ee3410248f979e

I did try rebuilding sudo from source, though it has been so long since I did that - I'm much more "sysadmin" than anything else these days - that I haven't had a chance to dive into the source and force it to build as "i486" or remove the --fcf-protection option.

The VIA C3 Nehemaiah chip is an i686-class chip, though it's a VIA (a.k.a. Cyrix) so I'm not entirely surprised that there are differences in its instruction set from the Intel chips.  I had a working bullseye installation and attempted to upgrade to bookworm when I ran into this issue.

Any other information I can provide that would help track this down?  I assume that the build environment used for creating the 32-bit packages just doesn't take this case into account.

Please advise.  Thanks in advance!

--J

Reply to: