CN101231599A - Method overwriting orientation specified main memory - Google Patents

Method overwriting orientation specified main memory Download PDF

Info

Publication number
CN101231599A
CN101231599A CNA2008100068314A CN200810006831A CN101231599A CN 101231599 A CN101231599 A CN 101231599A CN A2008100068314 A CNA2008100068314 A CN A2008100068314A CN 200810006831 A CN200810006831 A CN 200810006831A CN 101231599 A CN101231599 A CN 101231599A
Authority
CN
China
Prior art keywords
function
memory
particular memory
overwriting
task
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CNA2008100068314A
Other languages
Chinese (zh)
Other versions
CN101231599B (en
Inventor
杨利君
石江涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN2008100068314A priority Critical patent/CN101231599B/en
Publication of CN101231599A publication Critical patent/CN101231599A/en
Application granted granted Critical
Publication of CN101231599B publication Critical patent/CN101231599B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Storage Device Security (AREA)

Abstract

The invention provides a method that a positioned specific memory is illegally rewritten by a function, wherein, during the running of an embedded real-time operating system, exception processing of the function when the specific memory is rewritten is set in the specific memory function body which is not allowed to be visited, and corresponding processing and positioning are carried out when the specific memory is rewritten in the function. The method that the positioned specific memory is illegally rewritten by the function can better avoid the condition that the positioned specific memory is illegally rewritten but unknown to people, so as to improve the stability of the system.

Description

A kind of method of overwriting orientation specified main memory
Technical field
The present invention relates to the communications field, particularly a kind of method of overwriting orientation specified main memory.
Background technology
In communication technical field, what most of products adopted is embedded real-time operating system, for example operating system such as Linux, VxWorks.At the current data communication product, for example in router, switch and the BAS Broadband Access Server, all used the foundation stone of VxWorks as technician's exploitation, flat (FLAT) memorymodel based on VxWorks has been adopted in memory management, and all global variables, formation, chained list, pointer can directly be visited by all tasks.Even now can improve the efficient of communication between process or task, but it is unusual also probably to cause system's operation to occur simultaneously.
For fear of system's instability problem that above-mentioned shared drive brings, consider usually at present to use and forbid seizing, closing interruption or use the mode of semaphore to protect shared drive.
In above-mentioned three kinds of methods, forbid seizing the kernel task scheduling was temporarily lost efficacy, still, except interrupt routine, other task all can not be moved; When using semaphore to protect shared drive, do not forbid the operation of other task, only can allow the task suspension that has access to the shared drive resource,, can't prevent the visit of interrupt service routine yet critical resource although less to the system real time influence; Interrupt and close, above-mentioned relatively dual mode is more effective, it can prevent the conflict visit of other task or interrupt service routine fully, it is also the highest to carry out efficient, but, interruption can only be closed very short time, otherwise can cause system clock and other external event all can't correctly be handled, thereby reduces the real-time degree of system greatly.
In a word, specific shared drive is protected the shortcoming that all has separately, for this reason, need find a kind of more efficiently method that prevents that particular memory from illegally being rewritten by above-mentioned three kinds of modes.
Summary of the invention
The objective of the invention is to, a kind of method of overwriting orientation specified main memory is provided, can avoid and locate internal memory preferably, can improve system stability by the situation of illegally rewriting and not learning.
The method of overwriting orientation specified main memory of the present invention, wherein, in service at embedded real-time operating system, abnormality processing when in not allowing to visit the function body of particular memory, setting function and rewrite particular memory, and handle accordingly when in function, having carried out the operation of rewriting particular memory and locate.
Wherein, described abnormality processing when setting function rewrite particular memory in function body is for the illegal operation task suspension.
Wherein, described having carried out in function handled accordingly when the rewriting particular memory is operated and locatees, comprise the following steps: by the function of checking the operation task function in the calling system, check that current C PU goes up all tasks of operation, at the task of wherein being in suspended state, by the function of checking function call situation in the current task in the calling system, check the current function call storehouse situation of given task, know that particular memory rewritten by which function.
Further, can comprise the following steps:
Steps A: the page attribute that sets in advance place, particular memory space page or leaf is for writing;
Step B: system as function access or when rewriting particular memory, judges whether to allow described function access or rewriting in operational process, if not, and the abnormality processing when then in not allowing to visit the function body of particular memory, setting function and rewrite particular memory.
Wherein, before described steps A, may further include the following step: system is in initialization procedure, and setting a memory headroom is particular memory, and the size of memory headroom is unit with the page or leaf.
Wherein, in step B, in judged result is when allowing described function access or rewriting, can comprise the following steps: to carry out the beginning part of body at described function, write code and particular memory place page attribute is set for writing, described then function is carried out the programmed instruction of writing the particular memory operation, and carries out at function and when finishing memory attribute to be set and to withdraw from for after can not writing, and system normally moves.
In addition, described embedded real-time operating system is VxWorks system or linux system.
Wherein, in the VxWorks system, related function in the described system, comprise operation task in the system of checking the i function, check the tt function of function call situation in the current task and the ti function of checking the current task state.
The invention has the beneficial effects as follows: according to the method for overwriting orientation specified main memory of the present invention, can carry out write operation to important shared memory space by only allowing one or several function that legal write permission is arranged, for some function that is not authorized to, then increase at the abnormality processing mode of rewriting internal memory operation, thereby can avoid and locate internal memory preferably, can improve the stability of system by the situation of illegally rewriting and not learning.
Description of drawings
Fig. 1 is the illegal method flow diagram of rewriting of the location VxWorks particular memory minuend of the embodiment of the invention.
Embodiment
Below, be described in detail with reference to the attached drawings the method for overwriting orientation specified main memory of the present invention.
Core concept of the present invention is: for embedded real-time operating system, task shows as a function, this function is exactly the entrance function of task, each task has the storehouse of oneself, scheduling is seized in the operating system use or robin scheduling is dispatched the task in the system, and all tasks are moved in a unified linear address space.Therefore, the information when a lot of debug function that carry in the utilisation system are checked system's operation exception such as task suspension according to the reason of this information location tasks hang-up, thereby is dealt with problems rapidly.
Below, being example with the VxWorks system only describes the method for overwriting orientation specified main memory of the present invention, but the present invention is not limited thereto, can also comprise linux system etc.;
In the VxWorks system, the i function is for checking the function of moving in the system of task; The tt function is for checking the function of function call situation in the current task; The ti function is for checking the function of current task state.
As shown in Figure 1, be the illegal method flow diagram of rewriting of the location VxWorks particular memory minuend of the embodiment of the invention, this method comprises the following steps:
Step 101: the page attribute that place, particular memory space page or leaf is set is for writing;
Wherein, before step 101, may further include the following step: system is in initialization procedure, and setting a memory headroom is particular memory, and the size of memory headroom is unit with the page or leaf.
Step 102: system as function access or when rewriting this particular memory, judges whether to allow this function access or rewriting, if then execution in step 103 in operational process; Otherwise, execution in step 104;
Step 103: carry out the beginning part of body at this function, write code and particular memory place page attribute is set for writing, function is carried out the programmed instruction of writing the particular memory operation then, and carries out at function and to withdraw from function after memory attribute is set when finishing is to write;
Wherein, in step 103, when function is carried out end, mean that function also is through with to the rewriting of particular memory, at this moment, at the latter end of function body, write place, code particular memory space page attribute and be set to and can not write, withdraw from the execution of function at last, system normally moves.
Step 104: the abnormality processing when in function body, setting function rewriting particular memory in advance, for example,, and then judge whether write the particular memory operation in this function body with the illegal operation task suspension; If, and locate the function of this rewriting particular memory then with the illegal operation task suspension; Otherwise system normally moves.
Wherein, in step 104,, and locate the function of this rewriting particular memory, comprise the following steps: the illegal operation task suspension
Step 41: check the function of task in the calling system, check the task name or the task ID of hang-up;
Wherein, for the VxWorks system, the i function of checking the operation task function that can carry by calling system, check that current C PU goes up all tasks of operation, if the state of seeing certain task then shows it because unusual state has appearred in certain reason for hanging up (suspend);
Step 42:, rewrite the function of particular memory by calling particular system function location at the above-mentioned task of being in the suspend state.
Wherein, in step 42, for the VxWorks system, the tt function of the function call situation in the current task of checking that can carry by calling system, check the current function call storehouse situation of given task by " tt task name/task ID ", thereby know internal memory by which function is rewritten.
In sum, method according to overwriting orientation specified main memory of the present invention, can carry out write operation to important shared memory space by only allowing one or several function that legal write permission is arranged, for some function that is not authorized to, then increase at the abnormality processing mode of rewriting internal memory operation, thereby can avoid and locate internal memory preferably, can improve the stability of system by the situation of illegally rewriting and not learning.
More than be in order to make those of ordinary skills understand the present invention; and to detailed description that the present invention carried out; but can expect; in the scope that does not break away from claim of the present invention and contained, can also make other variation and modification, these variations and revising all in protection scope of the present invention.

Claims (8)

1. the method for an overwriting orientation specified main memory, it is characterized in that, in service at embedded real-time operating system, abnormality processing when in not allowing to visit the function body of particular memory, setting function and rewrite particular memory, and handle accordingly when in function, having carried out the operation of rewriting particular memory and locate.
2. the method for overwriting orientation specified main memory as claimed in claim 1 is characterized in that, described abnormality processing when setting function rewrite particular memory in function body is for the illegal operation task suspension.
3. the method for overwriting orientation specified main memory as claimed in claim 2 is characterized in that, described having carried out in function handled accordingly when the rewriting particular memory is operated and locate, and comprises the following steps:
By the function of checking the operation task function in the calling system, check that current C PU goes up all tasks of operation, at the task of wherein being in suspended state, by the function of checking function call situation in the current task in the calling system, check the current function call storehouse situation of given task, know that particular memory rewritten by which function.
4. the method for overwriting orientation specified main memory as claimed in claim 3 is characterized in that, further comprises the following steps:
Steps A: the page attribute that sets in advance place, particular memory space page or leaf is for writing;
Step B: system as function access or when rewriting particular memory, judges whether to allow described function access or rewriting in operational process, if not, and the abnormality processing when then in not allowing to visit the function body of particular memory, setting function and rewrite particular memory.
5. the method for overwriting orientation specified main memory as claimed in claim 4, it is characterized in that before described steps A, the system that further comprises the following steps: is in initialization procedure, setting a memory headroom is particular memory, and the size of memory headroom is unit with the page or leaf.
6. the method for overwriting orientation specified main memory as claimed in claim 4 is characterized in that, in step B, is when allowing described function access or rewriting, to comprise the following steps: in judged result
Carry out the beginning part of body at described function, write code and particular memory place page attribute is set for writing, described then function is carried out the programmed instruction of writing the particular memory operation, and carries out at function and when finishing memory attribute to be set and to withdraw from for after can not writing, and system normally moves.
7. the method for overwriting orientation specified main memory as claimed in claim 1 is characterized in that, described embedded real-time operating system is VxWorks system or linux system.
8. the method for overwriting orientation specified main memory as claimed in claim 7, it is characterized in that, in the VxWorks system, related function in the described system, comprise operation task in the system of checking the i function, check the tt function of function call situation in the current task and the ti function of checking the current task state.
CN2008100068314A 2008-02-02 2008-02-02 Method for positioning specific memory illegally rewritten by function Expired - Fee Related CN101231599B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008100068314A CN101231599B (en) 2008-02-02 2008-02-02 Method for positioning specific memory illegally rewritten by function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008100068314A CN101231599B (en) 2008-02-02 2008-02-02 Method for positioning specific memory illegally rewritten by function

Publications (2)

Publication Number Publication Date
CN101231599A true CN101231599A (en) 2008-07-30
CN101231599B CN101231599B (en) 2010-07-14

Family

ID=39898099

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008100068314A Expired - Fee Related CN101231599B (en) 2008-02-02 2008-02-02 Method for positioning specific memory illegally rewritten by function

Country Status (1)

Country Link
CN (1) CN101231599B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101515242B (en) * 2009-03-16 2011-08-10 中兴通讯股份有限公司 Method and system for searching and rewriting the task of internal memory
CN106502926A (en) * 2016-09-26 2017-03-15 华为技术有限公司 A kind of internal memory monitoring method, internal storage access controller and SoC systems
CN107862097A (en) * 2017-12-21 2018-03-30 上海新炬网络技术有限公司 A kind of table data intelligence method for cleaning based on TimesTen memory banks
CN108255746A (en) * 2017-12-29 2018-07-06 北京元心科技有限公司 Memory rewrites detection method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1180551C (en) * 2002-05-23 2004-12-15 华为技术有限公司 Fault location method of program mode
CN1275155C (en) * 2002-08-24 2006-09-13 中兴通讯股份有限公司 Abnormal failure location method in embedded operationi system
CN1295600C (en) * 2002-10-25 2007-01-17 华为技术有限公司 Windows program abnormality capturing and positioning method
CN1329836C (en) * 2004-05-26 2007-08-01 华为技术有限公司 Method for locating program abnormity

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101515242B (en) * 2009-03-16 2011-08-10 中兴通讯股份有限公司 Method and system for searching and rewriting the task of internal memory
CN106502926A (en) * 2016-09-26 2017-03-15 华为技术有限公司 A kind of internal memory monitoring method, internal storage access controller and SoC systems
CN106502926B (en) * 2016-09-26 2019-11-19 华为技术有限公司 A kind of internal memory monitoring method, internal storage access controller and SoC system
CN107862097A (en) * 2017-12-21 2018-03-30 上海新炬网络技术有限公司 A kind of table data intelligence method for cleaning based on TimesTen memory banks
CN108255746A (en) * 2017-12-29 2018-07-06 北京元心科技有限公司 Memory rewrites detection method and device

Also Published As

Publication number Publication date
CN101231599B (en) 2010-07-14

Similar Documents

Publication Publication Date Title
US10032024B2 (en) System and method for virtual partition monitoring
CN109558211B (en) Method for protecting interaction integrity and confidentiality of trusted application and common application
CN101351774B (en) Method, device and system for coloring page of memory and page associated pages with programs
US8336095B2 (en) User space virtualization system
CN105122260B (en) To the switching based on context of secure operating system environment
CN107949846A (en) The detection of malice thread suspension
CN107690645A (en) Use the behavior malware detection of interpreter virtual machine
CN100492300C (en) System and method for executing a process on a microprocessor-enabled device
EP3188065A1 (en) Secure intelligent terminal device and information processing method
US20090019437A1 (en) Application management and execution system and method thereof
WO2012088109A3 (en) Providing a security boundary
CN107301082B (en) Method and device for realizing integrity protection of operating system
CN108292272A (en) Device and method for managing bounded pointer
CN101231599B (en) Method for positioning specific memory illegally rewritten by function
CN103379481A (en) Method for achieving safety protection and firewall
CN105373734A (en) Application data protection method and apparatus
TWI678615B (en) Debugging in a data processing apparatus
CN104508676B (en) Mandatory protection control in virtual machine
CN105550029A (en) Process scheduling method and device
US8635664B2 (en) Method and system for securing application program interfaces in unified extensible firmware interface
CN109388485A (en) A kind of processing method, device, equipment and the storage medium of task execution thread
CN104272251A (en) Modify executable bits of system management memory page table
US20150127918A1 (en) Case secure computer architecture
CN104462898B (en) File destination guard method and device based on android system
CN103971064B (en) The user authority control method of Linux system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100714

Termination date: 20180202