You mention Centos8 kernels higher than linux-4.18.0-305.el8 are vulnerable however I just got the latest c8s iso from the official source and I'm getting this fsconfig: Invalid argument issue.
[sam@centos8 CVE-2021-4154]$ uname -a
Linux centos8 4.18.0-408.el8.x86_64 #1 SMP Mon Jul 18 17:42:52 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
[sam@centos8 CVE-2021-4154]$ gcc -pthread -o test exp.c
[sam@centos8 CVE-2021-4154]$ ./test
fsconfig: Invalid argument
[-] failed to write, retry...
fsconfig: Invalid argument
[-] failed to write, retry...
Additionally I've just installed Ubuntu 20.04, I get the same error as CentOS8Stream
sam@ubuntu:~/CVE-2021-4154$ uname -a
Linux ubuntu 5.4.0-124-generic #140-Ubuntu SMP Thu Aug 4 02:23:37 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
sam@ubuntu:~/CVE-2021-4154$ ./test
fsconfig: Invalid argument
[-] failed to write, retry...
fsconfig: Invalid argument
[-] failed to write, retry...
I'd expect it to fail on my labs older ubuntu box, as the kernel is lower than you mention, and the error is slightly different here (fsopen: Function not implemented)
sam@ubuntu:~/CVE-2021-4154$ uname -a
Linux ubuntu 4.15.0-88-generic #88-Ubuntu SMP Tue Feb 11 20:11:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
sam@ubuntu:~/CVE-2021-4154$ ./test
fsopen: Function not implemented
[-] failed to write, retry...
Is the error from the CentOS8Stream box stating it's not vulnerable, or that the code is failing somewhere after compilation?