Discussion:
Detection of Compile-Time Self-Modifying Code
(too old to reply)
Ed Jaffe
2017-10-10 04:12:37 UTC
Permalink
Raw Message
Like most ISVs writing HLASM code, we use OPTABLE to ensure our
programmers don't accidentally use instructions that aren't available on
older machines that we must still support.

Currently, we're using OPTABLE(YOP) because our minimum supported OS is
z/OS 1.12. (It's not until z/OS 2.1 that we can leap ahead to the z9
machines.)

We recently terminated a reckless/destructive/rogue/cowboy programmer
who would routinely and subversively insert "land mines" into our code
without anyone knowing. Someone found another one this week:

|        DO UNTIL=NO                   Until all chars processed
|  * Until we break free from OPTABLE(YOP), the ORG game must be used
|          TROT  R14,R2                  Convert to hex
|          ORG   *-2                     ORG back to set M3 field
|          DC    X'10'                   M3 = 1 to suppress stopper
|          ORG   ,                       ORG back
|        ENDDO ,                       EndDo TROT

Obviously, the right way to code this would have been to use ACONTROL
OPTABLE with surrounding PUSH/POP to get the newer TROT function. But,
doing so could raise the visibility of the sabotage to the level where
someone might notice. So, he chose to alter the instruction via ORG/DC.
(IMHO, ORGing back to change an instruction is a form of self-modifying
code, which we don't allow.)

It might be nice if the assembler could generate an error or warning
message if an instruction is modified at compile time.

Thoughts?
--
Phoenix Software International
Edward E. Jaffe
831 Parkview Drive North
El Segundo, CA 90245
http://www.phoenixsoftware.com/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Ed Jaffe
2017-10-10 04:22:53 UTC
Permalink
Raw Message
Sorry. This was intended for ASSEMBLER-LIST. Please disregard...
[snip]
It might be nice if the assembler could generate an error or warning
message if an instruction is modified at compile time.
Thoughts?
--
Phoenix Software International
Edward E. Jaffe
831 Parkview Drive North
El Segundo, CA 90245
http://www.phoenixsoftware.com/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Loading...