A file access method, computing device and readable storage medium

By monitoring and judging the credibility of the application in the compatibility layer, untrusted applications are prevented from accessing files, the data security problems caused by virus infection under wine technology are solved, and the security of file access is improved.

CN114817981BActive Publication Date: 2024-12-27UNIONTECH SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210369867.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-14
Publication Date
2024-12-27
Estimated Expiration
2042-02-14

AI Technical Summary

Technical Problem

When migrating Windows operating system to Linux operating system, wine technology causes Windows applications to access files of Linux operating system. If the application is infected with viruses, data loss and leaks may occur. Existing security measures cannot effectively prevent access to new viruses. Impact data security.

Method used

Implement file access methods in the compatibility layer, monitor the credibility of the application, use whitelists and address files to determine whether the application is trustworthy, prevent untrusted applications from accessing target files, and improve the security of file access.

Benefits of technology

Effectively prevent unknown or untrusted applications from destroying the host's operating system file data, improving the security of file access without affecting the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114817981B_ABST
    Figure CN114817981B_ABST
Patent Text Reader

Abstract

The present invention discloses a file access method, a computing device and a readable storage medium. The method includes: when monitoring the operation of any first application program currently running to access a target file, determining whether the currently running first application program is credible, if so, allowing the currently running first application program to access the target file, any first application program is running in any container created by a compatibility layer, if not, continuing to determine whether the target file is a file selected by the user, if the target file is a file selected by the user, allowing the currently running first application program to access the target file; if the target file is not a file selected by the user, a first prompt box pops up to prompt the user that the currently running first application program is untrustworthy. It can be seen that when running an unknown or untrusted application program in a container, the unknown or untrusted application program can be effectively prevented from damaging the file data of the operating system outside the container, thereby improving the security of file access.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of invention patent application 2022101327848 filed on February 14, 2022. Technical Field

[0002] The present invention relates to the field of computers, and in particular to a file access method, a computing device and a readable storage medium. Background Art

[0003] In the prior art, in order to promote the pace of Linux operating system replacing Windows operating system, the application programs of Windows operating system are mostly migrated to Linux operating system through wine technology. The working process of Wine technology is: create a clean wine container, map some directories of Linux operating system of host machine to wine container when creating wine container, and then run Windows application program in the container. The running Windows application program can access the files of host machine by accessing the file directory in the mapped directory.

[0004] However, in the process of implementing application migration through wine technology, the Windows applications running in each wine container can access files in the mapped Linux operating system directory. Therefore, if the Windows application in the wine container is infected with a virus, it is likely to cause data loss and leakage of the Linux operating system, seriously damaging the data security of important corporate and personal file data.

[0005] In order to solve the above problems, one method is to pre-install a PE file security scanning function in the Linux operating system of the host machine, and provide a security scanning interface to the wine container. When the wine container runs the Windows application, it calls the security scanning interface to confirm whether the currently running application is a malicious program. If so, the wine container is not allowed to run the Windows application. Another method is that the user runs professional anti-virus software, which regularly scans the Linux operating system of the host machine for malware. If there is malware, it is isolated or deleted. However, the existing solution can only prevent existing viruses from destroying the security of data, and cannot prevent applications infected with new viruses from accessing the files of the host machine. Therefore, the existing method cannot effectively prevent viruses from destroying data, that is, after migrating the operating system, the data security of the host machine cannot be guaranteed. Summary of the invention

[0006] To this end, the present invention provides a file access method in an effort to solve the above technical problems.

[0007] According to one aspect of the present invention, a file access method is provided, which is suitable for execution in a compatibility layer of a first operating system of a computing device, the compatibility layer being suitable for running a first application, and the operating environment required by the first application is a second operating system. The method comprises: in response to monitoring an operation of any running first application accessing a target file, determining whether the currently running first application is trustworthy, and if so, allowing the currently running first application to access the target file, wherein the target file is a file in the first operating system that has been mapped to the compatibility layer, and any first application runs in any container created by the compatibility layer; if not, continuing to determine whether the target file is a file selected by the user, and if the target file is a file selected by the user, allowing the currently running first application to access the target file; and if the target file is not a file selected by the user, popping up a first prompt box to prompt the user that the currently running first application is untrustworthy.

[0008] Optionally, a whitelist of application developers is stored in the compatibility layer, and the step of determining whether the currently running first application is credible includes: determining whether the currently running first application is credible through the whitelist.

[0009] Optionally, the step of determining whether the currently running first application is trustworthy through the whitelist includes: determining whether there is a file signature for the currently running first application, and if so, obtaining the file signature of the first application as the first file signature; verifying whether the first file signature is valid, and if so, obtaining the developer information corresponding to the first application from the first file signature as the first information; determining whether the first information is found from the whitelist, and if so, determining that the first application is trustworthy.

[0010] Optionally, an address file is also stored in the compatibility layer, and any data item in the address file corresponds one-to-one to a file path of the first operating system selected by the user and mapped to the compatibility layer. The step of continuing to determine whether the target file is the file selected by the user includes: obtaining the path of the target file as the first path; determining whether the first path is found from the address file, and if so, continuing to determine whether the target file is the file selected by the user.

[0011] Optionally, any data item in the address file is a compressed path, and the file access method provided by the present invention also includes the step of: compressing the first path as the second path; wherein the step of determining whether the first path is found from the address table includes: determining whether the second path is found from the address file.

[0012] Optionally, the file access method provided by the present invention compresses the character string of the first path by a preset compression algorithm to obtain the second path.

[0013] Optionally, the file access method provided by the present invention also includes the steps of: in response to monitoring the operation of selecting a file in the file browsing dialog box, obtaining the file path of the selected file; compressing the string of the file path to obtain a first address; and updating the data in the address file to the first address.

[0014] Optionally, the first prompt box includes an access permission button and a access denial button, and the file access method provided by the present invention further includes the step of: when an operation of selecting the access permission button in the first prompt box is detected, allowing the current first application to access the target file.

[0015] Optionally, the first operating system is a Linux operating system, and the second operating system is a Windows operating system.

[0016] Optionally, the compatibility layer is a wine container.

[0017] According to another aspect of the present invention, a computing device is provided, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be suitable for execution by the at least one processor, and the program instructions include instructions for executing the file access method according to the present invention.

[0018] According to another aspect of the present invention, a readable storage medium storing program instructions is provided. When the program instructions are read and executed by a computing device, the computing device executes the file access method according to the present invention.

[0019] According to the file access method of the present invention, when any first application running in any container created by the compatibility layer is monitored to access the target file, it is first determined whether the currently running first application is trustworthy. If so, it means that the first application currently running in any container is safe, and the currently running first application is allowed to access the target file. If the first application currently running in any container is not trustworthy, the user is monitored to open the file browsing dialog box or drag and drop the mouse to identify whether the user actively accesses the file or the background process silently accesses the file. If it is a background process silently accessing, it is blocked and a danger prompt is given. If not, the currently running first application is allowed to access the target file. It can be seen from this that when running unknown or untrusted applications in a container, it can effectively prevent unknown or untrusted applications from damaging the file data of the host operating system, improve the security of file access, and have no impact on the user's experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] To achieve the above and related purposes, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings, which indicate various ways in which the principles disclosed herein can be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The above and other purposes, features and advantages of the present disclosure will become more apparent by reading the following detailed description in conjunction with the accompanying drawings. Throughout the present disclosure, the same reference numerals generally refer to the same parts or elements.

[0021] Figure 1 A structural block diagram of a computing device 100 according to an embodiment of the present invention is shown;

[0022] Figure 2 A flowchart of a file access method 200 according to an embodiment of the present invention is shown;

[0023] Figure 3 A schematic diagram of a container native directory according to an embodiment of the present invention is shown;

[0024] Figure 4 A schematic diagram of a container directory including a mapped portion of a first operating system file directory according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0025] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0026] Currently, the Linux operating system desktop market has a low utilization rate, a small number of application developments, and few independent software manufacturers develop Linux native applications for it. However, after migrating Windows operating system applications to Linux operating system, there are a large number of applications that cannot be used, which seriously affects the process of Linux operating system replacing Windows operating system, and further hinders the development of Linux operating system desktop and the popularization and promotion of domestic operating system platforms.

[0027] In order to promote the process of Linux operating system replacing Windows operating system, most applications of Windows operating system are migrated to Linux operating system through wine technology. Wine technology is a compatibility layer that can run Windows applications on multiple compatible operating systems (such as Linux, Mac, OSX and BSD, etc.). Wine technology does not imitate the entire Windows operating system like a virtual machine, but dynamically converts Windows API calls into native operating system calls. Compared with the virtual machine method, the memory consumption is greatly reduced, and the performance is almost the same as running on the Windows operating system.

[0028] The design of wine technology takes container isolation into consideration, that is, each Windows application must run in a specified wine container, and Windows applications in different containers cannot communicate with each other. A container is equivalent to a lightweight Windows operating system operating environment. The working process of wine technology is: create a clean wine container. In order to facilitate users to read and write local disk files of the Linux operating system, so that users can achieve a native experience when operating Windows applications, some directories of the Linux operating system will be mapped to the container directory of the container when creating the wine container, so that Windows applications running in the container can access some files of the Linux operating system. After that, install the Windows application in the container, and after running the installed application, the Windows application can access the files of the host machine by accessing the file path in the container directory.

[0029] Table 1 shows the correspondence between some file directories of the Linux operating system and the file directories mapped to the container directory.

[0030] Some file directories of Linux operating system File directories mapped to container directories Current Username Directory Z disk System root directory Y disk Videos directory under the current user name directory C drive / users / user name / My Videos Pictures directory under the current user name directory C drive / users / user name / My Pictures The Music directory under the current user name directory C drive / users / user name / My Music Downloads directory under the current user name directory C drive / users / user name / Downloads The Documents directory under the current username directory C drive / users / user name / My Documents Desktop directory under the current user name directory C drive / users / user name / Desktop

[0031] However, in the process of implementing application migration through wine technology, the Windows applications running in each wine container can access the files in the mapped Linux operating system directory. Therefore, if the Windows application in the wine container is infected with a virus, not only the files in the wine container will be destroyed, but also the important files contained in the mapped Linux operating system directory may be destroyed, and can be spread to other containers through this mechanism, which will lead to data loss and leakage, seriously damaging the data security of important enterprise and personal file data.

[0032] In order to solve the above problems, one method is to pre-install a PE file security scanning function in the Linux operating system of the host machine, and provide a security scanning interface to the wine container. When the wine container runs the Windows application, it calls the security scanning interface to confirm whether the currently running application is a malicious program. If so, the wine container is not allowed to run the Windows application. For example, the security center that comes with the Tongxin UOS Professional Edition 1040 provides the Rising Antivirus Security Scanning Interface for external programs to call. Another method is for users to run professional antivirus software and use it to regularly scan the operating system for malware. If there is malware, it will be isolated or deleted.

[0033] However, the existing solutions can only prevent applications infected with existing viruses from accessing host files. It is impossible to prevent applications infected with new viruses from accessing host files, and it can only be prevented afterwards. Therefore, the existing methods cannot effectively prevent viruses from destroying data, that is, after migrating the operating system, the data security of the host is reduced.

[0034] In order to solve the above problems, the present invention provides a file access method, which is suitable for being executed in an operating system running on a computing device, and further, is suitable for being executed in a compatibility layer running on the operating system. Figure 1 FIG. 1 is a block diagram showing a structure of a computing device 100 according to an embodiment of the present invention.

[0035] It should be noted that Figure 1 The computing device 100 shown is only an example. In practice, the computing device used to implement the file access method of the present invention can be any type of device, and its hardware configuration can be different from the above. Figure 1 The computing device 100 shown is the same as Figure 1 The computing device 100 shown is different. In practice, the computing device used to implement the file access method of the present invention can be Figure 1 The hardware components of the computing device 100 shown are increased or deleted, and the present invention does not limit the specific hardware configuration of the computing device.

[0036] like Figure 1 As shown, in a basic configuration 102, computing device 100 typically includes system memory 106 and one or more processors 104. A memory bus 108 may be used for communication between processor 104 and system memory 106.

[0037] Depending on the desired configuration, the processor 104 can be any type of processor, including but not limited to: a microprocessor (μP), a microcontroller (μC), a digital information processor (DSP), or any combination thereof. The processor 104 can include one or more levels of cache such as a first-level cache 110 and a second-level cache 112, a processor core 114, and registers 116. An example processor core 114 can include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An example memory controller 118 can be used with the processor 104, or in some implementations, the memory controller 118 can be an internal part of the processor 104.

[0038] Depending on the desired configuration, the system memory 106 may be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. Physical memory in a computing device generally refers to volatile memory RAM, and data in a disk needs to be loaded into physical memory before it can be read by the processor 104. The system memory 106 may include an operating system 120, one or more applications 122, and program data 124.

[0039] In some embodiments, the application 122 may be arranged to execute instructions on an operating system by one or more processors 104 using program data 124. The operating system 120 may be, for example, Linux, Windows, etc., which includes program instructions for processing basic system services and performing hardware-dependent tasks. The application 122 includes program instructions for implementing various user-desired functions, and the application 122 may be, for example, a compatibility layer, instant messaging software, software development tools (e.g., integrated development environment IDE, compiler, etc.), etc., but is not limited thereto. When the application 122 is run into the computing device 100, a driver module may be added to the operating system 120.

[0040] When the computing device 100 is running, the processor 104 reads and executes the program instructions of the operating system 120 from the system memory 106. The application 122 runs on the operating system 120 and uses the interfaces provided by the operating system 120 and the underlying hardware to implement various functions desired by the user. When the user runs the application 122, the application 122 is loaded into the system memory 106, and the processor 104 reads and executes the program instructions of the application 122 from the system memory 106.

[0041] Computing device 100 also includes a storage device 132 including a removable storage 136 and a non-removable storage 138 , both of which are connected to storage interface bus 134 .

[0042] The computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via the bus / interface controller 130. Example output devices 142 include a graphics processing unit 148 and an audio processing unit 150. They can be configured to facilitate communication with various external devices such as a display or speakers via one or more A / V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 158. Example communication devices 146 may include a network controller 160, which may be arranged to facilitate communication with one or more other computing devices 162 via a network communication link via one or more communication ports 164.

[0043] A network communication link can be an example of a communication medium. Communication media can generally be embodied as computer-readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A "modulated data signal" can be a signal in which one or more of its data sets or its changes can be carried out in a manner that encodes information in the signal. As non-limiting examples, communication media can include wired media such as a wired network or a dedicated line network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer-readable medium used herein can include both storage media and communication media.

[0044] In the computing device 100 according to the present invention, the application 122 includes instructions for executing the file access method 200 of the present invention, and the instructions can instruct the processor 104 to execute the file access method of the present invention. Those skilled in the art can understand that, in addition to the instructions for executing the file access method 200, the application 122 can also include other applications 126 for implementing other functions.

[0045] Figure 2 A flowchart of a file access method 200 according to an embodiment of the present invention is shown. The method 200 is suitable for running on a computing device 100 (eg Figure 1 The invention is adapted to be executed in an operating system on the computing device 100 shown in the figure, and further, is adapted to be executed in a compatibility layer provided by the operating system.

[0046] A first operating system is running in the computing device. The first operating system is a native operating system running in the computing device. The first operating system provides a compatibility layer. An application of the second operating system is running in the compatibility layer. The application of the second operating system here can be understood as the operating environment required by the application being the second operating system. The first operating system and the second operating system can be set according to actual application scenarios, and the present invention does not limit this. For example, the first operating system is a Linux operating system and the second operating system is a Windows operating system.

[0047] The compatibility layer can be set according to the actual application scenario, and the present invention does not limit this. For example, the compatibility layer can be a wine compatibility layer, which is a compatibility layer that can run Windows applications on multiple compatible operating systems (such as Linux, Mac, BSD, etc.). The wine compatibility layer does not imitate the entire Windows system like a virtual machine, but dynamically converts Windows API calls to multiple compatible operating system calls of the native machine. Compared with the virtual machine method, the memory consumption is greatly reduced, and the performance is almost the same as running on the Windows operating system.

[0048] When multiple second operating system applications are installed, the first operating system creates multiple containers through the compatibility layer. In order to avoid interference between applications, one second operating system application is generally installed and run in one container, that is, at this time, the compatibility layer of the first operating system includes multiple containers, and the number of containers is the same as the number of installed second operating system applications. In the following content, the second operating system applications are collectively referred to as first applications.

[0049] It can be concluded from the above content that the file access method 200 provided by the present invention is suitable for execution in any container of the compatibility layer provided by the operating system.

[0050] From the above content, it can be seen that any container corresponds to a container directory. The first application running in the container can only access the files in the container directory of the container where it is located. The container directory may include the native directory of the container (the native directory of the container is as follows: Figure 3 ) and the file directory of the first operating system that has been mapped to the container directory, that is, at this time, the application running in the container can access the files in the native directory of the container and the files of the first operating system that have been mapped to the container directory. The container directory including the native directory of the container and the file directory of the first operating system that has been mapped to the container directory is as shown in Figure 4 As shown, 4-1 is a file directory of part of the first operating system that has been mapped to the container directory, and the rest is the native directory of the container.

[0051] In addition to storing a container directory, each container also stores a whitelist and an address file. The whitelist records the developer whitelist of applications running in the container. Any data item in the address file corresponds one-to-one to the file path of the first operating system selected by the user and mapped to the compatibility layer. Any data item in the address file is a compressed path, and the compression method can be set according to the actual application scenario, which is not limited by the present invention. For example, the file path is compressed by a compression algorithm, and further, the compression algorithm can be an MD5 algorithm.

[0052] Taking the user currently logged in to the first application as Frank as an example, the original file path selected by user Frank in the address file is shown in the first column of Table 2, and the compressed path obtained by compressing the string of the original file path using the MD5 algorithm is shown in the second column of Table 2.

[0053] Table 2

[0054]

[0055]

[0056] In one embodiment, the key code example of the compressed path obtained by compressing the string of the original file path through the MD5 algorithm is as follows:

[0057]

[0058] In one implementation, the address file can be implemented as an address table, and the process of generating the address table by the wine container can also be understood as the process of updating the address table. The specific implementation method of updating the address table is as follows:

[0059] In response to the user triggering the pop-up file browsing dialog interface, a file browsing dialog box pops up, which includes multiple file names (i.e., file paths). After the user selects one or more file paths by dragging the mouse, the file paths selected by the user are traversed, and the file paths are compressed by a compression algorithm to obtain a compressed address corresponding to the selected file path, and the content of the address table is updated to the currently obtained compressed address. Multiple file names in the file browsing dialog box can be displayed in a list.

[0060] Taking the second operating system as Windows operating system as an example, the specific implementation method of updating the address table is described as follows:

[0061] First, since the pop-up file browsing dialog box of Windows applications is implemented by calling the GetOpenFileNameA and GetOpenFileNameW functions of the comdlg32 module, when traversing the file path selected by the user, it is only necessary to modify the GetOpenFileNameA and GetOpenFileNameW functions of the comdlg32 module of wine. After determining the file selected by the user, traverse the memory block pointed to by the lpstrFile member of the OPENFILENAMEA and OPENFILENAMEW structures. Each time a NULL character is detected, the process of a file name ends. When two consecutive NULL characters are encountered, the flag indicates that the process of traversing the currently selected file ends.

[0062] Afterwards, since the Windows application obtains the list of file names dragged and dropped by the mouse, it is implemented by calling the DragQueryFileA and DragQueryFileW functions of the shell32 module. Therefore, in the process of updating the content of the address table to the currently obtained compressed address, it is only necessary to modify the DragQueryFileA and DragQueryFileW functions of the shell32 module of the wine container (the wine container corresponding to the first application). After obtaining the file name selected by the user, a compression operation is performed to obtain the compressed file path, which is overwritten in the short_table_for_select_files table (i.e., the address table).

[0063] In one embodiment, the critical code examples for updating the address table are as follows:

[0064]

[0065]

[0066] like Figure 2 As shown, the method 200 includes steps S210 to S260. First, step S210 is executed to monitor whether the first application running in the current container accesses the target file. When any container detects that the first application running therein accesses the target file (the target file is a file of the first operating system), step S220 is executed to determine whether the currently running first application is credible. If so, step S260 is executed. If not, step S230 is executed.

[0067] Specifically, determine whether the currently running first application has a file signature. If so, obtain the file signature of the first application as the first file signature, and verify whether the first file signature is valid. If valid, obtain the developer information corresponding to the first application from the first file signature as the first information, and determine whether the first information is found from the whitelist. If so, determine that the first application is trustworthy. Among them, the developer information can be set according to the actual application scenario, and the present invention is not limited to this. For example, the developer information can be the developer name. Among them, the method for verifying whether the first file signature is valid can be set according to the actual application scenario, and the present invention is not limited to this. For example, the validity of the file signature can be verified by an encryption algorithm. Further, the encryption algorithm can be an RSA encryption algorithm.

[0068] Taking the second operating system as Windows operating system as an example, since Windows applications access files by calling CreateFileA and CreateFileW functions of kernel32 module, it is only necessary to modify CreateFileA and CreateFileW functions of kernel32 module of wine container (wine container corresponding to the first application), and at the very beginning of these two functions, first check whether the g_trust_app variable is a trusted program, and if it is a trusted program, directly execute step S260 to continue the process of opening the target file.

[0069] Since most Window applications are stored in PE file format, the executable file corresponding to the first application is a PE file, and the first file signature may be a PE file signature, and the PE file signature may be stored in the PE file of the first application.

[0070] For example, the steps of obtaining the developer information corresponding to the first application are:

[0071] Define a sha1 summary list g_trusted_vendor of trusted application developer names. The list without data items corresponds to a list of trusted application developers. You can download the installation program of the series of software from the official website of each application developer and extract the developer information from the information of the PE file signature of the application. Taking the application WeChat as an example, the PE file signature information of its main program WeChat.exe is as follows:

[0072] C=CN, S=Guangdong, L=Shenzhen, O=Tencent Technology (Shenzhen) Company Limited, OU=aa, CN=Tencent Technology (Shenzhen) Company Limited

[0073] Among them, field C represents the country, field S represents the state or province, field L represents the local name, field O represents the name of the application developer, field OU represents the name of the application developer's business unit, and field CN represents the common name. Therefore, the developer name of the WeChat application is the value of the O field: Tencent Technology (Shenzhen) Company Limited.

[0074] In one implementation, taking the first file signature as a PE file signature and verifying whether the file signature is valid through the RSA encryption algorithm as an example, the steps for verifying the validity of the file signature algorithm are described:

[0075] First, read the digital certificate from the PE file (the digital certificate is the digital certificate of the public key used by the application sender to encrypt the PE file of the first application through an encryption algorithm), and verify the validity of the certificate chain of the digital certificate one by one based on the certificate chain information of the digital certificate. If all certificate chains are valid, it means that the digital certificate is valid, and the PE file signature can be decrypted. If not, it means that the digital certificate is invalid. In order to ensure data security, the PE file signature is not decrypted.

[0076] Next, the PE file signature is decrypted by the public key of the valid digital certificate to obtain the information digest of the PE file as the first information digest. The information digest of the PE file is further calculated by hashing as the second information digest to determine whether the first information digest is equal to the second information digest. If so, it indicates that the PE file signature is valid.

[0077] It should be noted that the above only provides an RSA encryption algorithm to verify whether the PE signature is valid. In practice, other methods, such as AES-based methods, may also be used, and the present invention does not specifically limit this.

[0078] According to one embodiment of the present invention, an example of a critical code for determining whether a currently running first application is trustworthy is as follows:

[0079]

[0080]

[0081]

[0082] Since viruses or malicious programs destroy files by calling APIs to quietly scan disk files in the background and then infect or damage the scanned files, in order to filter out the damage caused by background scanning of viruses or malicious programs, when the currently running first application is untrusted, step S230 is executed to determine whether the target file is a file selected by the user, so as to identify whether the user actively accesses the target file or the background process silently accesses the target file, wherein the target file is a file in the first operating system that has been mapped to the container directory of the compatibility layer.

[0083] Specifically, the path of the target file is obtained as the first path, and the first path is compressed as the second path. It is determined whether the second path is found from the address file. If so, it means that the target file is a file selected by the user, that is, a file actively selected by the user, and step S260 is continued. If not, it means that the target file is not a file selected by the user. At this time, the file is accessed silently by the background process. In order to filter out the damage caused by the background scanning of viruses or malicious programs, step S240 is continued.

[0084] For example, if the currently running application is not a trusted application, the target file path is first compressed to obtain the compressed address of the target file, and then the short_table_for_select_files table (i.e., the address table) is traversed to determine whether the compressed address of the target file exists in the address table. If so, it means that the file is the file most recently selected by the user, and step S260 is directly executed to continue the process of opening the target file. If not, step S240 is executed.

[0085] From the above content, it can be seen that when the currently running first application is untrusted, it is identified whether the user actively accesses the target file or the background process silently accesses the target file. If the target file is a file selected by the user, that is, a file actively selected by the user, the currently running first application is allowed to access the target file. If not, it means that the background process silently accesses the file at this time. In order to filter out the damage caused by background scanning of viruses or malicious programs, access to the target file is blocked, thereby improving the security of file access.

[0086] Furthermore, since the paths in the address file are compressed paths and occupy less memory resources, the speed of traversing the address file can be increased, thereby improving the efficiency of file access.

[0087] Then, step S240 is executed to pop up a first prompt box to prompt the user that the first application currently running is untrustworthy, that is, to prompt the user that the currently running application is dangerous and may damage the security of the file data of the first operating system.

[0088] The first prompt box may be a warning dialog box. The content of the first prompt box can be used to remind the user that the currently running application is dangerous, and the present invention does not limit it. For example, the content of the first prompt box may be "An unknown program is accessing files outside the container. This access may damage your file data. Do you want to allow it to access?" It should be noted that the first prompt box includes a button to allow access and a button to not allow access.

[0089] After the first prompt box pops up, continue to execute step S250 to determine whether the user selects the allow access button in the first prompt box. If so, that is, when the user selects the allow access button in the first prompt box, respond to the operation and execute step S260 to allow the currently running first application to access the target file. If the user selects the not allow access button in the first prompt box, respond to the operation and do not access the target file, and continue to execute step S210 to monitor whether the first application running in the current container accesses the target file.

[0090] At this point, the application of the second operating system running in the wine container has achieved secure access to the files of the first operating system. Whenever the application of the second operating system running in any wine container is about to access the files of the first operating system, steps S210 to S260 are executed.

[0091] In one embodiment, when the user selects a file in the currently displayed dialog box, in response to the operation, the address file is updated to the compressed file path corresponding to the currently selected file name. The specific implementation process is as described above and will not be repeated here.

[0092] From the above content, it can be seen that according to the file access method of the present invention, when any first application running in any container created by the compatibility layer is monitored to access the target file, it is first determined whether the currently running first application is credible. If so, it means that the first application currently running in any container is safe, and the currently running first application is allowed to access the target file. If the first application currently running in any container is not credible, the user is monitored to open the file browsing dialog box or drag and drop the mouse to identify whether the user actively accesses the file or the background process silently accesses the file. If it is a background process silently accessing, there is a certain risk, then it is blocked and a danger prompt is given. If not, the currently running first application is allowed to access the target file. It can be seen that when running unknown or untrusted applications in a container, these applications can be effectively prevented from destroying the file data of the operating system outside the container, improving the security of file access, and having no impact on the user's experience.

[0093] Furthermore, since the paths in the address file are compressed paths and occupy less memory resources, the speed of traversing the address file can be increased, thereby improving the efficiency of file access.

[0094] The various techniques described herein may be implemented in combination with hardware or software, or a combination thereof. Thus, the method and apparatus of the present invention, or some aspects or parts of the method and apparatus of the present invention may be in the form of program codes (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.

[0095] In the case where the program code is executed on a programmable computer, the computing device generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store the program code; the processor is configured to execute the file access method of the present invention according to the instructions in the program code stored in the memory.

[0096] By way of example and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer readable instructions, data structures, program modules or other data. Communication media generally embody computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and include any information transfer medium. Any combination of the above is also included within the scope of readable media.

[0097] In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the examples of the present invention. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to implement the content of the present invention described herein, and the above description of specific languages ​​is for the purpose of disclosing the best mode of the present invention.

[0098] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0099] It should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those expressly recited in each claim. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.

[0100] Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in the devices described in the embodiment, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or may be divided into multiple submodules.

[0101] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0102] Furthermore, those skilled in the art will appreciate that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present invention and to form different embodiments.

[0103] In addition, some of the embodiments are described herein as methods or combinations of method elements that can be implemented by a processor of a computer system or by other devices that perform the functions. Therefore, a processor with necessary instructions for implementing the method or method elements forms a device for implementing the method or method elements. In addition, the elements described herein of the device embodiments are examples of devices for implementing the functions performed by the elements for the purpose of implementing the invention.

[0104] As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe common objects merely indicates that different instances of similar objects are involved, and is not intended to imply that the objects so described must have a given order in time, space, order, or in any other manner.

[0105] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and didactic purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is illustrative, not restrictive, with respect to the scope of the present invention, which is defined by the appended claims.

Claims

1. A file access method, adapted to be executed in a compatibility layer of a first operating system of a computing device, wherein the compatibility layer is adapted to run a first application program, wherein the operating environment required by the first application program is a second operating system, wherein an address file is stored in the compatibility layer, wherein any data item in the address file corresponds one-to-one to a file path of the first operating system selected by a user in a file browsing dialog box and mapped to the compatibility layer, wherein the method comprises: In response to monitoring an operation of any running first application program accessing a target file, determining whether the currently running first application program is trustworthy, and if so, allowing the currently running first application program to access the target file, wherein the target file is a file in the first operating system that has been mapped to the compatibility layer, and any first application program runs in any container created by the compatibility layer; If not, continue to determine whether the target file is a file selected by the user, and if the target file is a file selected by the user, allow the currently running first application to access the target file; If the target file is not the file selected by the user, a first prompt box is popped up to prompt the user that the currently running first application is untrustworthy.

2. The method of claim 1, wherein: The compatibility layer stores a whitelist of application developers, and the step of determining whether the currently running first application is credible includes: It is determined through the whitelist whether the currently running first application is credible.

3. The method of claim 2, wherein: The step of judging whether the currently running first application is credible by using the whitelist includes: Determine whether a file signature exists for the currently running first application, and if so, obtain the file signature of the first application as the first file signature; Verifying whether the first file signature is valid, and if valid, obtaining developer information corresponding to the first application from the first file signature as first information; It is determined whether the first information is found in the whitelist, and if so, it is determined that the first application is credible.

4. The method of claim 3, wherein: The compatibility layer also stores an address file, and any data item in the address file corresponds one-to-one to a file path of the first operating system selected by the user and mapped to the compatibility layer. The step of continuing to determine whether the target file is the file selected by the user includes: Obtaining the path of the target file as the first path; Determine whether the first path is found in the address file, and if so, the target file is the file selected by the user; Acquiring developer information corresponding to the first application from the first file signature includes: Define a sha1l summary list of trusted application developers' names, where each data item in the sha1l summary list corresponds to a list of trusted application developers, so that applications can be downloaded from the official websites of each application developer; Extract the developer information from the application's PE file signature information.

5. The method of claim 4, wherein: Any data item in the address file is a compressed path, and the method further comprises the steps of: compressing the first path as a second path; The step of determining whether the first path is found in the address file includes: Determine whether the second path is found in the address file.

6. The method of claim 5, wherein: The character string of the first path is compressed using a preset compression algorithm to obtain the second path.

7. The method according to claim 6, further comprising the steps of: In response to monitoring an operation of selecting a file in the file browsing dialog box, obtaining a file path of the selected file; Compress the character string of the file path to obtain a first address; The data in the address file is updated to the first address.

8. The method of claim 7, wherein: The first prompt box includes an access permission button and a access disallowance button, and the method further includes the steps of: When the operation of selecting the access permission button in the first prompt box is detected, the current first application is allowed to access the target file.

9. A computing device comprising: at least one processor; as well as A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, and the program instructions include instructions for executing the method according to any one of claims 1 to 8.

10. A readable storage medium storing program instructions, when the program instructions are read and executed by a computing device, the computing device executes the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Integration of untrusted applications and frameworks with a secure operating system environment

    CN103780959A

  • File measurement and protection method and device

    CN104951708A