CN109460262B - Method, system, android device and medium for verifying validity of main system image - Google Patents

Method, system, android device and medium for verifying validity of main system image Download PDF

Info

Publication number
CN109460262B
CN109460262B CN201811361394.8A CN201811361394A CN109460262B CN 109460262 B CN109460262 B CN 109460262B CN 201811361394 A CN201811361394 A CN 201811361394A CN 109460262 B CN109460262 B CN 109460262B
Authority
CN
China
Prior art keywords
main system
image
memory
program
kernel
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.)
Active
Application number
CN201811361394.8A
Other languages
Chinese (zh)
Other versions
CN109460262A (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.)
Shenzhen Onething Technology Co Ltd
Original Assignee
Shenzhen Onething Technology Co Ltd
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 Shenzhen Onething Technology Co Ltd filed Critical Shenzhen Onething Technology Co Ltd
Priority to CN201811361394.8A priority Critical patent/CN109460262B/en
Publication of CN109460262A publication Critical patent/CN109460262A/en
Application granted granted Critical
Publication of CN109460262B publication Critical patent/CN109460262B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44568Immediately runnable code
    • G06F9/44578Preparing or optimising for loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Storage Device Security (AREA)
  • Stored Programmes (AREA)

Abstract

The method comprises the steps of verifying the validity of the main system image, namely loading the main system image to a memory through a kernel and expanding the main system image into the main system program in the memory, and then verifying the validity of the main system image by utilizing the multitask parallel processing capability of the main system program. The multitask parallel processing capability of the main system program is fully utilized, and the time consumption for starting can be obviously reduced on the basis of not influencing the safety. The application also discloses a system for verifying the validity of the main system mirror image, an android device and a computer readable storage medium, and the system, the android device and the computer readable storage medium have the beneficial effects.

Description

Method, system, android device and medium for verifying validity of main system image
Technical Field
The present application relates to the field of android device booting technologies, and in particular, to a method and a system for verifying validity of a main system image, an android device, and a computer-readable storage medium.
Background
In an embedded system, all code and system data are stored in a flash memory chip, and the flash memory chip has the characteristics of being erasable and non-volatile after power failure, but the data stored in the flash memory chip can be stolen or tampered by others maliciously. Therefore, in order to protect data in the flash memory chip, a high-level security chip is born. Different from a common flash memory chip, a special register is added in the flash memory chip: the OTP register, which is called One Time Programmable in English, is named as a One-Time Programmable register, and means that the data stored in the OTP register can be programmed only once and cannot be modified after being programmed once.
Therefore, the safety of the device can be effectively improved by storing some information such as the software version number, the hardware version number and the encryption and decryption keys in the OTP register.
Nowadays, the advanced security chip is also used for implementing verification of an operating system and a legal mirror image started by the android device, that is, when the operating system of the android device is started, in order to verify whether the started operating system is officially approved, various legal verification modes of mirror image files required in the process of starting the operating system are usually stored in the OTP register to determine whether a file of the currently started operating system is officially approved, whether private flash exists or not, and the like.
Since the android system is a kernel-based operating system, in the actual boot process, see the boot flowchart shown in fig. 1:
the method comprises the steps of loading a bootstrap program image, a kernel image and a main system image for starting an operating system into a memory in sequence, verifying the legality of each image in the memory in sequence, loading a next image into the memory only after the previous image is verified to be legal, and unfolding the main system image into a main system program which can be really seen by a user with the help of the kernel until the main system image is also verified to be legal, so that the whole starting process of the android device is completed.
In other words, in the prior art, it is necessary to determine whether the main system image satisfies the validity mirror image verification before the main system image is developed into the main system program, and only after the validity verification passes, the main system image can be developed into the main system program on the basis of proving that the main system image is valid, but since the main system image is compared with the bootstrap image and the kernel image, the file size of the main system image is much larger than the file size of the bootstrap image and the kernel image, and the time consumed for verifying the validity is positively correlated with the file size, therefore, in the whole starting process of the android device, the validity verification of the main system image takes a relatively large proportion of time.
Therefore, how to shorten the time consumption for starting and provide a better use experience for the user on the basis of not affecting the security is a problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The method comprises the steps of loading the main system image into a memory through a kernel and expanding the main system image into the main system program in the memory, and then verifying the validity of the main system image by utilizing the multitask parallel processing capability of the main system program. The multitask parallel processing capability of the main system program is fully utilized, and the time consumption for starting can be obviously reduced on the basis of not influencing the safety.
In order to achieve the above object, the present application provides a method for verifying the validity of a main system image, which includes:
loading the main system image to a memory through a kernel, and expanding the main system image in the memory to obtain a main system program;
verifying the validity of the main system image in the background by utilizing the multitask parallel processing capacity of the main system program;
and if the main system image is illegal, returning notification information that the main system image is illegal and quitting the main system program.
Optionally, before loading the main system image to the memory through the kernel, the method further includes:
taking out the bootstrap image under the preset address of the target equipment which is powered on and started;
loading the bootstrap program mirror image to the memory, and expanding the bootstrap program mirror image in the memory to obtain a bootstrap program;
and loading the kernel mirror image to the memory through the bootstrap program, and expanding the kernel mirror image in the memory to obtain the kernel.
Optionally, before the step of expanding the boot program in the memory and expanding the kernel in the memory, the method further includes:
verifying the validity of the bootstrap image in the memory;
and the combination of (a) and (b),
and verifying the legality of the kernel image in the memory.
Optionally, verifying the validity of the primary system image includes:
decrypting the main system image to obtain a decrypted main system image;
extracting a digital signature from the decrypted main system image;
verifying whether the digital signature is a legitimate digital signature;
if the digital signature is legal, the main system mirror image is legal;
and if the digital signature is illegal, the main system mirror image is illegal.
Optionally, the method further comprises:
recording a verification result obtained after verifying the validity of the main system image every time to obtain a main system starting log;
and calculating the occurrence probability of the illegal main system image according to the main system starting log.
In order to achieve the above object, the present application further provides a system for verifying the validity of a main system image, including:
the system comprises a main system image loading and expanding unit, a main system image processing unit and a main system image processing unit, wherein the main system image loading and expanding unit is used for loading a main system image to a memory through an inner core and expanding the main system image in the memory to obtain a main system program;
the main system image validity verifying unit is used for verifying the validity of the main system image in the background by utilizing the multitask parallel processing capacity of the main system program;
and the main system image illegal processing unit is used for returning the notification information that the main system image is illegal and quitting the main system program when the main system image is illegal.
Optionally, the system further comprises:
the boot program image extracting unit is used for extracting the boot program image under the preset address of the target device started by power on before the main system image is loaded to the memory through the kernel;
the bootstrap program mirror image loading and expanding unit is used for loading the bootstrap program mirror image to the memory and expanding the bootstrap program mirror image in the memory to obtain a bootstrap program;
and the kernel mirror image loading and expanding unit is used for loading the kernel mirror image to the memory through the bootstrap program and expanding the kernel mirror image in the memory to obtain the kernel.
Optionally, the system further comprises:
the verification unit of the legitimacy of the bootstrap program mirror image is used for verifying the legitimacy of the bootstrap program mirror image in the memory before the bootstrap program is expanded and obtained in the memory;
and the combination of (a) and (b),
and the kernel mirror image validity verifying unit is used for verifying the validity of the kernel mirror image in the memory before the kernel is expanded in the memory to obtain the kernel.
Optionally, the main system image validity verifying unit includes:
the encryption subunit is used for decrypting the main system image to obtain a decrypted main system image;
the signature extraction subunit is used for extracting a digital signature from the decrypted main system image;
the signature legal verification subunit is used for verifying whether the digital signature is a legal digital signature or not;
a legality judging subunit, configured to judge that the main system image is legal when the digital signature is legal;
and the illegal judging subunit is used for judging that the main system mirror image is illegal when the digital signature is illegal.
Optionally, the system further comprises:
the verification result recording unit is used for recording a verification result obtained after verifying the validity of the main system mirror image every time to obtain a main system starting log;
and the probability calculating unit is used for calculating the occurrence probability of the illegal main system mirror image according to the main system starting log.
In order to achieve the above object, the present application further provides an android device, where the android device includes a memory and a processor, where the memory stores a device start program operable on the processor, and the device start program, when executed by the processor, implements the following method:
loading the main system image to a memory through a kernel, and expanding the main system image in the memory to obtain a main system program;
verifying the validity of the main system image in the background by utilizing the multitask parallel processing capacity of the main system program;
and if the main system image is illegal, returning notification information that the main system image is illegal and quitting the main system program.
Optionally, the device start-up program, when executed by the processor, further implements:
before loading the main system image to the memory through the kernel, taking out the bootstrap image from a preset address of the android device which is powered on and started;
loading the bootstrap program mirror image to the memory, and expanding the bootstrap program mirror image in the memory to obtain a bootstrap program;
and loading the kernel mirror image to the memory through the bootstrap program, and expanding the kernel mirror image in the memory to obtain the kernel.
Optionally, the device start-up program, when executed by the processor, further implements:
before a bootstrap program is obtained by expanding the bootstrap program in the memory, verifying the validity of the bootstrap program mirror image in the memory;
and the combination of (a) and (b),
and before the kernel is obtained by expanding the kernel in the memory, verifying the legality of the kernel image in the memory.
Optionally, the device start-up program, when executed by the processor, further implements:
recording a verification result obtained after verifying the validity of the main system image every time to obtain a main system starting log;
and calculating the occurrence probability of the illegal main system image according to the main system starting log.
To achieve the above object, the present application also provides a computer-readable storage medium having a device start-up program stored thereon, where the device start-up program can be executed by one or more processors to implement the method for verifying the validity of a main system image as provided in the above.
Obviously, the method for verifying the validity of the main system image, which is provided by the present application, is different from the prior art, and the step of verifying the validity of the main system image is performed in the main system program, that is, the main system image is loaded into the memory through the kernel and is expanded into the main system program in the memory, and then the validity of the main system image is verified by using the multitask parallel processing capability of the main system program. The multitask parallel processing capability of the main system program is fully utilized, the starting time consumption can be obviously shortened on the basis of not influencing the safety, and the user experience is better. The application also provides a system for verifying the validity of the main system image, an android device and a computer readable storage medium, which have the beneficial effects and are not repeated herein.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart of starting an operating system of an android device using an advanced security chip in the prior art;
fig. 2 is a flowchart of a method for verifying the validity of a main system image according to an embodiment of the present application;
FIG. 3 is a flow chart of operational steps that are also provided before the steps of the embodiment shown in FIG. 2 are performed;
fig. 4 is a flowchart of a validity verification method in the method for verifying the validity of a main system image according to the embodiment of the present application;
fig. 5 is a flowchart illustrating a method for starting an operating system of an android device by using an advanced security chip according to an embodiment of the present application;
fig. 6 is a block diagram illustrating a system for verifying the validity of a main system image according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an android device provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Example one
Referring to fig. 2, fig. 2 is a flowchart of a method for verifying validity of a main system image according to an embodiment of the present application, and it should be noted that the method provided by the present application is applied to an electronic device based on an android operating system, specifically including an android phone, an android tablet, and the like, and includes the following steps:
s101: loading the main system mirror image to a memory through a kernel, and expanding the main system mirror image in the memory to obtain a main system program;
because the android operating system is a kernel-based operating system, and a main system program after main system image expansion can complete corresponding operation under the support of the kernel, the main system image is loaded into the memory of the android device through the kernel, and the main system image is further expanded in the memory to obtain a truly available main system program.
For convenience of understanding, a description is given here of a relationship between a main system image and a main system program, taking an android phone as an example, in order to install an application program to its own android phone, a compressed packet in an APK format that is packaged is first required, an installation bootstrap program expands the compressed packet according to a preset installation bootstrap program to finally obtain an executable application program, and a corresponding data file of the executable application program also exists in a multi-file form in an installation directory of the android phone and does not exist in one packaged compressed packet any more.
The mirror image is similar to a compressed packet, the expansion process of the mirror image is similar to the decompression process of the compressed packet, and the mirror image can operate according to normal operation after being compressed. Therefore, the main system image can be actually regarded as a packaging body of the main operating system program of the android device, the packaging of the main system image is mainly aimed at identifying a plurality of associated data files as a uniform file package, meanwhile, in consideration of security, during the packaging of the main system image as the image, some marks for verifying the legality can be added according to actual requirements so as to directly verify all the data files contained in the whole file package, but not verify all the data files.
It should be noted that, when the main system image is expanded into the main system program in the memory, taking an android mobile phone as an example, the user may find, in the display screen of the android mobile phone, that the mobile phone has currently entered a familiar desktop, that is, the android device in which the main system program normally runs may perform subsequent operations, such as opening one or more application programs, based on characteristics brought by the operating system.
It should be further noted that, in the whole starting process of the android device, some steps are further included before the main system image is loaded to the memory through the kernel, and as in the prior art, when the android device is powered on and started, a bootstrap program (named bootloader) image is taken out at a preset address of the flash memory chip first, then the validity of the bootstrap program image is verified, and if the bootstrap program image is legal, the bootstrap program is developed into the memory. The bootstrap program then loads the Kernel (named as Kernel) image to the memory and verifies the validity of the Kernel image, if the Kernel image is legal, the Kernel image is expanded in the memory, and then the main System (named as System) is mirrored to the memory through the Kernel and expanded. Of course, the description given here is only a higher summary of the actual start-up process, which is more complicated, but the principle is the same, and different versions of the android system may have some modifications in details of some steps, and are not limited here specifically.
S102: verifying the validity of the main system image in the background by utilizing the multitask parallel processing capacity of the main system program;
on the basis of S101, in this step, on the premise that the operating system of the android device has already worked normally, the validity of the main system image is verified in the background by using the multitask parallel processing capability of the main system program, instead of legalizing the main system image as a precondition for developing it into the main system program in the manner shown in fig. 1 and according to the prior art.
It should be noted that, when the main system program is not started, the android device does not have multitask parallel processing, because it cannot drive hardware well to achieve the purpose without the help of the main system program, at this time, the android device only runs a very simple and basic boot program, and the purpose is to start the main system program. Therefore, compared with the prior art, the method and the device have the advantages that the sequence of the steps of verifying the legitimacy of the main system image and expanding the main system image into the main system program is changed, the step of verifying the legitimacy of the main system image is executed under the main system program, the characteristic that the android system supports multitask parallel processing is utilized, the process can be completed in a silent mode under the condition that a user does not sense the process, and the maximum change of user experience is that the power-on starting speed of the android device is higher.
For example, a characteristic value verification method based on a hash algorithm may be used to compare whether a characteristic value of an actual file is consistent with a characteristic value stored in an OTP register to verify whether the file is a file that one party considers to be legal; the verification of the validity may also be implemented by attaching a special mark to an official document, or by using a digital signature, and the like, which is not limited herein.
S103: and when the main system image is illegal, returning the notification information that the main system image is illegal and quitting the main system program.
This step is established on the basis that the verification result of S102 is that the main system image is illegal, and if the main system image is verified to be illegal, it indicates that according to the normal starting process, the main system image will not be expanded into the main system program, and will not enter into the truly available and operable system interface. Therefore, in the method for achieving the purpose of shortening the starting time of the android device by adjusting the sequence of the two steps, if the image of the normally running operating system is verified to be illegal, the illegal notification information of the main system image is returned and the main system program is quitted, and the user feels that the started android device is closed. In consideration of the actual probability of this occurrence and the time consumption for verifying the validity of the main system image under the main system program, the user operation is not substantially interrupted.
And when the main system mirror image is legal, the legality verification process is closed, the main system program can continue to run, and the required functions are continuously provided for the user.
Furthermore, a verification result obtained after the validity of the main system image is verified every time can be recorded to obtain a main system starting log, the occurrence probability of an illegal main system image is obtained through calculation according to the main system starting log, and more subsequent analysis can be carried out according to the occurrence probability.
From the flowchart shown in fig. 2 and the above explanation of the execution steps, different from the prior art, the step of verifying the validity of the main system image is performed in the main system program in this embodiment, that is, the main system image is loaded into the memory by the kernel and is expanded into the main system program in the memory, and then the validity of the main system image is verified by using the multitask parallel processing capability of the main system program. The multitask parallel processing capability of the main system program is fully utilized, the starting time consumption can be obviously shortened on the basis of not influencing the safety, and the user experience is better.
Example two
Referring to fig. 3, fig. 3 is a flowchart of operation steps provided before the steps of the embodiment shown in fig. 2 are executed, and this embodiment is intended to supplement the start step mentioned in the first embodiment according to a complete start process of an android device, so as to obtain a more practical and complete embodiment supplemented by the solution of this embodiment, including the following steps:
s201: taking out the bootstrap image under the preset address of the target equipment which is powered on and started;
when the target android device is powered on and started, the stored bootstrap image is taken out from the preset address of the flash memory chip.
S202: loading the bootstrap program mirror image to a memory;
on the basis of S201, this step is intended to load the fetched boot image to the memory so as to perform subsequent operations thereon in the memory.
S203: verifying the validity of the bootstrap program mirror image in the memory;
on the basis of S202, this step aims to verify the validity of the boot image in the memory.
S204: expanding a bootstrap program mirror image in a memory to obtain a bootstrap program;
this step is established on the basis that the verification result of S203 is that the bootstrap image is legal, which indicates that the condition that the boot image is expanded to run the bootstrap for the subsequent starting step is satisfied, so that the bootstrap image is expanded in the memory to obtain the bootstrap.
S205: loading the kernel mirror image to the memory through a bootstrap program;
on the basis of S204, this step is intended to load the kernel image to the memory through the running boot program so as to perform subsequent operations on it in the memory.
S206: verifying the legality of the kernel mirror image in the memory;
on the basis of S205, this step aims to verify the validity of the kernel image in the memory.
S207: expanding the kernel mirror image in the memory to obtain a kernel;
this step is established on the basis that the verification result of S206 is that the kernel image is legal, which indicates that the condition that the kernel image is to be expanded to run the kernel for the subsequent starting step is satisfied, so the kernel image is expanded in the memory to obtain the kernel.
S208: loading the main system mirror image to a memory through a kernel, and expanding the main system mirror image in the memory to obtain a main system program;
the present step is the same as S101, that is, in the complete starting process of the android device, the above steps need to be performed before S101.
S209: the start-up procedure is exited.
And if the verification result of the S203 or S206 is illegal, jumping to the step, and terminating the whole starting process of the android device due to the fact that any mirror image is illegal.
EXAMPLE III
Referring to fig. 4, fig. 4 is a flowchart of a validity verification method in the method for verifying the validity of a main system image according to the embodiment of the present application, and it should be noted that the validity verification method according to the embodiment is a verification method based on an encrypted digital signature, that is, when a plurality of files included in a main system program are packaged as an image, a digital signature is attached to the files, and the files are integrally encrypted. The embodiment provides a validity verification method based on the above, which includes the following steps:
s301: decrypting the main system image to obtain a decrypted main system image;
s302: extracting a digital signature from the decrypted main system image;
s303: verifying whether the digital signature is a legal digital signature;
when verifying whether the digital signature is a legal digital signature, the verification information stored in the OTP register in advance needs to be used.
S304: the main system mirror image is legal;
this step is based on the verification result of S303 being that the extracted digital signature is legitimate, and thus it can be determined that the main system image is legitimate.
S305: the primary system image is illegal.
This step is based on the verification result at S303 being that the extracted digital signature is illegal, and thus it can be determined that the main system image is illegal.
It should be further noted that the present embodiment has been described only in terms of a decryption process for a primary system image, and the method is also applicable to a boot image and a kernel image that are processed in the same manner. The validity verification is carried out by adopting a digital signature mode, and compared with a mode based on a characteristic value and a mark, the validity verification method is higher in efficiency and shorter in time consumption.
Example four
In order to deepen understanding of the invention of the present application, reference may also be made to fig. 5 on the basis of the foregoing embodiments, where fig. 5 is a schematic diagram of a starting process of an android device after the scheme of the present application is adopted, and it is obvious that, in the present application, the step of verifying the validity of the main system image is performed in the main system program, that is, the main system image is loaded into the memory through the kernel and is expanded into the main system program in the memory, and then the validity of the main system image is verified by using the multitask parallel processing capability of the main system program. The multitask parallel processing capability of the main system program is fully utilized, the starting time consumption can be obviously shortened on the basis of not influencing the safety, and the use experience of a user is improved.
The embodiment also provides a more specific implementation step in combination with an actual application scenario:
1. when the android device is powered on and started, the advanced security chip loads the BootLoader mirror image into the memory, decrypts the BootLoader mirror image by means of a control algorithm of an advanced security function, then verifies whether the signature of the decrypted BootLoader mirror image is legal or not, and suspends the BootLoader (suspend) if the signature of the decrypted BootLoader mirror image is illegal;
2. if the Bootloader mirror image is legal, unfolding the Bootloader mirror image into Bootloader, loading a Kernel mirror image into a memory by a Bootloader program, decrypting the Kernel mirror image by means of a control algorithm with an advanced security function, verifying whether the signature of the decrypted Kernel mirror image is legal or not, and if the signature is illegal, hanging up the Bootloader (stopping);
3. if the Kernel image is legal, the Kernel image is unfolded into a Kernel system under the guidance of a BootLoader, and a file system and a device driver of the current device are initialized under the Kernel system;
4. after the initialization of the file System and the device driver is completed, starting and running an Init program in the Kernel mirror image, entering an Init program processing stage, loading a System mirror image (the attribute of the System mirror image is configured to be read only, namely can be read only and cannot be changed), starting and initializing an android operating System main service program in the System mirror image, and handing over the android operating System main service program until entering a desktop;
5. when the Kernel System starts and runs the Init program, the validity verification program of the System image in the Kernel image is started in the main service program of the android operating System, if the validity verification program is illegal, the operating System of the current android device is restarted, the BootLoader is entered, and the BootLoader is hung (suspended).
The action of the Init program is explained here:
when the kernel system is started, it will perform operations such as setting up cache, protected memory, plan list, loading driver, etc. When the kernel system completes the setting, it will search the Init program to start the root process or the first process of the main system by using the Init program, which specifically includes: creating some folders and mounting devices, initializing and starting property service, analyzing configuration files and starting preset process.
EXAMPLE five
Referring to fig. 6, fig. 6 is a block diagram of a system for verifying the validity of a main system image according to an embodiment of the present application, where the system may include:
a main system image loading and expanding unit 100, configured to load a main system image to a memory through a kernel, and expand the main system image in the memory to obtain a main system program;
a main system image validity verifying unit 200, configured to verify validity of a main system image in the background by using multitask parallel processing capability of a main system program;
and a main system image illegal processing unit 300 for returning notification information that the main system image is illegal and quitting the main system program when the main system image is illegal.
Further, the system may further include:
the boot program image extracting unit is used for extracting the boot program image under the preset address of the target device started by power on before the main system image is loaded to the memory through the kernel;
the bootstrap program mirror image loading and expanding unit is used for loading the bootstrap program mirror image to the memory and expanding the bootstrap program mirror image in the memory to obtain a bootstrap program;
and the kernel mirror image loading and expanding unit is used for loading the kernel mirror image to the memory through a bootstrap program and expanding the kernel mirror image in the memory to obtain the kernel.
Further, the system may further include:
the bootstrap image validity verification unit is used for verifying the validity of the bootstrap image in the memory before the bootstrap image is expanded in the memory to obtain the bootstrap;
and the combination of (a) and (b),
and the kernel mirror image validity verifying unit is used for verifying the validity of the kernel mirror image in the memory before the kernel is expanded in the memory.
The main system image validity verifying unit 200 may include:
the encryption subunit is used for decrypting the main system image to obtain a decrypted main system image;
the signature extraction subunit is used for extracting a digital signature from the decrypted main system image;
the signature legal verification subunit is used for verifying whether the digital signature is a legal digital signature or not;
the legal judging subunit is used for judging that the main system mirror image is legal when the digital signature is legal;
and the illegal judging subunit is used for judging that the main system image is illegal when the digital signature is illegal.
Further, the system may further include:
the verification result recording unit is used for recording a verification result obtained after verifying the validity of the main system mirror image every time to obtain a main system starting log;
and the probability calculating unit is used for calculating the occurrence probability of the illegal main system image according to the main system starting log.
EXAMPLE six
In the foregoing, detailed description is performed on how to improve the starting speed of the android device by adjusting the execution step sequence for verifying the validity of the main system image through four method embodiments, and the application also provides an entity hardware device, namely the android device, corresponding to the method, where the content principle of this part corresponds to the scheme part, and details of the part implementing the principle are not described here, and the hardware composition of the entity hardware device will be described below through fig. 7:
the android device 400 includes a memory 410, a processor 420, a bus 430, and an execution structure 440, where the memory 410 stores a boot program that can run on the processor 420, the boot program is transmitted to the processor 420 through the bus 430, and when executed by the processor 420, the steps described in the above embodiments can be implemented.
The memory 410 includes at least one type of readable storage medium, which includes flash memory, hard disk, multi-media card, card type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, and the like. Memory 410 can be an internal storage unit of android device 400 in some embodiments, such as a hard disk of android device 400. The memory 410 may also be an external storage device of the android device 400 in other embodiments, such as a plug-in hard disk provided on the android device 400, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and so forth. Further, the memory 410 may also be simultaneously composed of an internal storage unit and an external storage device. Further, the memory 410 may be used not only to store various application software and various types of data installed in the android device 400, but also to temporarily store data that has been output or is to be output.
Processor 420, which in some embodiments may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip, executes program code or processes data stored in memory 410, such as executes preinstalled programs for an operating system, etc.
The bus 430 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses are shown as only one bi-directional hollow indicator line, but do not indicate that there is only one type or number of buses.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method provided in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that the above-mentioned numbers of the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method for verifying the legitimacy of a primary system image, comprising:
loading a bootstrap program mirror image to a memory, and expanding the bootstrap program mirror image in the memory to obtain a bootstrap program;
loading the kernel mirror image to the memory through the bootstrap program, and expanding the kernel mirror image in the memory to obtain a kernel;
loading the main system image to a memory through a kernel, and expanding the main system image in the memory to obtain a main system program;
verifying the validity of the main system image in the background by utilizing the multitask parallel processing capacity of the main system program;
and if the main system image is illegal, returning notification information that the main system image is illegal and quitting the main system program.
2. The method of claim 1, prior to loading the primary system image into memory by the kernel, further comprising:
and taking out the bootstrap image under the preset address of the target equipment started by power-on.
3. The method of claim 2, wherein prior to expanding a boot program in the memory and expanding the kernel in the memory, further comprising:
verifying the validity of the bootstrap image in the memory;
and the combination of (a) and (b),
and verifying the legality of the kernel image in the memory.
4. The method of any of claims 1 to 3, wherein verifying the validity of the primary system image comprises:
decrypting the main system image to obtain a decrypted main system image;
extracting a digital signature from the decrypted main system image;
verifying whether the digital signature is a legitimate digital signature;
if the digital signature is legal, the main system mirror image is legal;
and if the digital signature is illegal, the main system mirror image is illegal.
5. The method of claim 4, further comprising:
recording a verification result obtained after verifying the validity of the main system image every time to obtain a main system starting log;
and calculating the occurrence probability of the illegal main system image according to the main system starting log.
6. A system for verifying the legitimacy of a primary system image, comprising:
the bootstrap program mirror image loading and expanding unit is used for loading the bootstrap program mirror image to the memory and expanding the bootstrap program mirror image in the memory to obtain a bootstrap program;
the kernel mirror image loading and expanding unit is used for loading the kernel mirror image to the memory through a bootstrap program and expanding the kernel mirror image in the memory to obtain a kernel;
the system comprises a main system image loading and expanding unit, a main system image processing unit and a main system image processing unit, wherein the main system image loading and expanding unit is used for loading a main system image to a memory through an inner core and expanding the main system image in the memory to obtain a main system program;
the main system image validity verifying unit is used for verifying the validity of the main system image in the background by utilizing the multitask parallel processing capacity of the main system program;
and the main system image illegal processing unit is used for returning the notification information that the main system image is illegal and quitting the main system program when the main system image is illegal.
7. An android device, comprising a memory, a processor, and a bus, the memory having stored thereon a device boot program executable on the processor, the device boot program being transmitted to the processor over the bus and when executed by the processor implementing the method of:
loading a bootstrap program mirror image to a memory, and expanding the bootstrap program mirror image in the memory to obtain a bootstrap program;
loading the kernel mirror image to the memory through the bootstrap program, and expanding the kernel mirror image in the memory to obtain a kernel;
loading the main system image to a memory through a kernel, and expanding the main system image in the memory to obtain a main system program;
verifying the validity of the main system image in the background by utilizing the multitask parallel processing capacity of the main system program;
and if the main system image is illegal, returning notification information that the main system image is illegal and quitting the main system program.
8. The android device of claim 7, wherein the device launcher, when executed by the processor, further implements:
and before loading the main system image to the memory through the kernel, taking out the bootstrap image from the preset address of the android device started by power-on.
9. The android device of claim 8, wherein the device launcher, when executed by the processor, further implements:
before a bootstrap program is obtained by expanding the bootstrap program in the memory, verifying the validity of the bootstrap program mirror image in the memory;
and the combination of (a) and (b),
and before the kernel is obtained by expanding the kernel in the memory, verifying the legality of the kernel image in the memory.
10. A computer-readable storage medium having stored thereon a device boot program executable by one or more processors to implement a method of verifying the legitimacy of a host system image according to any one of claims 1 to 5.
CN201811361394.8A 2018-11-15 2018-11-15 Method, system, android device and medium for verifying validity of main system image Active CN109460262B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811361394.8A CN109460262B (en) 2018-11-15 2018-11-15 Method, system, android device and medium for verifying validity of main system image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811361394.8A CN109460262B (en) 2018-11-15 2018-11-15 Method, system, android device and medium for verifying validity of main system image

Publications (2)

Publication Number Publication Date
CN109460262A CN109460262A (en) 2019-03-12
CN109460262B true CN109460262B (en) 2021-12-03

Family

ID=65610594

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811361394.8A Active CN109460262B (en) 2018-11-15 2018-11-15 Method, system, android device and medium for verifying validity of main system image

Country Status (1)

Country Link
CN (1) CN109460262B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114064134B (en) * 2021-11-12 2024-02-06 上海华元创信软件有限公司 Self-booting method and system suitable for embedded SPARC architecture processor

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104598254A (en) * 2015-02-17 2015-05-06 福州瑞芯微电子有限公司 Method and device for rapidly powering on Android system
CN105511874A (en) * 2015-12-02 2016-04-20 海信集团有限公司 Embedded system starting method and intelligent terminal
CN107256143A (en) * 2017-04-21 2017-10-17 青岛海信电器股份有限公司 A kind of method and Android device of the starting up speed for improving Android device
CN108134676A (en) * 2017-12-19 2018-06-08 上海闻泰电子科技有限公司 Android system safe starting method and readable storage medium storing program for executing
CN108399339A (en) * 2018-02-12 2018-08-14 广东为辰信息科技有限公司 A kind of credible startup method based on safety chip

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100377084C (en) * 2006-03-10 2008-03-26 浙江大学 Multi-task parallel starting optimization of built-in operation system
CN103729597B (en) * 2014-01-16 2017-11-17 宇龙计算机通信科技(深圳)有限公司 System starts method of calibration, system starts calibration equipment and terminal
CN103955648B (en) * 2014-05-15 2017-02-01 乐视致新电子科技(天津)有限公司 Method and device for verifying legality of system image
CN104392152A (en) * 2014-12-10 2015-03-04 深圳市捷顺科技实业股份有限公司 Start-up method of embedded equipment, embedded equipment, server and system
CN105260653A (en) * 2015-10-20 2016-01-20 浪潮电子信息产业股份有限公司 Safe loading method and system of program on the basis of Linux
CN105224875B (en) * 2015-11-13 2018-04-06 上海斐讯数据通信技术有限公司 The secure startup system and method for a kind of terminal
CN105320891B (en) * 2015-11-18 2018-10-09 北京微智全景信息技术有限公司 A kind of method and device of computer security loading system mirror image
CN108363918B (en) * 2017-04-28 2022-02-18 清华大学 Boot starting method and device of processor operating system and processor system
CN107729198B (en) * 2017-10-18 2020-04-21 深圳合纵富科技有限公司 Android system firmware verification method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104598254A (en) * 2015-02-17 2015-05-06 福州瑞芯微电子有限公司 Method and device for rapidly powering on Android system
CN105511874A (en) * 2015-12-02 2016-04-20 海信集团有限公司 Embedded system starting method and intelligent terminal
CN107256143A (en) * 2017-04-21 2017-10-17 青岛海信电器股份有限公司 A kind of method and Android device of the starting up speed for improving Android device
CN108134676A (en) * 2017-12-19 2018-06-08 上海闻泰电子科技有限公司 Android system safe starting method and readable storage medium storing program for executing
CN108399339A (en) * 2018-02-12 2018-08-14 广东为辰信息科技有限公司 A kind of credible startup method based on safety chip

Also Published As

Publication number Publication date
CN109460262A (en) 2019-03-12

Similar Documents

Publication Publication Date Title
US9881162B2 (en) System and method for auto-enrolling option ROMS in a UEFI secure boot database
JP6054908B2 (en) Method for repairing variable sets, computer program and computer
JP4793733B2 (en) High integrity firmware
CN103718165B (en) BIOS flash memory attack protection and notice
US8874892B1 (en) Assessing BIOS information prior to reversion
JP5014726B2 (en) Enhanced execution environment by preventing unauthorized boot loader execution
KR101280048B1 (en) Anti-hack protection to restrict installation of operating systems and other software
EP1953666A2 (en) Method of booting electronic device and method of authenticating boot of electronic device
US20140250290A1 (en) Method for Software Anti-Rollback Recovery
US20150134976A1 (en) Event-based apparatus and method for securing bios in a trusted computing system during execution
JP6925542B2 (en) Software verification device, software verification method and software verification program
TW200414052A (en) Providing a secure execution mode in a pre-boot environment
RU2481616C2 (en) Method and device for software download
WO2011142095A1 (en) Information processing device and information processing method
US20080278285A1 (en) Recording device
CN106919859B (en) Basic input output system protection method and device
US20130227262A1 (en) Authentication device and authentication method
TWI570591B (en) Allowing use of a test key for a bios installation
US20130091394A1 (en) Data processing apparatus and validity verification method
JP2010182196A (en) Information processing apparatus and file verification system
US20090300307A1 (en) Protection and security provisioning using on-the-fly virtualization
CN109460262B (en) Method, system, android device and medium for verifying validity of main system image
CN109753788B (en) Integrity checking method and computer readable storage medium during kernel operation
CN114547618A (en) Safe starting method and device based on Linux system, electronic equipment and storage medium
CN107360167B (en) Authentication method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant