RU2817547C1 - System and method of monitoring operability of processes in operating system - Google Patents

System and method of monitoring operability of processes in operating system Download PDF

Info

Publication number
RU2817547C1
RU2817547C1 RU2023130106A RU2023130106A RU2817547C1 RU 2817547 C1 RU2817547 C1 RU 2817547C1 RU 2023130106 A RU2023130106 A RU 2023130106A RU 2023130106 A RU2023130106 A RU 2023130106A RU 2817547 C1 RU2817547 C1 RU 2817547C1
Authority
RU
Russia
Prior art keywords
control flow
instructions
target process
target
operating system
Prior art date
Application number
RU2023130106A
Other languages
Russian (ru)
Inventor
Игорь Александрович Сорокин
Данила Андреевич Пучкин
Андрей Петрович Духвалов
Original Assignee
Акционерное общество "Лаборатория Касперского"
Filing date
Publication date
Application filed by Акционерное общество "Лаборатория Касперского" filed Critical Акционерное общество "Лаборатория Касперского"
Application granted granted Critical
Publication of RU2817547C1 publication Critical patent/RU2817547C1/en

Links

Abstract

FIELD: information security.
SUBSTANCE: result is achieved due to steps, according to which: converting the source code of the program into an equivalent machine code; constructing control flow graphs, which reflect the structure and syntax of the source code of the program; converting control flow graphs into call flow graphs using target instructions received from the operating system; generating at least one control flow signature based on the generated call flow graphs; starting a control flow monitor, after which a target process corresponding to said program is launched in the operating system; intercepting, by means of a control flow monitor, instructions of said program executed by the target process; checking the intercepted instructions for compliance with at least one control flow signature of said target process; if the instructions of the target process do not match the signature of the control flow, an error in the operation of the target process is determined.
EFFECT: high efficiency of detecting malfunction of a process in an operating system.
11 cl, 7 dwg

Description

Область техникиTechnical field

Изобретение относится к области информационной безопасности, а более конкретно к способам контроля работоспособности процессов в операционной системе компьютерной системы.The invention relates to the field of information security, and more specifically to methods for monitoring the performance of processes in the operating system of a computer system.

Уровень техникиState of the art

Вредоносное программное обеспечение постоянно развивается, побуждая поставщиков услуг информационной безопасности не отставать от постоянно меняющегося ландшафта угроз. В том числе злоумышленники развивают и пути распространения вредоносного программного обеспечения (ПО), используя новые уязвимости для проникновения в компьютерную систему.Malware is constantly evolving, challenging information security service providers to keep up with the ever-changing threat landscape. Among other things, attackers are developing ways to distribute malicious software (software), using new vulnerabilities to penetrate a computer system.

В настоящий момент используются различные варианты атак на конечные узлы компьютерной сети (компьютерные системы). Например, атака внедрения вредоносного кода или атака переполнения буфера стека может привести к нарушению целостности данных и/или нарушению работоспособности процессов в операционной системе или самой операционной системы в целом. Для защиты конечных узлов компьютерной сети используются различные решения, например антивирусы, а также класс решений для обнаружения и изучения вредоносной активности на конечных узлах (англ. Endpoint Detection and Response или EDR). Подобные решения позволяют анализировать файлы с использованием статических и динамических методов для выявления аномалий поведения, эксплуатации уязвимостей и т. д. Указанные нарушения в том или ином виде влияют на работоспособность процессов, и следовательно могут быть обнаружены в процессе выполнения.Currently, various types of attacks are used on the end nodes of a computer network (computer systems). For example, a malicious code injection attack or a stack buffer overflow attack can lead to data corruption and/or disruption of processes in the operating system or the operating system itself as a whole. To protect the end nodes of a computer network, various solutions are used, for example, antiviruses, as well as a class of solutions for detecting and studying malicious activity on end nodes (English: Endpoint Detection and Response or EDR). Such solutions allow you to analyze files using static and dynamic methods to identify behavioral anomalies, exploit vulnerabilities, etc. These violations in one form or another affect the performance of processes, and therefore can be detected during execution.

Одним из признаков нарушения работоспособности процесса является нарушение потока управления процесса, а именно нарушение последовательности исполняемых инструкций, заложенных в соответствующую процессу программу компьютерной системы. Таким образом, контроль потока управления процесса может быть использован для мониторинга его работоспособности.One of the signs of a process malfunction is a violation of the control flow of the process, namely a violation of the sequence of executable instructions embedded in the computer system program corresponding to the process. Thus, controlling the control flow of a process can be used to monitor its health.

Из уровня техники известно решение, предназначенное для отслеживания потока управления, представленное в патентной заявке WO2009154498A1. В данной публикации описан способ контроля работы процесса в операционной системе на основании графа потока управления (англ. control flow graph, CFG), полученного от компилятора во время компиляции программы. На основании последовательности инструкций, которые выполняются поочередно и не могут быть прерваны или пропущены в процессе выполнения программы, создают сигнатуры с целью контроля работоспособности процесса. Однако для осуществления контроля работы процесса с помощью описанного в WO2009154498A1 способа необходимо инструментирование кода. Под инструментированием кода подразумевается изменение байт-кода программы с целью создания методов сбора информации или выполнения дополнительных действий до исполнения, во время исполнения или после исполнения основной программы.A solution for monitoring control flow is known from the prior art and is presented in patent application WO2009154498A1. This publication describes a method for controlling the operation of a process in an operating system based on a control flow graph (CFG) received from the compiler during program compilation. Based on a sequence of instructions that are executed one by one and cannot be interrupted or skipped during program execution, signatures are created to monitor the health of the process. However, to monitor the operation of the process using the method described in WO2009154498A1, it is necessary to instrument the code. Code instrumentation refers to changing the bytecode of a program in order to create methods for collecting information or performing additional actions before execution, during execution, or after execution of the main program.

Подходы, использующие инструментирование кода, имеют ряд недостатков. Во-первых, требуется внедрение в приложение стороннего кода, который требует контроля. Внедрение стороннего кода требует как временных затрат, так и ресурсов, а также приложение становится более сложным в обслуживании. Во-вторых, инструментирование кода в ряде случаев влияет на стабильность работы приложения и совместимость с будущими обновлениями. В-третьих, использование инструментирования кода связано с рисками безопасности приложения. Внесение изменений в исходный код приложения может создать уязвимости, которые могут быть использованы злоумышленниками.Approaches that use code instrumentation have a number of disadvantages. First, it requires the introduction of third-party code into the application, which requires control. Implementing third-party code requires both time and resources, and the application becomes more difficult to maintain. Secondly, instrumenting code in some cases affects the stability of the application and compatibility with future updates. Third, using code instrumentation comes with application security risks. Making changes to an application's source code can create vulnerabilities that can be exploited by attackers.

Ещё одно решение представлено в патенте US10372902B2. В данной публикации говорится о способе контроля работы процесса на основе графа потока управления, причем в отличие от публикации, представленной выше, информацию о фактическом потоке управления получают от процессора, а не от операционной системы. Однако данный подход не позволяет контролировать работу процесса на недоверенном аппаратном обеспечении, а также ограничивается контролем только на основании анализа машинных команд.Another solution is presented in patent US10372902B2. This publication talks about a way to control the operation of a process based on a control flow graph, and unlike the publication presented above, information about the actual control flow is obtained from the processor, and not from the operating system. However, this approach does not allow monitoring the operation of a process on untrusted hardware, and is also limited to monitoring only based on the analysis of machine commands.

Представленные решения осуществляют контроль работоспособности процесса, однако и имеют ряд недостатков, в частности использование инструментирования кода. Поэтому есть необходимость в решениях, которые, с одной стороны, позволяли бы осуществлять контроль работоспособности процесса, а с другой стороны, устраняли бы существующие недостатки.The presented solutions monitor the performance of the process, however, they also have a number of disadvantages, in particular the use of code instrumentation. Therefore, there is a need for solutions that, on the one hand, would allow monitoring the performance of the process, and on the other hand, would eliminate existing shortcomings.

Раскрытие сущности изобретенияDisclosure of the invention

Настоящее изобретение было выполнено с учётом описанных выше проблем, и цель настоящего изобретения состоит в том, чтобы обнаружить ошибку в работоспособности процессов в операционной системе, в частности обнаружить невыполнение по меньшей мере одной из инструкций, или выполнение недопустимой инструкции. Настоящее изобретение позволяет обеспечить надежность (безотказность) в работе процессов за счет контроля работоспособности процессов посредством мониторинга потока управления с использованием сформированных моделей процессов потока управления. В качестве модели процесса понимается некий образец или сигнатура. Сигнатура контролируемого процесса включает возможные последовательности исполнения инструкций, при этом набор содержащихся в сигнатуре инструкций определяется возможностями мониторинга потока управления контролируемого процесса. В зависимости от варианта реализации сигнатура может иметь вид как графа потока управления функций или набора графов, так и формально-языкового описания или конечного автомата.The present invention has been made in view of the problems described above, and the purpose of the present invention is to detect an error in the performance of processes in an operating system, in particular to detect the failure of at least one of the instructions, or the execution of an invalid instruction. The present invention makes it possible to ensure reliability (non-failure operation) in the operation of processes by monitoring the performance of processes by monitoring the control flow using generated models of control flow processes. A process model is understood as a certain pattern or signature. The signature of a controlled process includes possible sequences of execution of instructions, and the set of instructions contained in the signature is determined by the capabilities of monitoring the control flow of the controlled process. Depending on the implementation option, the signature can take the form of either a function control flow graph or a set of graphs, or a formal language description or a finite automaton.

Технический результат настоящего изобретения заключается в повышении эффективности обнаружения нарушения работоспособности процесса в операционной системе за счет контроля работоспособности процессов в операционной системе на основе мониторинга потока управления при помощи сформированных моделей процессов.The technical result of the present invention is to increase the efficiency of detecting process failure in the operating system by monitoring the performance of processes in the operating system based on control flow monitoring using generated process models.

В качестве одного варианта исполнения настоящего изобретения предлагается способ контроля работоспособности процессов в операционной системе для выявления ошибок в работе процессов, причем способ осуществляется в аппаратном процессоре, при этом способ содержит этапы, согласно которым: преобразовывают исходный код программы в эквивалентный машинный код; строят графы потока управления, которые отражают структуру и синтаксис исходного кода программы; преобразовывают графы потока управления в графы потока вызовов с использованием целевых инструкций, полученных от операционной системы; генерируют по меньшей мере одну сигнатуру потока управления на основании сформированных графов потока вызовов; запускают монитор потока управления, после чего в операционной системе запускают целевой процесс, соответствующий указанной программе; перехватывают с помощью монитора потока управления исполняемые целевым процессом инструкции указанной программы; проверяют перехваченные инструкции на соответствие по меньшей мере одной сигнатуре потока управления указанного целевого процесса; при несоответствии инструкций целевого процесса сигнатуре потока управления определяют ошибку в работе целевого процесса.As one embodiment of the present invention, there is proposed a method for monitoring the performance of processes in an operating system to identify errors in the operation of processes, the method being implemented in a hardware processor, the method comprising the steps of: converting the source code of the program into equivalent machine code; build control flow graphs that reflect the structure and syntax of the program source code; converting control flow graphs into call flow graphs using target instructions received from the operating system; generating at least one control flow signature based on the generated call flow graphs; launching a control flow monitor, after which a target process corresponding to the specified program is launched in the operating system; intercept instructions of the specified program executed by the target process using a control flow monitor; checking the intercepted instructions against at least one control flow signature of the specified target process; if the instructions of the target process do not match the control flow signature, an error in the operation of the target process is determined.

В другом варианте реализации способа преобразовывают исходный код программы в эквивалентный машинный код посредством компилятора или интерпритатора.In another embodiment of the method, the source code of the program is converted into equivalent machine code using a compiler or interpreter.

В ещё одном варианте реализации способа при определении ошибки в работе целевого процесса осуществляют перезапуск целевого процессаIn another embodiment of the method, when an error is detected in the operation of the target process, the target process is restarted

В другом варианте реализации способа определяют ошибку в целевом процессе, связанную с одним из: невыполнением по меньшей мере одной из ожидаемых инструкций; выполнением недопустимой инструкции.In another embodiment of the method, an error in the target process associated with one of: failure to execute at least one of the expected instructions is determined; executing an illegal instruction.

В ещё одном варианте реализации способа ожидаемыми инструкциями являются инструкции, полученные от операционной системы, в рамках которой реализован контроль работоспособности целевого процесса.In another embodiment of the method, the expected instructions are instructions received from the operating system, within which the performance control of the target process is implemented.

В другом варианте реализации способа недопустимой инструкцией является любая инструкция, которая не содержится в исходном коде.In another embodiment of the method, an invalid instruction is any instruction that is not contained in the source code.

В ещё одном варианте реализации способа преобразовывают граф потока управления в графы потока вызовов путем исключения из блоков программного кода графов потока управления инструкций, которые не являются целевыми инструкциями или вызовами функций.In yet another embodiment of the method, the control flow graph is converted into call flow graphs by excluding instructions from the program code blocks of the control flow graphs that are not target instructions or function calls.

В другом варианте реализации способа генерируют сигнатуру потока управления, по меньшей мере одним из способов: объединением графов потока вызовов и связей графов потока вызовов; путем преобразования по меньшей мере одного графа потока вызовов к виду конечного автомата вызовов целевых инструкций.In another embodiment of the method, a control flow signature is generated in at least one of the following ways: by combining call flow graphs and call flow graph connections; by transforming the at least one call flow graph to a state machine view of the calls of the target instructions.

В ещё одном варианте реализации способа генерируют сигнатуру потока управления путем формирования совокупности графов потока вызовов, при этом совокупность графов потока вызовов формируют путем последовательной замены базовых блоков с целевыми инструкциями на соответствующие им графы потока вызовов.In another embodiment of the method, a control flow signature is generated by generating a set of call flow graphs, wherein the set of call flow graphs is formed by sequentially replacing basic blocks with target instructions with their corresponding call flow graphs.

В другом варианте реализации способа при выявлении ошибки в работе целевого процесса останавливают работу процесса.In another embodiment of the method, when an error is detected in the operation of the target process, the operation of the process is stopped.

В качестве другого варианта исполнения настоящего изобретения предлагается система контроля работоспособности процессов операционной системы для выявления ошибок в работе процессов, состоящая из компьютерного устройства с аппаратным процессором, настроенным для выполнения способа по любому из указанных выше вариантов реализации.As another embodiment of the present invention, there is proposed a system for monitoring the health of operating system processes to detect errors in the operation of processes, consisting of a computer device with a hardware processor configured to perform the method according to any of the above embodiments.

Краткое описание чертежейBrief description of drawings

Прилагаемые чертежи иллюстрируют только примерные варианты осуществления изобретения, и поэтому не должны считаться ограничивающими его объем. Дополнительные цели, признаки и преимущества настоящего изобретения будут очевидными из прочтения последующего описания осуществления изобретения со ссылкой на прилагаемые чертежи, на которых:The accompanying drawings illustrate only exemplary embodiments of the invention and therefore should not be considered limiting its scope. Additional objects, features and advantages of the present invention will become apparent from a reading of the following description of the invention with reference to the accompanying drawings, in which:

Фиг. 1 иллюстрирует систему, реализующую способ контроля работоспособности процессов в операционной системе. Fig. 1 illustrates a system that implements a method for monitoring the health of processes in an operating system.

Фиг. 2 иллюстрирует преобразование графа потока управления в граф потока вызова для функции main(). Fig. Figure 2 illustrates the transformation of a control flow graph into a call flow graph for the main() function.

Фиг. 3 иллюстрирует преобразование графа потока управления в граф потока вызова для функции sleep(). Fig. Figure 3 illustrates the transformation of a control flow graph into a call flow graph for the sleep() function.

Фиг. 4 иллюстрирует преобразование графа потока управления в граф потока вызова для функции nanosleep(). Fig. Figure 4 illustrates the transformation of a control flow graph into a call flow graph for the nanosleep() function.

Фиг. 5 иллюстрирует преобразование графа потока управления в граф потока вызова для функции errno(). Fig. Figure 5 illustrates the transformation of a control flow graph into a call flow graph for the errno() function.

Фиг. 6 иллюстрирует способ контроля работоспособности процессов в операционной системе. Fig. 6 illustrates a method for monitoring the health of processes in an operating system.

Фиг. 7 показывает пример компьютерной системы, с помощью которой может быть реализовано настоящее изобретение для контроля работоспособности процессов. Fig. 7 shows an example of a computer system with which the present invention can be implemented to monitor the performance of processes.

Осуществление изобретенияCarrying out the invention

Объекты и признаки настоящего изобретения, способы для достижения этих объектов и признаков станут очевидными посредством отсылки к примерным вариантам осуществления. Однако настоящее изобретение не ограничивается примерными вариантами осуществления, раскрытыми ниже, оно может воплощаться в различных видах. Сущность, приведенная в описании, является не чем иным, как конкретными деталями, необходимыми для помощи специалисту в области техники в исчерпывающем понимании изобретения, и настоящее изобретение определяется в объеме приложенной формулы.Objects and features of the present invention, methods for achieving these objects and features will become apparent by reference to exemplary embodiments. However, the present invention is not limited to the exemplary embodiments disclosed below, but may be embodied in various forms. The substance set forth in the specification is nothing more than the specific details necessary to assist one skilled in the art in fully understanding the invention, and the present invention is defined within the scope of the appended claims.

ГлоссарийGlossary

Граф потока управления (англ. control flow graph или CFG) - это представление алгоритма исходного кода функции компилируемой программы в виде графа, которое отображает поток управления в исходном коде упомянутой функции. Граф потока управления состоит из узлов, представляющих блоки программного кода, и дуг, которые связывают эти блоки, отображая передачу управления между ними.A control flow graph or CFG is a representation of the source code algorithm of a function of a compiled program in the form of a graph that displays the control flow in the source code of the said function. A control flow graph consists of nodes representing blocks of program code and arcs that connect these blocks, representing the transfer of control between them.

Блок программного кода - последовательность инструкций, которые выполняются поочередно и не могут быть прерваны или пропущены во время исполнения программы.A block of program code is a sequence of instructions that are executed one at a time and cannot be interrupted or skipped during program execution.

Граф потока вызовов - преобразованный граф потока управления, который состоит из пустых блоков, на месте которых могут быть блоки программного кода, базовых блоков, а также дуг, которые связывают блоки, отображая передачу управления между ними.A call flow graph is a transformed control flow graph, which consists of empty blocks, in place of which there may be blocks of program code, basic blocks, as well as arcs that connect blocks, displaying the transfer of control between them.

Базовый блок - блок в графе потока управления, представленный целевой инструкцией целевого процесса.Basic block - a block in the control flow graph represented by the target instruction of the target process.

Сигнатура потока управления (англ. CFS - control flow signature) - это представление совокупности графов потока вызовов, состоящей из графов потока вызовов и дуг графов потока вызовов.A control flow signature (CFS) is a representation of a collection of call flow graphs, consisting of call flow graphs and call flow graph arcs.

Целевой процесс - процесс в операционной системе, который контролируется монитором потока управления.The target process is a process in the operating system that is monitored by the control flow monitor.

На Фиг. 1 представлен пример системы, реализующей способ контроля работоспособности процессов в операционной системе на основе контроля последовательности исполняемых инструкций.In FIG. Figure 1 shows an example of a system that implements a method for monitoring the performance of processes in an operating system based on monitoring the sequence of executed instructions.

Считается, что работоспособность процесса нарушена в случае, если процесс:A process is considered to be faulty if the process:

• не выполнил по меньшей мере одну ожидаемую от него инструкцию, причем ожидаемой инструкцией является инструкция, полученная от операционной системы, в рамках которой реализован контроль работоспособности целевого процесса;• failed to execute at least one instruction expected from it, wherein the expected instruction is an instruction received from the operating system, within which the target process is monitored;

• выполняет допустимые для него инструкции, в отличном от заданного в исходном коде 110 порядке выполнения инструкций;• executes instructions that are valid for it, in a different order from the order of instruction execution specified in the source code 110 ;

• выполнил по меньшей мере одну недопустимую инструкцию, причем недопустимой инструкцией является любая инструкция, которая не содержится в исходном коде 110.• executed at least one invalid instruction, where an invalid instruction is any instruction that is not contained in the source code 110 .

Работу системы можно разделить на два этапа - этап компиляции и этап исполнения.The operation of the system can be divided into two stages - the compilation stage and the execution stage.

Этап исполнения реализован на операционной системе 170, установленной на первой компьютерной системе. Этап компиляции реализован на операционной системе (не представлена на Фиг. 1), установленной на второй компьютерной системе.The execution step is implemented on an operating system 170 installed on the first computer system. The compilation step is implemented on an operating system (not shown in Fig. 1) installed on the second computer system.

В частном варианте реализации этап исполнения и этап компиляции реализованы на одной операционной системе 170.In a particular embodiment, the execution stage and the compilation stage are implemented on the same operating system 170 .

Этап компиляции. Compilation stage .

Компилятор 120 получает на вход исходный код 110 программы для его компиляции. Исходный код 110 программы может быть представлен в виде кода как на языке высокого уровня (например, С++, Java и др.), так и на языке низкого уровня (например, assembler, C и др.).The compiler 120 receives as input the source code 110 of the program to compile it. The program source code 110 may be represented as code in either a high-level language (eg, C++, Java, etc.) or a low-level language (eg, assembler, C, etc.).

Во время компиляции компилятор 120 преобразует исходный код 110 программы, написанной на языке программирования, в эквивалентный машинный код, который может исполняться на компьютерной системе, например такой, которая представлена при описании Фиг. 7. Процесс компиляции включает в себя несколько шагов, а именно: лексический анализ, синтаксический анализ и генерацию машинного кода. Лексический анализатор разбивает исходный код 110 программы на токены, такие как идентификаторы, операторы, числа и т. д. Синтаксический анализатор использует указанные токены для построения графов потока управления, которые отражают структуру и синтаксис исходного кода 110 программы. Затем компилятор 120 генерирует машинный код, который соответствует графам потока управления. По завершении компиляции компилятор 120 передает построенные графы потока управления генератору сигнатур потока управления 130, а также передает скомпилированный код (машинный код) в операционную систему 170.During compilation, compiler 120 converts the source code 110 of a program written in a programming language into equivalent machine code that can be executed on a computer system, such as the one illustrated in the discussion of FIG. 7 . The compilation process involves several steps, namely lexical analysis, parsing and machine code generation. The lexical analyzer breaks the program source code 110 into tokens, such as identifiers, operators, numbers, etc. The parser uses these tokens to construct control flow graphs that reflect the structure and syntax of the program source code 110 . Compiler 120 then generates machine code that corresponds to the control flow graphs. Upon completion of compilation, the compiler 120 passes the constructed control flow graphs to the control flow signature generator 130 and also passes the compiled code (machine code) to the operating system 170 .

В частном варианте реализации синтаксический анализатор использует указанные токены для построения единого графа потока управления, содержащего все графы потока управления всех функций исходного кода 110 программы. Указанный единый граф потока управления отражает структуру и синтаксис исходного кода 110 программы.In a particular implementation, the parser uses these tokens to construct a single control flow graph containing all control flow graphs of all functions of the program source code 110 . This single control flow graph reflects the structure and syntax of the program source code 110 .

В другом варианте реализации изобретения вместо компилятора 120 используется интерпретатор (не представлен на Фиг. 1). Например, если исходный код 110 представлен на интерпретируемом языке программирования (например, Python). Стоит отметить, что в данном варианте реализации изобретения интерпретатор в отличие от компилятора 120 выполняет все вышеописанные для компиляции шаги каждый раз при выполнении программы.In another embodiment, an interpreter (not shown in FIG. 1 ) is used instead of the compiler 120 . For example, if the source code 110 is in an interpreted programming language (such as Python). It is worth noting that in this embodiment, the interpreter, unlike the compiler 120, performs all the steps described above for compilation every time the program is executed.

Генератор сигнатур потока управления 130 принимает графы потока управления от компилятора 120 и целевые инструкции 140 от операционной системы 170.Control flow signature generator 130 receives control flow graphs from compiler 120 and target instructions 140 from operating system 170 .

Стоит отметить, что целевой инструкцией 140 является по меньшей мере одна инструкция, переданная от операционной системы 170 с целью контроля работоспособности целевого процесса 160.It is worth noting that the target instruction 140 is at least one instruction transmitted from the operating system 170 for the purpose of monitoring the performance of the target process 160 .

Генератор сигнатур потока управления 130 исключает из блоков программного кода полученных графов потока управления все инструкции, которые не являются целевыми инструкциями 140 или вызовами функций, содержащих целевые инструкции 140. Таким образом, графы потока управления преобразуют в графы потока вызовов. Пример преобразования графов потока управления в графы потока вызовов, а также примеры целевых инструкций 140 представлены при описании Фиг. 2 - Фиг. 5.The control flow signature generator 130 excludes from the code blocks of the resulting control flow graphs all instructions that are not target instructions 140 or calls to functions containing target instructions 140 . Thus, control flow graphs are converted into call flow graphs. An example of the mapping of control flow graphs to call flow graphs, as well as examples of target instructions 140, are presented in the description of FIG. 2 - Fig. 5 .

Далее генератор сигнатур потока управления 130 генерирует по меньшей мере одну сигнатуру потока управления на основании сформированных графов потока вызовов.Next, the control flow signature generator 130 generates at least one control flow signature based on the generated call flow graphs.

В предпочтительном варианте реализации генератор сигнатур потока управления 130 генерирует сигнатуру потока управления, состоящую из графов потока вызовов и связей графов потока вызовов.In a preferred embodiment, control flow signature generator 130 generates a control flow signature consisting of call flow graphs and call flow graph relationships.

В другом варианте реализации генератор сигнатур потока управления 130 генерирует сигнатуру потока управления, представленную совокупностью графов потока вызовов. Генератор сигнатур потока управления 130 производит последовательную замену базовых блоков с целевыми инструкциями 140 на соответствующие им графы потока вызовов.In another embodiment, control flow signature generator 130 generates a control flow signature represented by a collection of call flow graphs. The control flow signature generator 130 sequentially replaces the basic blocks with target instructions 140 with their corresponding call flow graphs.

В ещё одном частном варианте реализации генератор сигнатур потока управления 130 генерирует сигнатуру потока управления путем преобразования по меньшей мере одного графа потока вызовов к виду конечного автомата вызовов целевых инструкций 140.In yet another particular embodiment, the control flow signature generator 130 generates a control flow signature by transforming at least one call flow graph to a state machine view of the calls of target instructions 140 .

Конечный автомат вызовов - графовое представление всех возможных исходов передачи управления во время исполнения целевого процесса 160. Началом конечного автомата является точка входа, представленная целевой инструкцией, с которой начинается исполнение целевого процесса 160.Call state machine is a graph representation of all possible outcomes of control transfer during execution of the target process 160 . The start of a state machine is the entry point, represented by the target instruction, from which execution of the target process 160 begins.

Генератор сигнатур потока управления 130 передает сгенерированные сигнатуры потока управления в монитор потока управления 150, который расположен в операционной системе 170.The control flow signature generator 130 transmits the generated control flow signatures to the control flow monitor 150 , which is located in the operating system 170 .

Этап исполнения. Execution stage .

Операционная система 170 принимает от компилятора 120 скомпилированный код (машинный код) и запускает его в рамках целевого процесса 160.Operating system 170 receives compiled code (machine code) from compiler 120 and runs it within target process 160.

Монитор потока управления 150 осуществляет контроль работы процесса (далее - целевого процесса 160) в операционной системе 170 во время исполнения запущенного скомпилированного исходного кода 110 путем мониторинга исполняемых в целевом процессе 160 инструкций с помощью по меньшей мере одной полученной сигнатуры потока управления. Мониторинг включает перехват исполняемых инструкции в целевом процессе 160 посредством операционной системы 170 и проверку их на соответствие по меньшей мере одной полученной сигнатуре потока управления. Если исполняемые инструкции соответствуют по меньшей мере одной сигнатуре, то монитор потока управления 150 определяет корректность в работе целевого процесса 160 при исполнении скомпилированного кода и продолжает мониторинг. Если же по меньшей мере одна исполняемая инструкция не соответствует сигнатуре потока управления, то определяют ошибку в работе целевого процесса 160.The control flow monitor 150 monitors the operation of a process (hereinafter referred to as the target process 160 ) in the operating system 170 during execution of the running compiled source code 110 by monitoring the instructions executed in the target process 160 using at least one acquired control flow signature. Monitoring involves intercepting executable instructions in the target process 160 by the operating system 170 and checking them against at least one received control flow signature. If the executable instructions match at least one signature, then the control flow monitor 150 determines whether the target process 160 is operating correctly when executing the compiled code and continues monitoring. If at least one executable instruction does not match the control flow signature, then an error in the operation of the target process 160 is determined.

В частном варианте реализации для восстановления работоспособности целевого процесса 160 монитор потока управления 150 осуществляет перезапуск целевого процесса 160 посредством операционной системы 170.In a particular embodiment, to restore the functionality of the target process 160, the control flow monitor 150 restarts the target process 160 through the operating system 170 .

В другом частном варианте реализации при выявлении ошибки в работе целевого процесса 160, монитор потока управления 150 останавливает работу целевого процесса 160 посредством операционной системы 170.In another particular implementation, when an error is detected in the operation of the target process 160 , the control flow monitor 150 stops the operation of the target process 160 through the operating system 170 .

В ещё одном частном варианте реализации монитор потока управления 150 уведомляет систему безопасности (например, SIEM или EDR) или пользователя о нарушении в работе целевого процесса 160, если исполняемые инструкции целевого процесса 160 не соответствуют сигнатуре потока управления.In yet another particular embodiment, the control flow monitor 150 notifies a security system (eg, SIEM or EDR) or a user of a violation in the target process 160 if the executable instructions of the target process 160 do not match the control flow signature.

В частном варианте реализации монитор потока управления 150 является процессом, запущенным операционной системой 170 перед запуском скомпилированного кода в целевом процессе 160.In a particular embodiment, control flow monitor 150 is a process started by the operating system 170 before running compiled code in the target process 160 .

Таким образом, на этапе исполнения операционная система 170 запускает монитор потока управления 150, после чего запускает скомпилированный код в целевом процессе 160. Монитор потока управления 150 перехватывает все инструкции целевого процесса 160 и проверяет их на соответствие сигнатуре потока управления. В случае если инструкции целевого процесса 160 не соответствуют сигнатуре потока управления, монитор потока управления 150 перезапускает целевой процесс 160 или останавливает его работу.Thus, at runtime, the operating system 170 runs a control flow monitor 150 and then runs the compiled code in the target process 160 . The control flow monitor 150 intercepts all instructions of the target process 160 and checks them against the control flow signature. If the instructions of the target process 160 do not match the control flow signature, the control flow monitor 150 restarts the target process 160 or stops its operation.

Стоит отметить, что подход к контролю работоспособности целевого процесса 160, при котором монитор потока управления 150 перехватывает все инструкции целевого процесса 160, позволяет контролировать работоспособность процесса 160, не прибегая к инструментированию кода целевого процесса 160. Также монитор потока управления 150 не взаимодействует с аппаратным обеспечением (не показано на Фиг. 1), что позволяет контролировать работу целевого процесса 160 как на доверенном, так и недоверенном аппаратном обеспечении.It is worth noting that the approach to monitoring the health of the target process 160 , in which the control flow monitor 150 intercepts all instructions of the target process 160 , allows you to monitor the health of the process 160 without resorting to instrumentation of the code of the target process 160 . Also, the control flow monitor 150 does not interact with hardware (not shown in FIG. 1 ), allowing the operation of the target process 160 to be monitored on both trusted and untrusted hardware.

На Фиг. 2 - Фиг. 5 представлен пример формирования из графов потока управления графов потока вызовов для следующей программы:In FIG. 2 - Fig. Figure 5 shows an example of generating call flow graphs from control flow graphs for the following program:

#include <unistd.h>#include <unistd.h>

int main(){int main(){

sleep(1);sleep(1);

return 0;return 0;

}}

В данном примере целевыми инструкциями, предоставляемыми операционной системой 170 генератору сигнатур потока управления 130, являются следующие: SleepAPI и ErrnoAPI.In this example, the target instructions provided by the operating system 170 to the control flow signature generator 130 are SleepAPI and ErrnoAPI.

Для формирования из графа потока управления графа потока вызовов, генератор сигнатур потока управления 130 исключает из графа потока управления весь код, не относящийся к целевым инструкциям.To generate a call flow graph from the control flow graph, the control flow signature generator 130 excludes from the control flow graph all code that is not related to the target instructions.

На Фиг. 2 показано преобразование графа потока управления функции main() в граф потока вызова функции main(). После преобразования остается только целевая инструкция sleep, относящаяся к SleepAPI.In FIG. Figure 2 shows the transformation of the control flow graph of the main() function into the call flow graph of the main() function. After the conversion, only the target sleep instruction remains, which is specific to the SleepAPI.

На Фиг. 3 показано преобразование графа потока управления функции sleep() в граф потока вызова функции sleep(). После преобразования остается только целевая инструкция nanosleep, относящаяся к SleepAPI.In FIG. Figure 3 shows the transformation of the control flow graph of the sleep() function into the call flow graph of the sleep() function. After the conversion, only the target instruction nanosleep, related to the SleepAPI, remains.

На Фиг. 4 показано преобразование графа потока управления функции nanosleep() в граф потока вызова функции nanosleep(). После преобразования остается только целевая инструкция errno, относящаяся к ErrnoAPI, и SleepAPI.In FIG. Figure 4 shows the transformation of the control flow graph of the nanosleep() function into the call flow graph of the nanosleep() function. After the conversion, only the target errno instruction related to ErrnoAPI and SleepAPI remain.

На Фиг. 5 показано преобразование графа потока управления функции errno() в граф потока вызова функции errno(). После преобразования остается только целевая инструкция ErrnoAPI.In FIG. Figure 5 shows the transformation of the control flow graph of the errno() function into the call flow graph of the errno() function. After the conversion, only the target ErrnoAPI instruction remains.

Фиг. 6 иллюстрирует способ контроля работоспособности процессов в операционной системе на основе мониторинга последовательности исполняемых инструкций. Fig. 6 illustrates a method for monitoring the health of processes in an operating system based on monitoring the sequence of executed instructions.

На предварительном шаге 605 преобразовывают исходный код 110 программы в эквивалентный машинный код посредством компилятора 120.In a preliminary step 605, the program source code 110 is converted into equivalent machine code by the compiler 120 .

В частном варианте реализации изобретения вместо компилятора 120 используется интерпретатор (не представлен на Фиг. 1).In a particular embodiment of the invention, instead of the compiler 120, an interpreter is used (not shown in Fig. 1 ).

На шаге 610 строят графы потока управления, которые отражают структуру и синтаксис исходного кода 110 программы.At step 610, control flow graphs are constructed that reflect the structure and syntax of the program source code 110 .

На шаге 620 с помощью генератора сигнатур потока управления 130 преобразовывают графы потока управления каждой функции, содержащей по меньшей мере одну целевую инструкцию 140, в графы потока вызовов путем исключения из блоков программного кода указанного графа потока управления всех инструкций, которые не являются целевыми инструкциями 140 или вызовами других функций, содержащих целевые инструкции 140.At step 620, the control flow signature generator 130 converts the control flow graphs of each function containing at least one target instruction 140 into call flow graphs by eliminating from the program code blocks of the specified control flow graph all instructions that are not the target instructions 140 or calls to other functions containing target instructions 140 .

На шаге 630 с помощью генератора сигнатур потока управления 130 генерируют по меньшей мере одну сигнатуру потока управления на основании сформированных графов потока вызовов и передают ее в монитор потока управления 150.At step 630 , the control flow signature generator 130 generates at least one control flow signature based on the generated call flow graphs and transmits it to the control flow monitor 150 .

В предпочтительном варианте реализации генерируют сигнатуру потока управления, состоящую из графов потока вызовов и связей между графами потока вызовов.In a preferred embodiment, a control flow signature is generated consisting of call flow graphs and relationships between call flow graphs.

В другом варианте реализации генерируют сигнатуру потока управления с помощью преобразования нескольких графов потока вызовов в один путем последовательной замены базовых блоков с целевыми инструкциями 140 или вызовом функции на соответствующие им графы потока вызовов.In another embodiment, a control flow signature is generated by converting multiple call flow graphs into one by sequentially replacing basic blocks with target instructions 140 or function calls with their corresponding call flow graphs.

В ещё одном частном варианте реализации генерируют сигнатуру потока управления путем преобразования графов потока вызовов к виду конечного автомата вызовов целевых инструкций.In another particular implementation, a control flow signature is generated by converting call flow graphs to the form of a state machine of calls of target instructions.

На шаге 640 запускают монитор потока управления 150, после чего запускают целевой процесс 160 в операционной системе 170.At step 640, control flow monitor 150 is launched, followed by target process 160 on operating system 170 .

На шаге 645 перехватывают исполняемые инструкции целевого процесса 160 с помощью монитора потока управления 150 посредством операционной системы 170.At step 645, executable instructions of the target process 160 are intercepted by the control flow monitor 150 via the operating system 170 .

На шаге 650 перехваченные инструкции проверяют на соответствие сигнатуре потока управления указанного целевого процесса 160.At step 650, the intercepted instructions are checked against the control flow signature of the specified target process 160 .

На шаге 660 при несоответствии инструкций целевого процесса 160 сигнатуре потока управления определяют ошибку в работе целевого процесса 160. для восстановления работоспособности целевого процесса 160 осуществляют перезапуск целевого процесса 160 посредством операционной системы 170.At step 660 , if the instructions of the target process 160 do not match the control flow signature, an error in the operation of the target process 160 is determined. to restore the functionality of the target process 160, the target process 160 is restarted via the operating system 170 .

В частном варианте реализации при определении ошибки в работе целевого процесса 160 осуществляют перезапуск целевого процесса 160.In a particular embodiment, when an error is detected in the operation of the target process 160, the target process 160 is restarted.

В ещё одном частном варианте реализации, если при определении ошибки в работе целевого процесса 160 нет возможности перезапустить целевой процесс 160, останавливают работу целевого процесса 160.In yet another particular embodiment, if an error is detected in the operation of the target process 160, it is not possible to restart the target process 160 , the operation of the target process 160 is stopped.

В ещё одном частном варианте реализации при определении ошибки в работе целевого процесса 160 дополнительно уведомляют пользователя о нарушении работоспособности целевого процесса 160.In another particular embodiment, when an error is detected in the operation of the target process 160, the user is additionally notified about the malfunction of the target process 160 .

На Фиг. 7 представлена компьютерная система, на которой могут быть реализованы различные варианты систем и способов, раскрытых в настоящем документе. Компьютерная система 20 может представлять собой систему, сконфигурированную для реализации настоящего изобретения, и может быть в виде одного вычислительного устройства или в виде нескольких вычислительных устройств, например, настольного компьютера, портативного компьютера, ноутбука, мобильного вычислительного устройства, смартфона, планшетного компьютера, сервера, мейнфрейма, встраиваемого устройства и других форм вычислительных устройств.In FIG. 7 illustrates a computer system on which various embodiments of the systems and methods disclosed herein can be implemented. The computer system 20 may be a system configured to implement the present invention and may be in the form of a single computing device or multiple computing devices, such as a desktop computer, a laptop computer, a notebook computer, a mobile computing device, a smartphone, a tablet computer, a server, mainframe, embedded device and other forms of computing devices.

Как показано на Фиг. 7, компьютерная система 20 включает в себя: центральный процессор 21, системную память 22 и системную шину 23, которая связывает разные системные компоненты, в том числе память, связанную с центральным процессором 21. Системная шина 23 реализована, как любая известная из уровня техники шинная структура, содержащая в свою очередь память шины или контроллер памяти шины, периферийную шину и локальную шину, способную взаимодействовать с любой другой шинной архитектурой. Примерами шин являются: PCI, ISA, PCI-Express, HyperTransport™, InfiniBand™, Serial ATA, I2C и другие подходящие соединения между компонентами компьютерной системы 20. Центральный процессор 21 содержит один или несколько процессоров, имеющих одно или несколько ядер. Центральный процессор 21 исполняет один или несколько наборов машиночитаемых инструкций, реализующих способы, представленные в настоящем документе. Системная память 22 может быть любой памятью для хранения данных и/или компьютерных программ, исполняемых центральным процессором 21. Системная память может содержать как постоянное запоминающее устройство (ПЗУ) 24, так и память с произвольным доступом (ОЗУ) 25. Основная система ввода/вывода (BIOS) 26, содержит основные процедуры, которые обеспечивают передачу информации между элементами компьютерной системы 20, например, в момент загрузки операционной системы с использованием ПЗУ 24.As shown in FIG. 7 , the computer system 20 includes: a central processing unit 21 , a system memory 22 , and a system bus 23 that communicates various system components, including memory, coupled to the central processing unit 21 . System bus 23 is implemented like any bus structure known in the art, which in turn includes a bus memory or bus memory controller, a peripheral bus, and a local bus capable of interfacing with any other bus architecture. Examples of buses include: PCI, ISA, PCI-Express, HyperTransport™, InfiniBand™, Serial ATA, I2C and other suitable connections between computer system components 20 . The central processing unit 21 contains one or more processors having one or more cores. The central processing unit 21 executes one or more sets of computer-readable instructions implementing the methods presented herein. System memory 22 may be any memory for storing data and/or computer programs executable by the central processing unit 21 . System memory can contain both read-only memory (ROM) 24 and random access memory (RAM) 25 . The basic input/output system (BIOS) 26 contains the basic procedures that ensure the transfer of information between elements of the computer system 20 , for example, when the operating system is loaded using ROM 24 .

Компьютерная система 20 включает в себя одно или несколько устройств хранения данных, таких как одно или несколько извлекаемых запоминающих устройств 27, одно или несколько неизвлекаемых запоминающих устройств 28, или комбинации извлекаемых и неизвлекаемых устройств. Одно или несколько извлекаемых запоминающих устройств 27 и/или неизвлекаемых запоминающих устройств 28 подключены к системной шине 23 через интерфейс 32. В одном из вариантов реализации извлекаемые запоминающие устройства 27 и соответствующие машиночитаемые носители информации представляют собой энергонезависимые модули для хранения компьютерных инструкций, структур данных, программных модулей и других данных компьютерной системы 20. Системная память 22, извлекаемые запоминающие устройства 27 и неизвлекаемые запоминающие устройства 28 могут использовать различные машиночитаемые носители информации. Примеры машиночитаемых носителей информации включают в себя машинную память, такую как кэш-память, SRAM, DRAM, ОЗУ, не требующую конденсатора (Z-RAM), тиристорную память (T-RAM), eDRAM, EDO RAM, DDR RAM, EEPROM, NRAM, RRAM, SONOS, PRAM; флэш-память или другие технологии памяти, такие как твердотельные накопители (SSD) или флэш-накопители; магнитные кассеты, магнитные ленты и магнитные диски, такие как жесткие диски или дискеты; оптические носители, такие как компакт-диски (CD-ROM) или цифровые универсальные диски (DVD); и любые другие носители, которые могут быть использованы для хранения нужных данных и к которым может получить доступ компьютерная система 20.Computer system 20 includes one or more data storage devices, such as one or more removable storage devices 27 , one or more non-removable storage devices 28 , or combinations of removable and non-removable devices. One or more removable storage devices 27 and/or non-removable storage devices 28 are connected to the system bus 23 via an interface 32 . In one embodiment, removable storage devices 27 and associated computer-readable storage media are nonvolatile modules for storing computer instructions, data structures, program modules, and other computer system 20 data. System memory 22 , removable storage devices 27 , and non-removable storage devices 28 may use various computer readable media. Examples of computer-readable storage media include computer memory such as cache memory, SRAM, DRAM, capacitorless RAM (Z-RAM), thyristor memory (T-RAM), eDRAM, EDO RAM, DDR RAM, EEPROM, NRAM , RRAM, SONOS, PRAM; flash memory or other memory technologies such as solid-state drives (SSDs) or flash drives; magnetic cassettes, magnetic tapes and magnetic disks such as hard disks or floppy disks; optical media such as compact discs (CD-ROMs) or digital versatile discs (DVDs); and any other media that can be used to store the desired data and that can be accessed by the computer system 20 .

Системная память 22, извлекаемые запоминающие устройства 27 и неизвлекаемые запоминающие устройства 28, содержащиеся в компьютерной системе 20 используются для хранения операционной системы 35, приложений 37, других программных модулей 38 и программных данных 39. Компьютерная система 20 включает в себя периферийный интерфейс 46 для передачи данных от устройств ввода 40, таких как клавиатура, мышь, стилус, игровой контроллер, устройство голосового ввода, устройство сенсорного ввода, или других периферийных устройств, таких как принтер или сканер через один или несколько портов ввода/вывода, таких как последовательный порт, параллельный порт, универсальная последовательная шина (USB) или другой периферийный интерфейс. Устройство отображения 47, такое как один или несколько мониторов, проекторов или встроенных дисплеев, также подключено к системной шине 23 через выходной интерфейс 48, такой как видеоадаптер. Помимо устройств отображения 47, компьютерная система 20 оснащена другими периферийными устройствами вывода (на Фиг. 7 не показаны), такими как динамики и другие аудиовизуальные устройства.System memory 22 , removable storage devices 27 , and non-removable storage devices 28 contained in the computer system 20 are used to store the operating system 35 , applications 37 , other program modules 38 , and program data 39 . Computer system 20 includes a peripheral interface 46 for transmitting data from input devices 40 such as a keyboard, mouse, stylus, game controller, voice input device, touch input device, or other peripheral devices such as a printer or scanner through one or more input/output ports, such as a serial port, parallel port, universal serial bus (USB), or other peripheral interface. A display device 47 , such as one or more monitors, projectors, or embedded displays, is also connected to the system bus 23 through an output interface 48 , such as a video adapter. In addition to the display devices 47 , the computer system 20 is equipped with other peripheral output devices (not shown in FIG. 7 ), such as speakers and other audiovisual devices.

Компьютерная система 20 может работать в сетевом окружении, используя сетевое соединение с одним или несколькими удаленными компьютерами 49. Удаленный компьютер (или компьютеры) 49 является рабочим персональным компьютером или сервером, который содержит большинство или все упомянутые компоненты, отмеченные ранее при описании сущности компьютерной системы 20, представленной на Фиг. 7. В сетевом окружении также могут присутствовать и другие устройства, например, маршрутизаторы, сетевые станции или другие сетевые узлы. Компьютерная система 20 может включать один или несколько сетевых интерфейсов 51 или сетевых адаптеров для связи с удаленными компьютерами 49 через одну или несколько сетей, таких как локальная компьютерная сеть (LAN) 50, глобальная компьютерная сеть (WAN), интранет и Интернет. Примерами сетевого интерфейса 51 являются интерфейс Ethernet, интерфейс Frame Relay, интерфейс SONET и беспроводные интерфейсы.The computer system 20 may operate in a networked environment using a network connection to one or more remote computers 49 . The remote computer(s) 49 is a working personal computer or server that contains most or all of the components noted previously in describing the nature of the computer system 20 shown in FIG. 7 . There may also be other devices in the network environment, such as routers, network stations or other network nodes. The computer system 20 may include one or more network interfaces 51 or network adapters for communicating with remote computers 49 over one or more networks, such as a local area network (LAN) 50 , a wide area network (WAN), an intranet, and the Internet. Examples of network interface 51 are an Ethernet interface, a Frame Relay interface, a SONET interface, and wireless interfaces.

Варианты раскрытия настоящего изобретения могут представлять собой систему, способ, или машиночитаемый носитель (или носитель) информации.Embodiments of the present invention may be a system, a method, or a computer-readable medium (or storage medium).

Машиночитаемый носитель информации является осязаемым устройством, которое сохраняет и хранит программный код в форме машиночитаемых инструкций или структур данных, к которым имеет доступ центральный процессор 21 компьютерной системы 20. Машиночитаемый носитель может быть электронным, магнитным, оптическим, электромагнитным, полупроводниковым запоминающим устройством или любой подходящей их комбинацией. В качестве примера, такой машиночитаемый носитель информации может включать в себя память с произвольным доступом (RAM), память только для чтения (ROM), EEPROM, портативный компакт-диск с памятью только для чтения (CD-ROM), цифровой универсальный диск (DVD), флэш-память, жесткий диск, портативную компьютерную дискету, карту памяти, дискету или даже механически закодированное устройство, такое как перфокарты или рельефные структуры с записанными на них инструкциями.A computer-readable storage medium is a tangible device that stores and stores program code in the form of machine-readable instructions or data structures that are accessible by the central processing unit 21 of a computer system 20 . A computer-readable medium may be an electronic, magnetic, optical, electromagnetic, semiconductor storage device, or any suitable combination thereof. By way of example, such a computer-readable storage medium may include random access memory (RAM), read-only memory (ROM), EEPROM, compact disc read-only memory (CD-ROM), digital versatile disk (DVD) ), flash memory, hard drive, portable computer floppy disk, memory card, floppy disk, or even a mechanically encoded device such as punch cards or embossed structures with instructions written on them.

Система и способ, настоящего изобретения, могут быть рассмотрены в терминах средств. Термин "средство", используемый в настоящем документе, относится к реальному устройству, компоненту или группе компонентов, реализованных с помощью аппаратного обеспечения, например, с помощью интегральной схемы, специфичной для конкретного приложения (ASIC) или FPGA, или в виде комбинации аппаратного и программного обеспечения, например, с помощью микропроцессорной системы и набора машиночитаемых инструкций для реализации функциональности средства, которые (в процессе выполнения) превращают микропроцессорную систему в устройство специального назначения. Средство также может быть реализовано в виде комбинации этих двух компонентов, при этом некоторые функции могут быть реализованы только аппаратным обеспечением, а другие функции - комбинацией аппаратного и программного обеспечения. В некоторых вариантах реализации, по крайней мере, часть, а в некоторых случаях и все средство может быть выполнено на центральном процессоре 21 компьютерной системы 20. Соответственно, каждое средство может быть реализовано в различных подходящих конфигурациях и не должно ограничиваться каким-либо конкретным вариантом реализации, приведенным в настоящем документе.The system and method of the present invention can be thought of in terms of means. The term "device" as used herein refers to an actual device, component, or group of components implemented in hardware, such as an application-specific integrated circuit (ASIC) or FPGA, or a combination of hardware and software. providing, for example, using a microprocessor system and a set of machine-readable instructions to implement the functionality of a tool that (in the process of execution) turns the microprocessor system into a special-purpose device. The tool may also be implemented as a combination of these two components, with some functions being implemented by hardware alone and other functions being implemented by a combination of hardware and software. In some embodiments, at least a portion, and in some cases all, of the means may be executed on the central processing unit 21 of the computer system 20 . Accordingly, each means may be implemented in various suitable configurations and should not be limited to any particular embodiment set forth herein.

В заключение следует отметить, что приведенные в описании сведения являются примерами, которые не ограничивают объем настоящего изобретения, определенного формулой. Специалисту в данной области становится понятным, что при разработке любого реального варианта осуществления настоящего изобретения необходимо принять множество решений, специфических для конкретного варианта осуществления, для достижения конкретных целей, и эти конкретные цели будут разными для разных вариантов осуществления. Понятно, что такие усилия по разработке могут быть сложными и трудоемкими, но тем не менее, они будут обычной инженерной задачей для тех, кто обладает обычными навыками в данной области, пользуясь настоящим раскрытием изобретения.In conclusion, it should be noted that the information given in the description are examples that do not limit the scope of the present invention as defined by the formula. One skilled in the art will appreciate that in developing any actual embodiment of the present invention, many decisions specific to the particular implementation must be made to achieve specific objectives, and these specific objectives will differ from one embodiment to another. It is understood that such development efforts can be complex and time-consuming, but would nevertheless be a routine engineering task for those of ordinary skill in the art using the present disclosure.

Claims (23)

1. Способ контроля работоспособности процессов в операционной системе для выявления ошибок в работе процессов, причем способ осуществляется в аппаратном процессоре, при этом способ содержит этапы, согласно которым:1. A method for monitoring the performance of processes in an operating system to identify errors in the operation of processes, wherein the method is carried out in a hardware processor, and the method contains the steps according to which: преобразовывают исходный код программы в эквивалентный машинный код;converting the program source code into equivalent machine code; строят графы потока управления, которые отражают структуру и синтаксис исходного кода программы;build control flow graphs that reflect the structure and syntax of the program source code; преобразовывают графы потока управления в графы потока вызовов с использованием целевых инструкций, полученных от операционной системы;converting control flow graphs into call flow graphs using target instructions received from the operating system; генерируют по меньшей мере одну сигнатуру потока управления на основании сформированных графов потока вызовов;generating at least one control flow signature based on the generated call flow graphs; запускают монитор потока управления, после чего в операционной системе запускают целевой процесс, соответствующий указанной программе;launching a control flow monitor, after which a target process corresponding to the specified program is launched in the operating system; перехватывают, с помощью монитора потока управления, исполняемые целевым процессом инструкции указанной программы;intercept, using a control flow monitor, instructions of the specified program executed by the target process; проверяют перехваченные инструкции на соответствие по меньшей мере одной сигнатуре потока управления указанного целевого процесса;checking the intercepted instructions against at least one control flow signature of the specified target process; при несоответствии инструкций целевого процесса сигнатуре потока управления определяют ошибку в работе целевого процесса.if the instructions of the target process do not match the control flow signature, an error in the operation of the target process is determined. 2. Способ по п. 1, в котором преобразовывают исходный код программы в эквивалентный машинный код посредством компилятора или интерпретатора.2. The method according to claim 1, in which the source code of the program is converted into equivalent machine code using a compiler or interpreter. 3. Способ по п. 1, в котором при определении ошибки в работе целевого процесса осуществляют перезапуск целевого процесса.3. The method according to claim 1, in which, when an error is detected in the operation of the target process, the target process is restarted. 4. Способ по п. 1, в котором определяют ошибку в целевом процессе, связанную с одним из:4. The method according to claim 1, in which an error in the target process associated with one of: невыполнением по меньшей мере одной из ожидаемых инструкций;failure to carry out at least one of the expected instructions; выполнением недопустимой инструкции.executing an illegal instruction. 5. Способ по п. 4, в котором ожидаемыми инструкциями являются инструкции, полученные от операционной системы, в рамках которой реализован контроль работоспособности целевого процесса.5. The method according to claim 4, in which the expected instructions are instructions received from the operating system, within which the health control of the target process is implemented. 6. Способ по п. 4, в котором недопустимой инструкцией является любая инструкция, которая не содержится в исходном коде.6. The method of claim 4, wherein an invalid instruction is any instruction that is not contained in the source code. 7. Способ по п. 1, в котором преобразовывают граф потока управления в графы потока вызовов путем исключения из блоков программного кода графов потока управления инструкций, которые не являются целевыми инструкциями или вызовами функций.7. The method according to claim 1, in which the control flow graph is converted into call flow graphs by excluding from blocks of program code the control flow graphs of instructions that are not target instructions or function calls. 8. Способ по п. 1, в котором генерируют сигнатуру потока управления по меньшей мере одним из способов:8. The method according to claim 1, in which a control flow signature is generated in at least one of the ways: объединением графов потока вызовов и связей графов потока вызовов;combining call flow graphs and call flow graph connections; путем преобразования по меньшей мере одного графа потока вызовов к виду конечного автомата вызовов целевых инструкций.by transforming the at least one call flow graph to a state machine view of the calls of the target instructions. 9. Способ по п. 1, в котором генерируют сигнатуру потока управления путем формирования совокупности графов потока вызовов, при этом совокупность графов потока вызовов формируют путем последовательной замены базовых блоков с целевыми инструкциями на соответствующие им графы потока вызовов.9. The method according to claim 1, in which a control flow signature is generated by generating a set of call flow graphs, wherein the set of call flow graphs is formed by sequentially replacing basic blocks with target instructions with their corresponding call flow graphs. 10. Способ по п. 1, в котором при выявлении ошибки в работе целевого процесса останавливают работу процесса.10. The method according to claim 1, in which, if an error is detected in the operation of the target process, the operation of the process is stopped. 11. Система контроля работоспособности процессов в операционной системе для выявления ошибок в работе процессов, состоящая из компьютерного устройства с аппаратным процессором, настроенным для выполнения способа по любому из пп. 1-10.11. A system for monitoring the performance of processes in the operating system to identify errors in the operation of processes, consisting of a computer device with a hardware processor configured to perform the method according to any one of paragraphs. 1-10.
RU2023130106A 2023-11-20 System and method of monitoring operability of processes in operating system RU2817547C1 (en)

Publications (1)

Publication Number Publication Date
RU2817547C1 true RU2817547C1 (en) 2024-04-16

Family

ID=

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2408062C2 (en) * 2008-03-20 2010-12-27 Корпорация "САМСУНГ ЭЛЕКТРОНИКС Ко., Лтд." Method and system for controlling processes in operating system on microkernel
US20150278116A1 (en) * 2014-03-31 2015-10-01 Paul Caprioli Control transfer override
US20180095764A1 (en) * 2016-10-01 2018-04-05 Salmin Sultana Control flow integrity
US20180225446A1 (en) * 2017-02-06 2018-08-09 Huawei Technologies Co., Ltd. Processor trace-based enforcement of control flow integrity of a computer system
US20210342155A1 (en) * 2020-05-04 2021-11-04 Morgan Stanley Services Group Inc. System and method for prefetching instructions and data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2408062C2 (en) * 2008-03-20 2010-12-27 Корпорация "САМСУНГ ЭЛЕКТРОНИКС Ко., Лтд." Method and system for controlling processes in operating system on microkernel
US20150278116A1 (en) * 2014-03-31 2015-10-01 Paul Caprioli Control transfer override
US20180095764A1 (en) * 2016-10-01 2018-04-05 Salmin Sultana Control flow integrity
US20180225446A1 (en) * 2017-02-06 2018-08-09 Huawei Technologies Co., Ltd. Processor trace-based enforcement of control flow integrity of a computer system
US20210342155A1 (en) * 2020-05-04 2021-11-04 Morgan Stanley Services Group Inc. System and method for prefetching instructions and data

Similar Documents

Publication Publication Date Title
US11106799B2 (en) Methods, media, and systems for detecting an anomalous sequence of function calls
US11113407B2 (en) System and methods for automated detection of input and output validation and resource management vulnerability
Long et al. Automatic runtime error repair and containment via recovery shepherding
Peng et al. {X-Force}:{Force-Executing} binary programs for security applications
US8316448B2 (en) Automatic filter generation and generalization
US7962798B2 (en) Methods, systems and media for software self-healing
Gui et al. Firmcorn: Vulnerability-oriented fuzzing of iot firmware via optimized virtual execution
CN107077412B (en) Automated root cause analysis for single or N-tier applications
EP1952240A2 (en) Methods, media and systems for detecting anomalous program executions
CN112181833A (en) Intelligent fuzzy test method, device and system
Kim et al. Prof-gen: Practical study on system call whitelist generation for container attack surface reduction
Peng et al. {GLeeFuzz}: Fuzzing {WebGL} Through Error Message Guided Mutation
Wu et al. Casper: An efficient approach to call trace collection
Li et al. Trusted computing dynamic attestation using a static analysis based behaviour model
RU2817547C1 (en) System and method of monitoring operability of processes in operating system
Dharsee et al. A software solution for hardware vulnerabilities
Keromytis et al. The minestrone architecture combining static and dynamic analysis techniques for software security
Vasilyev Static verification for memory safety of Linux kernel drivers
Kononenko An approach to error correction in program code using dynamic optimization in a virtual execution environment
US20240273205A1 (en) Program Execution Anomaly Detection for CyberSecurity
JP7355211B2 (en) Signature generation device, signature generation method, and signature generation program
Cui et al. ADDFuzzer: A New Fuzzing Framework of Android Device Drivers
Peng et al. Bitmap-Based Security Monitoring for Deeply Embedded Systems
RU2649293C1 (en) System and method of transmitting intercepted drive to driver requests from during initialisation of drivers
Talebi Securing Mobile Devices Through Discovery, Mitigation, and Prevention of Vulnerabilities