public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/64741] New: Incorrect size of UBSan type descriptors
@ 2015-01-23  9:42 y.gribov at samsung dot com
  2015-01-23  9:54 ` [Bug sanitizer/64741] " y.gribov at samsung dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: y.gribov at samsung dot com @ 2015-01-23  9:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64741
           Summary: Incorrect size of UBSan type descriptors
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: y.gribov at samsung dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org,
                    ryabinin.a.a at gmail dot com

Created attachment 34540
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34540&action=edit
Proposed patch

UBSan uses incomplete type for all UBSan type descriptors:
 struct {
   short __typekind;
   short __typeinfo;
   char __typename[];
 };
and this causes DECL_SIZE to return invalid (too short) values for generated
globals. This later causes ASan to report invalid (again, too short) size to
__asan_register_globals when UBSan is enabled together with ASan.

This may not be a problem for userspace (because only libubsan accesses these
descriptors and it's not sanitized) but causes false positives for kernel
(https://lkml.org/lkml/2015/1/22/670).

I attach a silly fix - if it looks more or less fine, I'll do the regtesting
and fw to gcc-patches.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug sanitizer/64741] Incorrect size of UBSan type descriptors
  2015-01-23  9:42 [Bug sanitizer/64741] New: Incorrect size of UBSan type descriptors y.gribov at samsung dot com
@ 2015-01-23  9:54 ` y.gribov at samsung dot com
  2015-01-27 10:02 ` ygribov at gcc dot gnu.org
  2015-04-17  7:44 ` y.gribov at samsung dot com
  2 siblings, 0 replies; 4+ messages in thread
From: y.gribov at samsung dot com @ 2015-01-23  9:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Yury Gribov <y.gribov at samsung dot com> ---
*** Bug 64742 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug sanitizer/64741] Incorrect size of UBSan type descriptors
  2015-01-23  9:42 [Bug sanitizer/64741] New: Incorrect size of UBSan type descriptors y.gribov at samsung dot com
  2015-01-23  9:54 ` [Bug sanitizer/64741] " y.gribov at samsung dot com
@ 2015-01-27 10:02 ` ygribov at gcc dot gnu.org
  2015-04-17  7:44 ` y.gribov at samsung dot com
  2 siblings, 0 replies; 4+ messages in thread
From: ygribov at gcc dot gnu.org @ 2015-01-27 10:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from ygribov at gcc dot gnu.org ---
Author: ygribov
Date: Tue Jan 27 09:58:00 2015
New Revision: 220159

URL: https://gcc.gnu.org/viewcvs?rev=220159&root=gcc&view=rev
Log:
2015-01-27  Jakub Jelinek  <jakub@redhat.com>
        Yury Gribov  <y.gribov@samsung.com>

    PR ubsan/64741
    * ubsan.c (ubsan_source_location): Refactor code.
    (ubsan_type_descriptor): Update type size. Refactor code.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ubsan.c


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug sanitizer/64741] Incorrect size of UBSan type descriptors
  2015-01-23  9:42 [Bug sanitizer/64741] New: Incorrect size of UBSan type descriptors y.gribov at samsung dot com
  2015-01-23  9:54 ` [Bug sanitizer/64741] " y.gribov at samsung dot com
  2015-01-27 10:02 ` ygribov at gcc dot gnu.org
@ 2015-04-17  7:44 ` y.gribov at samsung dot com
  2 siblings, 0 replies; 4+ messages in thread
From: y.gribov at samsung dot com @ 2015-04-17  7:44 UTC (permalink / raw)
  To: gcc-bugs

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

Yury Gribov <y.gribov at samsung dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Yury Gribov <y.gribov at samsung dot com> ---
.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-17  7:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-23  9:42 [Bug sanitizer/64741] New: Incorrect size of UBSan type descriptors y.gribov at samsung dot com
2015-01-23  9:54 ` [Bug sanitizer/64741] " y.gribov at samsung dot com
2015-01-27 10:02 ` ygribov at gcc dot gnu.org
2015-04-17  7:44 ` y.gribov at samsung dot com

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).