Bug#1056399: libcryptx-perl: invalid opcode in CryptX.so

2023-11-24 Thread gregor herrmann
On Fri, 24 Nov 2023 16:24:04 +0100, Benedikt Spranger wrote:

> I rebuild the Package without these flags (-msse4.1 / -maes) and
> everything works as expected. I also removed the -maes flag, since AES
> is, like SSE4.1, is not part of the Debian amd64 architectural
> baseline. Patch is attached.

Thanks alot for the analysis and the patch!

Patch applied, package uploaded.
 

Cheers,
gregor

-- 
 .''`.  https://info.comodo.priv.at -- Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
   `-   


signature.asc
Description: Digital Signature


Bug#1056399: libcryptx-perl: invalid opcode in CryptX.so

2023-11-24 Thread Benedikt Spranger
Control: severity +1 serious
Control: patch

Dear maintainer,

while looking at the bug I recognized, that the AMD Athlon(tm) II X2
255 Processor is not capable to handle SSE4.1 opcodes. The SSE4.1 and
SSE4.2 support by AMD CPUs was introduced later.

I rebuild the Package without these flags (-msse4.1 / -maes) and
everything works as expected. I also removed the -maes flag, since AES
is, like SSE4.1, is not part of the Debian amd64 architectural
baseline. Patch is attached.

Regards
Benedikt Spranger
>From cc38f3d488f5cc108086ace53f66c0124fd9d95a Mon Sep 17 00:00:00 2001
From: Benedikt Spranger 
Date: Fri, 24 Nov 2023 15:31:12 +0100
Subject: [PATCH] Step back to Debian architectural baseline

libcryptx-perl is build with the compiler flags -sse4.1 and -maes.
SSE4.1 is supported by Intel CPUs, but not by all AMD CPUs. AMD CPUs
support SSE4a, which is not supported by Intel CPUs. The Debian
architectural baseline therefore states:

amd64	  x86_64 with no optional extensions (psABI baseline). The
	  core specification includes MMX, SSE and SSE2 so these
	  are OK, but SSE3 and up are not guaranteed.

	  See psABI (Table 3.1: Micro-Architecture Levels) for
	  amd64 ABI level.

Remove the SSE4.1 and AES compiler flags.

Signed-off-by: Benedikt Spranger 
---
 debian/patches/series|  1 +
 debian/patches/x86_64-baseline.patch | 10 ++
 2 files changed, 11 insertions(+)
 create mode 100644 debian/patches/series
 create mode 100644 debian/patches/x86_64-baseline.patch

diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index ..7f328d29
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+x86_64-baseline.patch
diff --git a/debian/patches/x86_64-baseline.patch b/debian/patches/x86_64-baseline.patch
new file mode 100644
index ..a1ca37d0
--- /dev/null
+++ b/debian/patches/x86_64-baseline.patch
@@ -0,0 +1,10 @@
+--- a/Makefile.PL
 b/Makefile.PL
+@@ -38,7 +38,6 @@
+ $ver1 ||= $1 if $Config{gccversion} =~ /^([0-9]+)\./; # gccversion='10.2.0'
+ $ver1 ||= $1 if $Config{gccversion} =~ /LLVM ([0-9]+)\./i; # gccversion='Apple LLVM 14.0.0 (clang-1400.0.29.202)'
+ $ver1 ||= $1 if $Config{gccversion} =~ /Clang ([0-9]+)\./i; # gccversion='FreeBSD Clang 13.0.0 (g...@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)' or 'OpenBSD Clang 13.0.0'
+-$mycflags .= " -msse4.1 -maes" if $ver1 > 4; # supported since gcc-4.4
+   }
+ 
+   #FIX: this is particularly useful for Debian https://github.com/DCIT/perl-CryptX/pull/39
-- 
2.42.0



Bug#1056399: libcryptx-perl: invalid opcode in CryptX.so

2023-11-22 Thread Benedikt Spranger
Package: libcryptx-perl
Version: 0.080-1
Severity: important
X-Debbugs-Cc: b.spran...@linutronix.de

Dear maintainer,

spamd fail due to an invalid opcode in CryptX.so on an AMD Athlon(tm) II X2
255 machine:

2023-11-21T13:16:47.795562+00:00 tanja kernel: [1127566.199310] traps: spamd 
child[12938] trap invalid opcode ip:7fd302f0e3a4 sp:7fffbb5af1f8 error:0 in 
CryptX.so[7fd302ebb000+9b000]

Regards
Benedikt Spranger

-- System Information:
Debian Release: trixie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.5.0-4-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

# lscpu
Architecture:x86_64
  CPU op-mode(s):32-bit, 64-bit
  Address sizes: 48 bits physical, 48 bits virtual
  Byte Order:Little Endian
CPU(s):  2
  On-line CPU(s) list:   0,1
Vendor ID:   AuthenticAMD
  BIOS Vendor ID:AMD
  Model name:AMD Athlon(tm) II X2 255 Processor
BIOS Model name: AMD Athlon(tm) II X2 255 Processor   CPU @ 3.1GHz
BIOS CPU family: 29
CPU family:  16
Model:   6
Thread(s) per core:  1
Core(s) per socket:  2
Socket(s):   1
Stepping:2
CPU(s) scaling MHz:  26%
CPU max MHz: 3100,
CPU min MHz: 800,
BogoMIPS:6227,51
Flags:   fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mc
 a cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall n
 x mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow cons
 tant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid pn
 i monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr
 8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs s
 kinit wdt hw_pstate vmmcall npt lbrv svm_lock nrip_save
Virtualization features:
  Virtualization:AMD-V
Caches (sum of all):
  L1d:   128 KiB (2 instances)
  L1i:   128 KiB (2 instances)
  L2:2 MiB (2 instances)
NUMA:
  NUMA node(s):  1
  NUMA node0 CPU(s): 0,1
Vulnerabilities:
  Gather data sampling:  Not affected
  Itlb multihit: Not affected
  L1tf:  Not affected
  Mds:   Not affected
  Meltdown:  Not affected
  Mmio stale data:   Not affected
  Retbleed:  Not affected
  Spec rstack overflow:  Not affected
  Spec store bypass: Not affected
  Spectre v1:Mitigation; usercopy/swapgs barriers and __user pointer
  sanitization
  Spectre v2:Mitigation; Retpolines, STIBP disabled, RSB filling, PB
 RSB-eIBRS Not affected
  Srbds: Not affected
  Tsx async abort:   Not affected

Versions of packages libcryptx-perl depends on:
ii  libc6   2.37-12
ii  perl [libmath-bigint-perl]  5.36.0-9
ii  perl-base [perlapi-5.36.0]  5.36.0-9

Versions of packages libcryptx-perl recommends:
ii  libjson-perl  4.1-1

libcryptx-perl suggests no packages.

-- no debconf information