From: James Antill <jantill@redhat.com>
To: Daniel J Walsh <dwalsh@redhat.com>
Cc: SE Linux <selinux@tycho.nsa.gov>
Subject: Re: Real simple cache that removes most of the lookups in mcstrans
Date: Wed, 17 May 2006 12:56:35 -0400 [thread overview]
Message-ID: <1147884995.3469.154.camel@code.and.org> (raw)
In-Reply-To: <446B4D13.8080605@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]
On Wed, 2006-05-17 at 12:19 -0400, Daniel J Walsh wrote:
> Only reason strdup fails is ENOMEM. With ENOMEM you are almost
> garanteed you are going to crash anyways. gstrdup does a exit when it
> runs out of memory.
> So we can messy up the code with a lot of checks that end up doing
> little. Your choice.
Well, it doesn't currently fail that way ... and it's relying on a side
effect that sometimes happens.
Also the grep's I can see show the malloc/realloc/strdup failures being
handled, so without bugs in the application layer ENOMEM doesn't
currently mean a crash.
I'd be happy to do the diffs to add an internal
xstrdup()/xmalloc()/etc. which calls abort(), if that's the route we
want to go. As you say, this would significantly reduce the failure
paths ... although it might get libselinux banned from some
applications.
I'll also volunteer to do an audit and add the failure paths, if we
want to handle ENOMEM.
--
James Antill
<james.antill@redhat.com>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
next prev parent reply other threads:[~2006-05-17 16:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-17 10:45 Real simple cache that removes most of the lookups in mcstrans Daniel J Walsh
2006-05-17 12:26 ` Steve Grubb
2006-05-17 13:52 ` Joshua Brindle
2006-05-17 15:03 ` Daniel J Walsh
2006-05-17 15:15 ` Joshua Brindle
2006-05-17 16:21 ` Daniel J Walsh
2006-05-17 17:09 ` Joshua Brindle
2006-05-17 17:30 ` Steve Grubb
2006-05-17 17:32 ` Joshua Brindle
2006-05-19 13:32 ` Russell Coker
2006-05-19 13:51 ` Joshua Brindle
2006-05-19 14:07 ` Stephen Smalley
2006-05-19 14:40 ` Russell Coker
2006-05-20 21:47 ` Joshua Brindle
2006-05-21 3:31 ` Russell Coker
2006-05-22 18:04 ` Stephen Smalley
[not found] ` <1147879972.3469.139.camel@code.and.org>
2006-05-17 16:19 ` Daniel J Walsh
2006-05-17 16:56 ` James Antill [this message]
2006-05-17 17:06 ` Stephen Smalley
2006-05-18 16:21 ` Daniel J Walsh
2006-05-17 18:22 ` Daniel J Walsh
2006-05-22 20:45 ` Stephen Smalley
2006-05-17 18:35 ` Resent with correct patch Daniel J Walsh
2006-05-17 18:44 ` Stephen Smalley
2006-05-17 16:22 ` Real simple cache that removes most of the lookups in mcstrans James Antill
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=1147884995.3469.154.camel@code.and.org \
--to=jantill@redhat.com \
--cc=dwalsh@redhat.com \
--cc=selinux@tycho.nsa.gov \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.