Bug 103242 - [12 Regression] Many new fortify-string.h:187:25: error: call to '__read_overflow2' kernel build errors since: r12-2591-g2e96b5f14e402569
Summary: [12 Regression] Many new fortify-string.h:187:25: error: call to '__read_over...
Status: RESOLVED DUPLICATE of bug 101941
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 12.0
: P3 normal
Target Milestone: 12.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-15 09:23 UTC by Martin Liška
Modified: 2021-11-15 09:37 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 11.2.0
Known to fail: 12.0
Last reconfirmed: 2021-11-15 00:00:00


Attachments
Original unreduced test-case (207.64 KB, application/zstd)
2021-11-15 09:23 UTC, Martin Liška
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2021-11-15 09:23:23 UTC
Created attachment 51793 [details]
Original unreduced test-case

One can see it during kernel build. I tried isolating one test-case:

$ cat aesni-intel_glue.i
struct crypto_aes_ctx {
  int key_dec[16];
};

int rfc4106_set_hash_subkey_hash_subkey;

void __write_overflow();
void aes_encrypt();

void fortify_panic() __attribute__((__noreturn__)) __attribute__((__error__("")));

char *rfc4106_set_hash_subkey() {
  struct crypto_aes_ctx ctx;
  unsigned p_size =
      __builtin_object_size(rfc4106_set_hash_subkey_hash_subkey, 0);
  if (p_size < 16)
    __write_overflow();
  if (p_size < 16)
    fortify_panic(__func__);
  aes_encrypt(ctx);
  return (char *)rfc4106_set_hash_subkey;
}

$ gcc aesni-intel_glue.i -O2 -c -fconserve-stack -w
aesni-intel_glue.i: In function ‘rfc4106_set_hash_subkey.part.0’:
aesni-intel_glue.i:19:5: error: call to ‘fortify_panic’ declared with attribute error: 
   19 |     fortify_panic(__func__);
      |     ^~~~~~~~~~~~~~~~~~~~~~~

I'm also attaching the original unreduced test-case.
Comment 1 Andrew Pinski 2021-11-15 09:33:48 UTC
I think this is basically a dup of bug 101941.
Comment 2 Andrew Pinski 2021-11-15 09:37:42 UTC
Yes this is the same issue as PR 101941.

*** This bug has been marked as a duplicate of bug 101941 ***