Bug 2000116

Summary: Provide american-fuzzy-lop package on s390x
Product: [Fedora] Fedora Reporter: Alexander Egorenkov <egorenar>
Component: american-fuzzy-lopAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 34CC: p, rjones
Target Milestone: ---   
Target Release: ---   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: american-fuzzy-lop-3.14c-5.fc34 american-fuzzy-lop-3.14c-5.fc35 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-09-13 03:41:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
AFL s390x support none

Description Alexander Egorenkov 2021-09-01 12:29:47 UTC
Hello,

is it possible to provide american-fuzzy-lop package on s390x ?
I was able to build it in LLVM mode and use it successfully on s390x.

Regards
Alex

Comment 1 Alexander Egorenkov 2021-09-01 12:32:44 UTC
Instructions how to build it:

dnf install -y llvm-devel clang-devel

curl -O https://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz
tar xvzf afl-latest.tgz
cd afl-2.52b

AFL_NO_X86=1 make
AFL_NO_X86=1 make -C llvm_mode

export AFL_PATH=~/afl-2.52b

Comment 2 Richard W.M. Jones 2021-09-01 12:44:00 UTC
Possibly.  What would help would be a patch to the
spec file which enables this.

Comment 3 Alexander Egorenkov 2021-09-01 14:41:56 UTC
Ok, i'll see what can be done, my first time changing a Fedora package :)

Comment 4 Alexander Egorenkov 2021-09-02 17:29:13 UTC
Created attachment 1820113 [details]
AFL s390x support

Comment 5 Alexander Egorenkov 2021-09-02 17:32:06 UTC
I managed to build an RPM on S390X and uploaded the SPEC patch i used.
I'm not familiar with Fedora package building, i think we need to add conditional statements to the SPEC
because on an architecture != x86, only afl-clang-fast and afl-clang-fast++ are available.
The wrappers afl-gcc, afl-g++, afl-clang and afl-clang++ are only for X86.

Comment 6 Richard W.M. Jones 2021-09-03 09:45:31 UTC
That patch disables x86 support.  However I adapted it a bit to
try to make it work with both.  Scratch build:

https://koji.fedoraproject.org/koji/taskinfo?taskID=75046930

Comment 7 Richard W.M. Jones 2021-09-03 09:56:13 UTC
Second try:
https://koji.fedoraproject.org/koji/taskinfo?taskID=75047887

Comment 8 Richard W.M. Jones 2021-09-03 10:10:25 UTC
Can you try out this package?
https://koji.fedoraproject.org/koji/taskinfo?taskID=75048287

Comment 9 Alexander Egorenkov 2021-09-03 10:18:57 UTC
Thank you very much.
I have to use fedora 36, right ? No way to install it on F34 ?

Comment 10 Alexander Egorenkov 2021-09-03 10:32:01 UTC
Nevermind, i'll setup a QEMU KVM instance, test it and report back.

Comment 11 Richard W.M. Jones 2021-09-03 10:32:59 UTC
I think it should be installable on F34.  You might have to upgrade
clang (only) though.

Comment 12 Alexander Egorenkov 2021-09-03 10:52:18 UTC
I installed F36 with QEMU KVM and then AFL packages.
But missing afl-clang-fast ?

[root@fedora ~]# rpm --install *.rpm
        package american-fuzzy-lop-debugsource-3.14c-4.fc36.s390x is already installed
        package american-fuzzy-lop-debuginfo-3.14c-4.fc36.s390x is already installed
        package american-fuzzy-lop-3.14c-4.fc36.s390x is already installed
        package american-fuzzy-lop-clang-3.14c-4.fc36.s390x is already installed
        package american-fuzzy-lop-clang-debuginfo-3.14c-4.fc36.s390x is already installed
[root@fedora ~]# afl-cmin
afl-cmin       afl-cmin.bash
[root@fedora ~]# afl-cmin
[root@fedora ~]# afl-
afl-analyze        afl-fuzz           afl-showmap        afl-whatsup
afl-cmin           afl-gotcpu         afl-system-config
afl-cmin.bash      afl-plot           afl-tmin

Comment 13 Richard W.M. Jones 2021-09-03 11:01:01 UTC
Weird, so they are actually symlinks to afl-cc and afl-c++.
Let's see if this one works:
https://koji.fedoraproject.org/koji/taskinfo?taskID=75051663

Comment 14 Alexander Egorenkov 2021-09-03 17:06:44 UTC
It looks good now.

[root@fedora ~]# afl-
afl-analyze        afl-clang-fast++   afl-gotcpu         afl-tmin
afl-c++            afl-cmin           afl-plot           afl-whatsup
afl-cc             afl-cmin.bash      afl-showmap
afl-clang-fast     afl-fuzz           afl-system-config

I also managed to get my fuzzing tests running on Fedora 36 with those packages.
Thanks a lot.

Comment 15 Alexander Egorenkov 2021-09-03 17:07:26 UTC
One question. The AFL packages for s390x will not be backported to F34 and F35 ?

Comment 16 Richard W.M. Jones 2021-09-03 17:20:27 UTC
Sure I can do them for f34 & f35.

Comment 17 Alexander Egorenkov 2021-09-03 17:24:34 UTC
Thank you.

Comment 18 Fedora Update System 2021-09-03 18:49:55 UTC
FEDORA-2021-7d2c9635ba has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-7d2c9635ba

Comment 19 Fedora Update System 2021-09-03 18:50:06 UTC
FEDORA-2021-09c130f5cb has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-09c130f5cb

Comment 20 Fedora Update System 2021-09-04 18:36:30 UTC
FEDORA-2021-09c130f5cb has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-09c130f5cb`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-09c130f5cb

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 21 Fedora Update System 2021-09-04 20:38:51 UTC
FEDORA-2021-7d2c9635ba has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-7d2c9635ba`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-7d2c9635ba

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 22 Alexander Egorenkov 2021-09-06 06:39:13 UTC
Tested F34 packages, it works. Thanks.

Comment 23 Fedora Update System 2021-09-13 03:41:35 UTC
FEDORA-2021-7d2c9635ba has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 24 Fedora Update System 2021-09-13 13:06:37 UTC
FEDORA-2021-7d2c9635ba has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 25 Fedora Update System 2021-09-24 20:15:18 UTC
FEDORA-2021-09c130f5cb has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.