Actions
Bug #8098
closedSome xdr_simple(3nsl) and xdr_complex(3nsl) functions can succeed for undefined xdrs->x_op values
Start date:
2017-04-23
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
External Bug:
Description
All xdr_simple(3nsl)
and xdr_complex(3nsl)
functions can succeed only in a case when xdrs->x_op
is either XDR_ENCODE
, XDR_DECODE
, or XDR_FREE
. For all other values in xdrs->x_op
they fails. This is not true in the following cases:
- the
xdr_hyper(3nsl)
function always succeeds for undefinedxdrs->x_op
values, - the
xdr_opaque(3nsl)
function always succeeds whencnt
is 0, - the
xdr_reference(3nsl)
function succeeds for undefinedxdrs->x_op
values in a case the passedxdrproc_t
routine succeeds for undefinedxdrs->x_op
values, - the
xdr_vector(3nsl)
function always succeeds whensize
is 0, or it succeed for undefinedxdrs->x_op
values in a case the passedxdrproc_t
routine succeeds for undefinedxdrs->x_op
values.
For convenience we should harden all of the above cases.
Files
Updated by Marcel Telka about 6 years ago
The problem is easily reproducible using the attached test.c file. All five calls to xdr functions succeeds, but they should fail:
$ ./test xdr_hyper: OK xdr_opaque: OK xdr_reference: OK xdr_vector: OK xdr_vector: OK $
With the fix, all calls fails:
$ LD_PRELOAD=$CODEMGR_WS/proto/root_i386/usr/lib/libnsl.so.1 ./test xdr_hyper: FAIL xdr_opaque: FAIL xdr_reference: FAIL xdr_vector: FAIL xdr_vector: FAIL $
Updated by Marcel Telka about 6 years ago
Updated by Marcel Telka about 6 years ago
- Status changed from In Progress to Pending RTI
Updated by Electric Monk about 6 years ago
- Status changed from Pending RTI to Closed
- % Done changed from 0 to 100
git commit 22cc57556161a28b2141976ff578db2558def3e1
commit 22cc57556161a28b2141976ff578db2558def3e1 Author: Marcel Telka <marcel@telka.sk> Date: 2017-05-03T21:21:34.000Z 8098 Some xdr_simple(3nsl) and xdr_complex(3nsl) functions can succeed for undefined xdrs->x_op values Reviewed by: Yuri Pankov <yuri.pankov@gmail.com> Reviewed by: Jason King <jason.brian.king+illumos@gmail.com> Reviewed by: Vitaliy Gusev <gusev.vitaliy@icloud.com> Approved by: Robert Mustacchi <rm@joyent.com>
Actions