Home | History | Annotate | Download | only in opencrypto
History log of /src/sys/opencrypto/criov.c
RevisionDateAuthorComments
 1.9  03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.8  24-Feb-2011  drochner branches: 1.8.54; 1.8.56;
Don't panic, just truncate, if the iov is too short in a COPYBACK.
This case can be triggered from userland cryptodev if the buffer
for decompressed data is too small.
(It would look cleaner if the lengths would be passed explicitely
everywhere, but that would thwart the abstraction done by COPYDATA/COPYBACK
which allows to treat mbufs and iovs the same way.)
 1.7  14-Mar-2009  dsl branches: 1.7.4; 1.7.6; 1.7.8;
ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.6  01-Feb-2008  tls branches: 1.6.10; 1.6.18; 1.6.24;
This code never worked on a released version of FreeBSD in the form it's
been in in our tree, and certainly does not work on any version of FreeBSD
now. Run through unifdef -D__NetBSD__ -U__FreeBSD__ yielding a small
reduction of size and a dramatic improvement in readability.

No, this does not yield any meaningful decrease in patchability (unlike
mechanical changes that touch live source lines) -- try it and see.
 1.5  04-Mar-2007  christos branches: 1.5.16; 1.5.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.4  11-Dec-2005  christos branches: 1.4.26;
merge ktrace-lwp.
 1.3  26-Feb-2005  perry branches: 1.3.4;
nuke trailing whitespace
 1.2  30-Jul-2003  lha branches: 1.2.4; 1.2.10; 1.2.12;
make the panic messages match reality
 1.1  25-Jul-2003  jonathan Commit initial NetBSD port of the OpenCrypto Framework (OCF). This
code is derived from Sam Leffler's FreeBSD port of OCF, which is in
turn a port of Angelos Keromytis's OpenBSD work.
Credit to Sam and Angelos, any blame for the NetBSD port to me.
 1.2.12.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.10.1  29-Apr-2005  kent sync with -current
 1.2.4.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.4.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.4.3  18-Sep-2004  skrll Sync with HEAD.
 1.2.4.2  03-Aug-2004  skrll Sync with HEAD
 1.2.4.1  30-Jul-2003  skrll file criov.c was added on branch ktrace-lwp on 2004-08-03 10:56:25 +0000
 1.3.4.2  04-Feb-2008  yamt sync with head.
 1.3.4.1  03-Sep-2007  yamt sync with head.
 1.4.26.1  12-Mar-2007  rmind Sync with HEAD.
 1.5.22.1  18-Feb-2008  mjf Sync with HEAD.
 1.5.16.1  23-Mar-2008  matt sync with HEAD
 1.6.24.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.6.18.1  28-Apr-2009  skrll Sync with HEAD.
 1.6.10.1  04-May-2009  yamt sync with head.
 1.7.8.1  05-Mar-2011  bouyer Sync with HEAD
 1.7.6.1  06-Jun-2011  jruoho Sync with HEAD.
 1.7.4.1  05-Mar-2011  rmind sync with head
 1.8.56.1  10-Jun-2019  christos Sync with HEAD
 1.8.54.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

RSS XML Feed