https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103242

            Bug ID: 103242
           Summary: Many new fortify-string.h:187:25: error: call to
                    '__read_overflow2' kernel build errors since:
                    r12-2591-g2e96b5f14e402569
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: aldyh at gcc dot gnu.org, amacleod at redhat dot com
  Target Milestone: ---

Created attachment 51793
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51793&action=edit
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.

Reply via email to