-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gcc 12 warnings #5154
Comments
Also emit warnings for |
i see that on F37 as well |
I'm also getting these with |
On the same system, building with
|
We were also getting these with gcc 10 when building with ASan in #5139. |
The |
The Once this has been resolved, the rest will be done in one go. |
I only see the pkcs12 warning now (not using ASan or anything like that) but it drives me insane. I have stared at the code for hours, I see nothing wrong. All affected code actually fits on the screen so it's easy to review. I think we should do this: diff --git a/src/pkcs12_plug.c b/src/pkcs12_plug.c
index b9e6316ae..76fdf112b 100644
--- a/src/pkcs12_plug.c
+++ b/src/pkcs12_plug.c
@@ -416,6 +416,13 @@ static void pkcs12_fill_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX], siz
}
}
+/*
+ * Mute what appears to be a false positive in gcc 12-14, see #5154
+ */
+#if __GNUC__ >= 12 && __GNUC__ <= 14
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#endif
+
static int mbedtls_pkcs12_derivation_simd_sha1( unsigned char *data[SSE_GROUP_SZ_SHA1], size_t datalen,
const unsigned char *pwd[SSE_GROUP_SZ_SHA1], size_t pwdlen[SSE_GROUP_SZ_SHA1],
const unsigned char *salt, size_t saltlen, int id, int iterations ) As written we are purposefully forced to revisit for gcc-15 unless they fixed something. |
On another note we should drop the |
Once upon a time I created a patch that I think makes sense (based on my old C book) and the pfx format (a format that calls the functions) still works after the change (in AVX2). No performance regression and no warnings. diff --git a/src/pkcs12_plug.c b/src/pkcs12_plug.c
index b9e6316ae..134772444 100644
--- a/src/pkcs12_plug.c
+++ b/src/pkcs12_plug.c
@@ -372,7 +372,7 @@ int pkcs12_pbe_derive_key_simd_sha256( int iterations, int id, const unsigned ch
}
-static void pkcs12_fill_salt_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX], size_t data_len,
+static void pkcs12_fill_salt_buffer_simd(unsigned char *data[], size_t data_len,
const unsigned char *filler, size_t fill_len, int fill_count)
{
int j;
@@ -393,9 +393,9 @@ static void pkcs12_fill_salt_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX]
}
}
-static void pkcs12_fill_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX], size_t data_len,
- const unsigned char *filler[SIMD_MAX_GROUP_PFX],
- size_t fill_len[SIMD_MAX_GROUP_PFX], int fill_count)
+static void pkcs12_fill_buffer_simd(unsigned char *data[], size_t data_len,
+ const unsigned char *filler[],
+ size_t fill_len[], int fill_count)
{
int j;
unsigned char *p;
But, since it is SIMD, I'm probably missing something. |
I can't believe I didn't try that. I'll test it and amend my PR |
We're simply hiding the size from the compiler and pray the warnings are false positives. Kudos to Claudio, see openwall#5154
Yeah, it obviously works fine. Technically it's more or less the same thing though, we just silence the warnings and hope there isn't a real bug somewhere in there. I'm fairly confident there is no bug though, other than possibly in gcc. I replaced my "diagnostic ignored" patch with Claudio's in #5602 now. |
We're simply hiding the size from the compiler and pray the warnings are false positives. Kudos to Claudio, see #5154
Hi, not sure whether I fall back behind this discussion. On my MacStudio M1 I still get the blake2b_state error. Any help appreciated. ################### After
I stll get
|
Hi @falkuh. Your comment is off-topic for this issue. What you're running into was discussed in several other GitHub issues here, now closed. The reason you're still running into this problem is because you're trying to build our previous release from 2019, not latest code from this repo. Please update to the latest source code from this repo, or you may use a recent binary build for macOS from https://github.com/openwall/john-packages/releases |
Separately, I notice we had
|
Oh, and also why do we still have this issue about the warnings open? Haven't we fixed those via #5602? |
I get it correctly on the M1, current head 250498b
As for closing or not, I guess we could close this issue as only ASan builds show warnings (has been the case for years) but we could obviously try and fix them. |
gcc (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1)
I updated (some) CI builders to Fedora 36 (it is a
--disable-openmp
build)The text was updated successfully, but these errors were encountered: