s390guy / vm370

35 stars 10 forks source link

NUCEXT macro with SET, ORIGIN= and MF=(E,...) builds plist incorrectly, causing random storage overlays. #106

Open RossPatterson opened 2 months ago

RossPatterson commented 2 months ago

The NUCEXT macro, when coded with the the SET and MF=(E,...) options, can overlay random storage when the ORIGIN= option is coded with constant parameters (e.g., ORIGIN=(1234,...) or, more likely, ORIGIN=(...,0)). The ST instructions incorrectly include register 4 in computing the plist field address.

RossPatterson commented 2 months ago

The fix is pretty simple.

NUCEXT AUXLCL

RAP013DS ISSUE#106 PE HRC404DS NUCEXT SET ORIGIN= MF=(E,...) bad plist.

NUCEXT RAP013DS

./ R  02740000 02740000 $
         ST    15,28(,&REG)                                    RAP013DS
./ R  02770000 02770000 $
         ST    (&ORIGIN(1)),28(,&REG) Set Origin address       RAP013DS
./ R  02820000 02820000 $
         ST    15,32(,&REG)                                    RAP013DS
./ R  02850000 02850000 $
         ST    (&ORIGIN(2)),32(,&REG) Set Origin length        RAP013DS