COMPILATION LISTING OF SEGMENT ring_zero_peek_filter_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/17/82 1626.3 mst Wed Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 11 ring_zero_peek_filter_: 12 proc (from_pointer, to_pointer, word_count, code); 13 14 /* This is a ring-1 program which filters ring-0 peek requests 15* and passes valid requests to ring-0. Valid requests are those 16* whose target lies entirely within a region defined in a table 17* (>system_library_1>ring_zero_meter_limits.table). 18* This filter is intended to allow limited read access to ring-0 19* segments (for example, to users interested in metering information) 20* without giving away the entire (ring-0) farm. 21* 22* Re-written in December 80 by J. Bongiovanni for new table format */ 23 24 25 /* Parameter */ 26 27 dcl from_pointer ptr; /* pointer to ring-0 data */ 28 dcl to_pointer ptr; /* where to copy data to */ 29 dcl word_count fixed bin (19); /* number of words to copy */ 30 dcl code fixed bin (35); /* standard error code */ 31 32 /* Automatic */ 33 34 dcl begin_word fixed bin (19); 35 dcl end_word fixed bin (19); 36 dcl found_valid bit (1); 37 dcl save_level fixed bin (3); 38 dcl seg_no fixed bin; 39 dcl valid_length fixed bin (19); 40 dcl valid_pointer ptr; 41 42 /* Static */ 43 44 dcl meter_limits_table_ptr ptr int static init (null()); 45 dcl LIMITSEG_DIR char (17) init (">system_library_1") int static options (constant); 46 dcl LIMITSEG_NAME char (28) init ("ring_zero_meter_limits.table") int static options (constant); 47 48 /* Based */ 49 1 1 /* START OF: meter_limits.incl.pl1 * * * * * * * * * * * * * * * * */ 1 2 1 3 /* Table of metering limits for filtering metering_ring_zero_peek_ 1 4* requests. 1 5* 1 6* Written December 1980 by J. Bongiovanni */ 1 7 1 8 1 9 dcl mtablep ptr; 1 10 dcl mentryp ptr; 1 11 1 12 dcl 1 meter_limits_table aligned based (mtablep), /* table header */ 1 13 2 initialized bit (1), /* on=>table is valid */ 1 14 2 high_seg_no fixed bin, /* highest segment number in table */ 1 15 2 thread_head (0:0 refer (high_seg_no)) fixed bin (18); /* begin thread of entries this segment */ 1 16 1 17 dcl 1 meter_limits_entry aligned based (mentryp), /* defines a region which can be accessed */ 1 18 2 thread fixed bin (18), /* next entry this segment (0=>none) */ 1 19 2 begin_offset fixed bin (18) unsigned unal, /* begin word of accessible region */ 1 20 2 end_offset fixed bin (18) unsigned unal; /* last word of accessible region */ 1 21 1 22 1 23 1 24 /* END OF: meter_limits.incl.pl1 * * * * * * * * * * * * * * * * */ 51 52 /* Entry */ 53 54 dcl admin_ring_zero_peek_ entry (ptr, ptr, fixed bin (19)); 55 dcl get_ring_ entry() returns(fixed bin(3)); 56 dcl hcs_$initiate entry (char(*), char(*), char(*), fixed bin(1), fixed bin(2), ptr, fixed bin(35)); 57 dcl hcs_$level_get entry (fixed bin (3)); 58 dcl hcs_$level_set entry (fixed bin (3)); 59 60 61 /* External */ 62 63 dcl error_table_$bad_arg fixed bin (35) external; 64 dcl error_table_$no_info fixed bin (35) external; 65 dcl error_table_$segknown fixed bin (35) external; 66 67 /* Builtin */ 68 69 dcl baseno builtin; 70 dcl bin builtin; 71 dcl null builtin; 72 dcl ptr builtin; 73 dcl rel builtin; 74 75 76 /* */ 77 /* Initialize if this is the first call. Note that meter_limits_table.initialized 78* will be off if either the initialization program (initialize_peek_limits) 79* was never called, or if it encountered an irrecoverable error. 80* In either case, no access to ring-0 can be allowed through this filter */ 81 82 83 if meter_limits_table_ptr=null() then do; 84 call hcs_$level_get (save_level); 85 call hcs_$level_set (get_ring_ ()); /* Prevent user foolishness */ 86 call hcs_$initiate (LIMITSEG_DIR, LIMITSEG_NAME, "", 0, 1, meter_limits_table_ptr, code); 87 call hcs_$level_set (save_level); 88 if code^=0 89 then if code^=error_table_$segknown 90 then return; 91 else code = 0; 92 if ^meter_limits_table_ptr->meter_limits_table.initialized then do; /* table not valid */ 93 meter_limits_table_ptr = null(); /* set to try again on next call */ 94 code = error_table_$no_info; 95 return; 96 end; 97 end; 98 99 /* Copy ring-0 pointer and number of words so that caller can't change 100* them after we validate */ 101 102 valid_pointer = from_pointer; 103 valid_length = word_count; 104 105 106 if valid_length < 0 then do; 107 code = error_table_$bad_arg; 108 return; 109 end; 110 111 /* Check filter table to make sure request is entirely within a region 112* defined therein */ 113 114 mtablep = meter_limits_table_ptr; 115 seg_no = bin (baseno (valid_pointer), 17); 116 if seg_no<0 | seg_no>meter_limits_table.high_seg_no then do; 117 reject: 118 code = error_table_$no_info; 119 return; 120 end; 121 122 found_valid = "0"b; 123 begin_word = bin (rel (valid_pointer), 19); 124 end_word = begin_word + valid_length -1; 125 mentryp = ptr (mtablep, thread_head (seg_no)); 126 do while (^found_valid&mentryp^=mtablep); 127 if begin_word>=meter_limits_entry.begin_offset 128 & end_word<=meter_limits_entry.end_offset 129 then found_valid = "1"b; 130 mentryp = ptr (mtablep, meter_limits_entry.thread); 131 end; 132 133 if ^found_valid then goto reject; 134 code = 0; 135 136 call admin_ring_zero_peek_ (valid_pointer, to_pointer, valid_length); 137 138 return; 139 140 end ring_zero_peek_filter_; 141 142 143 144 145 146 SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/17/82 1626.3 ring_zero_peek_filter_.pl1 >spec>on>11/17/82>ring_zero_peek_filter_.pl1 50 1 03/18/81 2207.1 meter_limits.incl.pl1 >ldd>include>meter_limits.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. LIMITSEG_DIR 000007 constant char(17) initial unaligned dcl 45 set ref 86* LIMITSEG_NAME 000000 constant char(28) initial unaligned dcl 46 set ref 86* admin_ring_zero_peek_ 000012 constant entry external dcl 54 ref 136 baseno builtin function dcl 69 ref 115 begin_offset 1 based fixed bin(18,0) level 2 packed unsigned unaligned dcl 1-17 ref 127 begin_word 000100 automatic fixed bin(19,0) dcl 34 set ref 123* 124 127 bin builtin function dcl 70 ref 115 123 code parameter fixed bin(35,0) dcl 30 set ref 11 86* 88 88 91* 94* 107* 117* 134* end_offset 1(18) based fixed bin(18,0) level 2 packed unsigned unaligned dcl 1-17 ref 127 end_word 000101 automatic fixed bin(19,0) dcl 35 set ref 124* 127 error_table_$bad_arg 000024 external static fixed bin(35,0) dcl 63 ref 107 error_table_$no_info 000026 external static fixed bin(35,0) dcl 64 ref 94 117 error_table_$segknown 000030 external static fixed bin(35,0) dcl 65 ref 88 found_valid 000102 automatic bit(1) unaligned dcl 36 set ref 122* 126 127* 133 from_pointer parameter pointer dcl 27 ref 11 102 get_ring_ 000014 constant entry external dcl 55 ref 85 85 hcs_$initiate 000016 constant entry external dcl 56 ref 86 hcs_$level_get 000020 constant entry external dcl 57 ref 84 hcs_$level_set 000022 constant entry external dcl 58 ref 85 87 high_seg_no 1 based fixed bin(17,0) level 2 dcl 1-12 ref 116 initialized based bit(1) level 2 dcl 1-12 ref 92 mentryp 000112 automatic pointer dcl 1-10 set ref 125* 126 127 127 130* 130 meter_limits_entry based structure level 1 dcl 1-17 meter_limits_table based structure level 1 dcl 1-12 meter_limits_table_ptr 000010 internal static pointer initial dcl 44 set ref 83 86* 92 93* 114 mtablep 000110 automatic pointer dcl 1-9 set ref 114* 116 125 125 126 130 null builtin function dcl 71 ref 83 93 ptr builtin function dcl 72 ref 125 130 rel builtin function dcl 73 ref 123 save_level 000103 automatic fixed bin(3,0) dcl 37 set ref 84* 87* seg_no 000104 automatic fixed bin(17,0) dcl 38 set ref 115* 116 116 125 thread based fixed bin(18,0) level 2 dcl 1-17 ref 130 thread_head 2 based fixed bin(18,0) array level 2 dcl 1-12 ref 125 to_pointer parameter pointer dcl 28 set ref 11 136* valid_length 000105 automatic fixed bin(19,0) dcl 39 set ref 103* 106 124 136* valid_pointer 000106 automatic pointer dcl 40 set ref 102* 115 123 136* word_count parameter fixed bin(19,0) dcl 29 ref 11 103 NAMES DECLARED BY EXPLICIT CONTEXT. reject 000212 constant label dcl 117 ref 133 ring_zero_peek_filter_ 000035 constant entry external dcl 11 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 422 454 303 432 Length 656 303 32 165 116 2 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME ring_zero_peek_filter_ 114 external procedure is an external procedure. STORAGE FOR INTERNAL STATIC VARIABLES. LOC IDENTIFIER BLOCK NAME 000010 meter_limits_table_ptr ring_zero_peek_filter_ STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME ring_zero_peek_filter_ 000100 begin_word ring_zero_peek_filter_ 000101 end_word ring_zero_peek_filter_ 000102 found_valid ring_zero_peek_filter_ 000103 save_level ring_zero_peek_filter_ 000104 seg_no ring_zero_peek_filter_ 000105 valid_length ring_zero_peek_filter_ 000106 valid_pointer ring_zero_peek_filter_ 000110 mtablep ring_zero_peek_filter_ 000112 mentryp ring_zero_peek_filter_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. admin_ring_zero_peek_ get_ring_ hcs_$initiate hcs_$level_get hcs_$level_set THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$bad_arg error_table_$no_info error_table_$segknown LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000030 83 000042 84 000046 85 000054 86 000072 87 000137 88 000146 91 000154 92 000155 93 000160 94 000162 95 000164 102 000165 103 000171 106 000173 107 000174 108 000176 114 000177 115 000201 116 000205 117 000212 119 000216 122 000217 123 000220 124 000223 125 000226 126 000233 127 000243 130 000256 131 000262 133 000263 134 000265 136 000267 138 000302 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved