Changeset 17fa7d6 in rtems


Ignore:
Timestamp:
Apr 23, 2012, 12:42:58 PM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.10
Children:
b6b8cd7
Parents:
a078d6f0
git-author:
Sebastian Huber <sebastian.huber@…> (04/23/12 12:42:58)
git-committer:
Gedare Bloom <gedare@…> (01/11/18 17:13:32)
Message:

librpc: PR2066: Fix for short enums

The XDR library has a problem on architectures with short enums like the
default ARM EABI. Short enums means that the size of the enum type is
variable and the smallest integer type to hold all enum values will be
selected. For many enums this is char. The XDR library uses int32_t
for enum_t. There are several evil casts from an enum type to enum_t
which leads to invalid memory accesses on short enum architectures. A
workaround is to add appropriate dummy enum values.

Location:
cpukit/librpc
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • cpukit/librpc/include/rpc/auth.h

    ra078d6f0 r17fa7d6  
    6767        */
    6868        AUTH_INVALIDRESP=6,             /* bogus response verifier */
    69         AUTH_FAILED=7                   /* some unknown reason */
     69        AUTH_FAILED=7,                  /* some unknown reason */
     70        _AUTH_STAT = 0xffffffff
    7071};
    7172
  • cpukit/librpc/include/rpc/clnt_stat.h

    ra078d6f0 r17fa7d6  
    7474        RPC_CANTCONNECT = 26,           /* couldn't make connection (cots) */
    7575        RPC_XPRTFAILED = 27,            /* received discon from remote (cots) */
    76         RPC_CANTCREATESTREAM = 28       /* can't push rpc module (cots) */
     76        RPC_CANTCREATESTREAM = 28,      /* can't push rpc module (cots) */
     77        _CLNT_STAT = 0xffffffff
    7778};
    7879
  • cpukit/librpc/include/rpc/rpc_msg.h

    ra078d6f0 r17fa7d6  
    5757enum msg_type {
    5858        CALL=0,
    59         REPLY=1
     59        REPLY=1,
     60        _MSG_TYPE = 0xffffffff
    6061};
    6162
    6263enum reply_stat {
    6364        MSG_ACCEPTED=0,
    64         MSG_DENIED=1
     65        MSG_DENIED=1,
     66        _REPLY_STAT = 0xffffffff
    6567};
    6668
     
    7173        PROC_UNAVAIL=3,
    7274        GARBAGE_ARGS=4,
    73         SYSTEM_ERR=5
     75        SYSTEM_ERR=5,
     76        _ACCEPT_STAT = 0xffffffff
    7477};
    7578
    7679enum reject_stat {
    7780        RPC_MISMATCH=0,
    78         AUTH_ERROR=1
     81        AUTH_ERROR=1,
     82        _REJECT_STAT = 0xffffffff
    7983};
    8084
  • cpukit/librpc/include/rpc/svc.h

    ra078d6f0 r17fa7d6  
    6767        XPRT_DIED,
    6868        XPRT_MOREREQS,
    69         XPRT_IDLE
     69        XPRT_IDLE,
     70        _XPRT_STAT = 0xffffffff
    7071};
    7172
  • cpukit/librpc/include/rpcsvc/nis_db.h

    ra078d6f0 r17fa7d6  
    7070        DB_MEMORY_LIMIT = 6,
    7171        DB_STORAGE_LIMIT = 7,
    72         DB_INTERNAL_ERROR = 8
     72        DB_INTERNAL_ERROR = 8,
     73        _DB_STATUS = 0xffffffff
    7374};
    7475typedef enum db_status db_status;
     
    8182        DB_NEXT = 4,
    8283        DB_ALL = 5,
    83         DB_RESET_NEXT = 6
     84        DB_RESET_NEXT = 6,
     85        _DB_ACTION = 0xffffffff
    8486};
    8587typedef enum db_action db_action;
  • cpukit/librpc/include/rpcsvc/yp_prot.h

    ra078d6f0 r17fa7d6  
    234234enum ypbind_resptype {
    235235        YPBIND_SUCC_VAL = 1,
    236         YPBIND_FAIL_VAL = 2
     236        YPBIND_FAIL_VAL = 2,
     237        _YPBIND_RESPTYPE = 0xffffffff
    237238};
    238239
  • cpukit/librpc/src/xdr/xdr.c

    ra078d6f0 r17fa7d6  
    459459{
    460460#ifndef lint
    461         enum sizecheck { SIZEVAL };     /* used to find the size of an enum */
    462 
    463461        /*
    464462         * enums are treated as ints
    465463         */
    466         if (sizeof (enum sizecheck) == sizeof (long)) {
     464        if (sizeof (enum_t) == sizeof (long)) {
    467465                return (xdr_long(xdrs, (long *)ep));
    468         } else if (sizeof (enum sizecheck) == sizeof (int)) {
     466        } else if (sizeof (enum_t) == sizeof (int)) {
    469467                return (xdr_int(xdrs, (int *)ep));
    470         } else if (sizeof (enum sizecheck) == sizeof (short)) {
     468        } else if (sizeof (enum_t) == sizeof (short)) {
    471469                return (xdr_short(xdrs, (short *)ep));
    472470        } else {
Note: See TracChangeset for help on using the changeset viewer.