public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/17879] New: Library is missing memset_s
@ 2015-01-27  0:07 noloader at gmail dot com
  2015-01-27  0:47 ` [Bug libc/17879] " joseph at codesourcery dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: noloader at gmail dot com @ 2015-01-27  0:07 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17879

            Bug ID: 17879
           Summary: Library is missing memset_s
           Product: glibc
           Version: 2.20
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: noloader at gmail dot com
                CC: drepper.fsp at gmail dot com

memset_s is missing from the library.

I'm attempting to use memset_s to zero some memory. memset_s is guaranteed not
to be optimized away, so its appealing to use it rather than the alternatives. 
Zeroization is a process requirement, and I can't discard it.

bzero cannot be used because (1) its non-portable, and (2) its deprecated.

The volatile qualifier cannot be used because GCC interprets it to mean only
memory that can be changed by hardware (a more lenient interpretation by the
GCC folks would be very helpful. But it is what it is).

memset_s not available in 2.19:

  $ nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep memset_s
  $
  $ ls -l /lib/x86_64-linux-gnu/libc.so.6 lrwxrwxrwx 1 root root 12 Dec  4
14:31 /lib/x86_64-linux-gnu/libc.so.6 -> libc-2.19.so

And checking out the latest, memset_s is not available in 2.20 (or is it
2.21?):

  $ git clone git://sourceware.org/git/glibc.git
  $ cd glibc
  $ grep -R -w memset_s *
  $

I understand the safer functions from TR 24731-1 are not popular, but there
should be no objections for a memset function that is not optimized away
(correct me here, please).

Please provide the memset_s for safety and portability.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug libc/17879] Library is missing memset_s
  2015-01-27  0:07 [Bug libc/17879] New: Library is missing memset_s noloader at gmail dot com
@ 2015-01-27  0:47 ` joseph at codesourcery dot com
  2015-01-27  0:47 ` noloader at gmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: joseph at codesourcery dot com @ 2015-01-27  0:47 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17879

--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
New features should be proposed on libc-alpha, not in Bugzilla.  Please 
restart the discussions there, including a careful synthesis of the 
arguments from previous libc-alpha discussions of the issue to help the 
community in reaching consensus.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug libc/17879] Library is missing memset_s
  2015-01-27  0:07 [Bug libc/17879] New: Library is missing memset_s noloader at gmail dot com
  2015-01-27  0:47 ` [Bug libc/17879] " joseph at codesourcery dot com
@ 2015-01-27  0:47 ` noloader at gmail dot com
  2015-02-02 22:00 ` msebor at redhat dot com
  2015-08-27 22:25 ` [Bug string/17879] " jsm28 at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: noloader at gmail dot com @ 2015-01-27  0:47 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17879

Jeffrey Walton <noloader at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |noloader at gmail dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug libc/17879] Library is missing memset_s
  2015-01-27  0:07 [Bug libc/17879] New: Library is missing memset_s noloader at gmail dot com
  2015-01-27  0:47 ` [Bug libc/17879] " joseph at codesourcery dot com
  2015-01-27  0:47 ` noloader at gmail dot com
@ 2015-02-02 22:00 ` msebor at redhat dot com
  2015-08-27 22:25 ` [Bug string/17879] " jsm28 at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: msebor at redhat dot com @ 2015-02-02 22:00 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17879

Martin Sebor <msebor at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at redhat dot com

--- Comment #2 from Martin Sebor <msebor at redhat dot com> ---
The GCC -fno-builtin-memset option can be used to prevent compatible compilers
from optimizing away calls to memset that aren't strictly speaking necessary.

Regarding portability: memset_s is an optional feature of the C11 standard and
as such isn't really portable. (AFAIK, there also are no conforming C11
implementations that provide the optional Annex K in which the function is
defined.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug string/17879] Library is missing memset_s
  2015-01-27  0:07 [Bug libc/17879] New: Library is missing memset_s noloader at gmail dot com
                   ` (2 preceding siblings ...)
  2015-02-02 22:00 ` msebor at redhat dot com
@ 2015-08-27 22:25 ` jsm28 at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-08-27 22:25 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17879

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|libc                        |string

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

end of thread, other threads:[~2015-08-27 22:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-27  0:07 [Bug libc/17879] New: Library is missing memset_s noloader at gmail dot com
2015-01-27  0:47 ` [Bug libc/17879] " joseph at codesourcery dot com
2015-01-27  0:47 ` noloader at gmail dot com
2015-02-02 22:00 ` msebor at redhat dot com
2015-08-27 22:25 ` [Bug string/17879] " jsm28 at gcc dot gnu.org

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