From: "Albert D. Cahalan" <acahalan@cs.uml.edu>
To: davem@redhat.com (David S. Miller)
Cc: acahalan@cs.uml.edu (Albert D. Cahalan),
chris@scary.beasts.org (Chris Evans),
linux-kernel@vger.kernel.org
Subject: Re: Minor net/core/sock.c security issue?
Date: Tue, 24 Jul 2001 00:55:15 -0400 (EDT) [thread overview]
Message-ID: <200107240455.f6O4tF3283816@saturn.cs.uml.edu> (raw)
In-Reply-To: <15196.61008.690839.396406@pizda.ninka.net> from "David S. Miller" at Jul 23, 2001 08:41:04 PM
David S. Miller writes:
> Albert D. Cahalan writes:
>> Long term, __builtin_min() and __builtin_max() would be nice.
>
> I would even avoid this, what is the signedness of their
> arguments and return values? The answer is: I don't care,
> because I have to look it up.
>
> And if I have to look it up, I know that most people _won't_ look it
> up and will just guess or assume. Most people are therefore likely to
> misuse it.
The obvious answer is to enforce that the signedness of their
arguments and return values all match. Anything else won't compile.
This is safer than plain open code, because it forces the programmer
to fix any signedness mismatch.
The whole point of being built-in is that stuff like this can be
handled.
Possibly bad ideas:
The full range of signed/unsigned could be made to work, as if you
were using 33-bit or 65-bit signed math. It might even be sane to take
the return type from whatever is getting fed the return value. It
would be cool to use the exception tables if something goes out of
range, though maybe that would be too slow.
next prev parent reply other threads:[~2001-07-24 4:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-23 22:24 Chris Evans
2001-07-23 23:14 ` David S. Miller
2001-07-24 3:02 ` Albert D. Cahalan
2001-07-24 3:41 ` David S. Miller
2001-07-24 4:55 ` Albert D. Cahalan [this message]
2001-07-24 22:24 ` Alexey Kuznetsov
2001-07-27 9:56 ` David S. Miller
2001-07-27 16:44 ` kuznet
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=200107240455.f6O4tF3283816@saturn.cs.uml.edu \
--to=acahalan@cs.uml.edu \
--cc=chris@scary.beasts.org \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®