public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Qing Zhao <qing.zhao@oracle.com>
To: Joseph Myers <joseph@codesourcery.com>,
	Jakub Jelinek <jakub@redhat.com>,
	"sandra@codesourcery.com" <sandra@codesourcery.com>
Cc: Siddhesh Poyarekar <siddhesh@gotplt.org>,
	Richard Biener <richard.guenther@gmail.com>,
	Kees Cook <keescook@chromium.org>,
	gcc Patches <gcc-patches@gcc.gnu.org>
Subject: Fwd: [V5][PATCH 0/2] Handle component_ref to a structure/union field including FAM for builtin_object_size
Date: Thu, 23 Mar 2023 13:02:17 +0000	[thread overview]
Message-ID: <C21E0BBE-4675-463A-93EF-5A7712A25AFF@oracle.com> (raw)
In-Reply-To: <20230316214715.604671-1-qing.zhao@oracle.com>

[-- Attachment #1: Type: text/plain, Size: 3230 bytes --]

Ping…

Please let me know if you have any further comments on the patch.

thanks.

Qing

Begin forwarded message:

From: Qing Zhao <qing.zhao@oracle.com<mailto:qing.zhao@oracle.com>>
Subject: [V5][PATCH 0/2] Handle component_ref to a structure/union field including FAM for builtin_object_size
Date: March 16, 2023 at 5:47:13 PM EDT
To: joseph@codesourcery.com<mailto:joseph@codesourcery.com>, jakub@redhat.com<mailto:jakub@redhat.com>, sandra@codesourcery.com<mailto:sandra@codesourcery.com>
Cc: rguenther@suse.de<mailto:rguenther@suse.de>, siddhesh@gotplt.org<mailto:siddhesh@gotplt.org>, keescook@chromium.org<mailto:keescook@chromium.org>, gcc-patches@gcc.gnu.org<mailto:gcc-patches@gcc.gnu.org>, Qing Zhao <qing.zhao@oracle.com<mailto:qing.zhao@oracle.com>>

Hi, Joseph, Jakub and Sandra,

Could you please review this patch and let me know whether it’s ready
for committing into GCC13?

The fix to Bug PR101832 is an important patch for kernel security
purpose. it's better to be put into GCC13.

===========================================

These are the 5th version of the patches for PR101832, to fix
builtin_object_size to correctly handle component_ref to a
structure/union field that includes a flexible array member.

also includes a documentation update for the GCC extension on embedding
a structure/union with flexible array member into another structure.
which includes a fix to PR77650.

compared to the 4th version of the patch, the major changes are:

1. Update the documentation per Sandra's comments and
suggestion.
2. per Richard's suggestion, let the new bit TYPE_INCLUDE_FLEXARRAY to
share the same bit with no_named_args_stdarg_p to save space in the IR.
and corresponding changes to support such sharing.
3. I also changed the code inside tree-object-size.cc<http://tree-object-size.cc> to make it cleaner
and easier to be understood.

bootstrapped and regression tested on aarch64 and x86.

Okay for commit?

thanks.

Qing

Qing Zhao (2):
 Handle component_ref to a structre/union field including  flexible
   array member [PR101832]
 Update documentation to clarify a GCC extension

gcc/c-family/c.opt                            |   5 +
gcc/c/c-decl.cc<http://c-decl.cc>                               |  19 +++
gcc/doc/extend.texi                           |  45 +++++-
gcc/lto/lto-common.cc<http://lto-common.cc>                         |   5 +-
gcc/print-tree.cc<http://print-tree.cc>                             |   5 +
.../gcc.dg/builtin-object-size-pr101832.c     | 134 ++++++++++++++++++
.../gcc.dg/variable-sized-type-flex-array.c   |  31 ++++
gcc/tree-core.h                               |   2 +
gcc/tree-object-size.cc<http://tree-object-size.cc>                       |  23 ++-
gcc/tree-streamer-in.cc<http://tree-streamer-in.cc>                       |   5 +-
gcc/tree-streamer-out.cc<http://tree-streamer-out.cc>                      |   5 +-
gcc/tree.h                                    |   7 +-
12 files changed, 280 insertions(+), 6 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-pr101832.c
create mode 100644 gcc/testsuite/gcc.dg/variable-sized-type-flex-array.c

--
2.31.1



      parent reply	other threads:[~2023-03-23 13:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-16 21:47 Qing Zhao
2023-03-16 21:47 ` [V5][PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832] Qing Zhao
2023-03-23 13:03   ` Fwd: " Qing Zhao
2023-03-23 18:55     ` Joseph Myers
2023-03-27 13:31       ` Qing Zhao
2023-03-27 14:22     ` Qing Zhao
2023-03-16 21:47 ` [V5][PATCH 2/2] Update documentation to clarify a GCC extension Qing Zhao
2023-03-23 13:05   ` Fwd: " Qing Zhao
2023-03-23 20:14     ` Joseph Myers
2023-03-27 13:38       ` Qing Zhao
2023-03-27 14:34         ` Xi Ruoyao
2023-03-27 15:37           ` Qing Zhao
2023-03-27 15:43         ` Jakub Jelinek
2023-03-27 15:57           ` Qing Zhao
2023-03-27 16:06             ` Jakub Jelinek
2023-03-27 16:22               ` Qing Zhao
2023-03-27 16:31                 ` Jakub Jelinek
2023-03-27 16:48                   ` Qing Zhao
2023-03-27 17:29                     ` Qing Zhao
2023-03-23 13:02 ` Qing Zhao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C21E0BBE-4675-463A-93EF-5A7712A25AFF@oracle.com \
    --to=qing.zhao@oracle.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=keescook@chromium.org \
    --cc=richard.guenther@gmail.com \
    --cc=sandra@codesourcery.com \
    --cc=siddhesh@gotplt.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).