Run-time code injection to perform checks

A digital rights management system permits an application owner to cause code to be injected into the application's run-time instruction stream so as to restrict execution of that application to specific hardware platforms. In a first phase, an authorizing entity (e.g., an application owner or platform manufacturer) authorizes one or more applications to execute on a given hardware platform. Later, during application run-time, code is injected that performs periodic checks are made to determine if the application continues to run on the previously authorized hardware platform. If a periodic check fails, at least part of the application's execution string is terminated—effectively rendering the application non-usable. The periodic check is transparent to the user and difficult to circumvent.

The invention relates generally to digital rights management and more particularly, by way of example, to performing a check at run-time to determine if a software application is authorized to execute on a specific hardware platform.

It has become common practice for computer system manufacturers to preload their hardware platforms with one or more software applications. The single, most widespread, application being the operating system. In many instances, the developer of an application may wish to restrict its execution to a specific computer system or hardware platform. Once an application has been distributed, however, the application's developer/owner has little control over its subsequent re-distribution. This is becoming an especially vexing problem in that virtually every new computer system in the marketplace includes the software and hardware needed to: make exact copies of digital content (e.g., applications and multimedia content); transfer these copies to magnetic or optical disks; and distribute these copies via a computer network (e.g., the Internet or corporate or academic intranet).

The application owner may, of course, require the user to promise not to copy, distribute or use the application on another platform as part of the transaction by which the user obtains their copy. Such promises are, however, easy to make and easy to break. The application owner may also attempt to prevent re-distribution or re-use in a number of ways, usually involving encryption and decryption of the application or the use of specialized security hardware devices (“dongles”). There is very little, however, that these approaches can do to thwart a determined user.

Thus, it would be beneficial to provide a mechanism to restrict the execution of one or more applications to a specific hardware platform that is transparent to the user.

SUMMARY

In one embodiment, the invention provides a method to manage the execution rights of an application. The method includes selecting an execution unit associated with the application whose execution is to be monitored and controlled. Once selected, instructions are injected into the application's run-time instruction sequence to generate a cryptologic challenge. In one embodiment, instructions are injected into the application's run-time instruction sequence at a later time to obtain and verify a response to the cryptologic challenge. If the obtained response fails verification, the execution unit is halted. Illustrative execution units include threads and processes. Illustrative applications include operating system and user applications. Illustrative operating system applications include user-interface critical applications. Methods in accordance with the invention may be implemented as computer executable instructions and stored in any media that is readable and executable by a computer system.

DETAILED DESCRIPTION

Methods, devices and systems to limit the execution of software applications to unique hardware platforms by injecting code in a run-time environment are described. Illustrative software applications include, but are not limited to, operating systems, user applications and specific versions of operating systems and user applications. Illustrative hardware platforms include, but are not limited to, personal computers, server computer systems, personal digital assistant devices and mobile telephones. While the claimed subject matter is not so limited, the following embodiments of the invention, described in terms of Trusted Platform Modules (“TPMs”) and operating system software from APPLE COMPUTER, INC. of Cupertino, Calif., are illustrative only and are not to be considered limiting in any respect.

One of ordinary skill in the art will recognize that TPMs are commercially available components that perform a set of cryptographic (“crypto”) capabilities internally such that hardware and software agents outside the TPM do not have access to the execution of these functions. Accordingly, hardware and software external to the TPM can only provide input-output to the TPM. Illustrative crypto capabilities include, but are not limited to, an RSA engine for encryption and decryption operations, a SHA-1 hash algorithm engine, a random number generator and private, non-volatile, memory. Stored within a TPM's non-volatile memory is an endorsement key comprising a public/private key pair that is unique to each instance of a TPM—the private component of which is never exposed outside the TPM. A TPM is typically embodied in a semiconductor chip that is affixed to a hardware platform's circuit board (e.g., a computer system's motherboard). It will further be recognized that TPM operations may conform to Trusted Computing Platform Alliance (“TCPA”) specifications as published by the Trusted Computing Group (see https://www.trustedcomputinggroup.org/home), including the support of industry-standard cryptographic Application Programming Interfaces (“APIs”).

FIG. 1shows an illustrative personal computer system architecture incorporating a TPM. As shown, computer system100includes central processing unit (“CPU”)105, system controller110, random access or volatile memory (“RAM”)115, display120, Boot read-only memory (“ROM”)125, TPM130, one or more embedded devices135and zero or more removable devices140. Illustrative embedded devices include, but are not limited to, audio and storage devices. Illustrative removable devices include, but are not limited to, keyboards, pointer devices and storage devices. In illustrative system100, encryption keys and other critical security information are stored in non-volatile memory within TPM130and, as noted above, CPU105(or software executing on CPU105) communicates with TPM130via industry-standard APIs.

Referring toFIG. 2, authorization technique200in accordance with the invention generally includes pre-use phase205and run-time phase210. During pre-use phase205, a hardware platform is authorized to run specified applications such as, for example, an operating system or a specified version thereof. In one embodiment, pre-use phase205is performed at the time a hardware platform (e.g., computer system) is manufactured or, at least, prior to delivery to the end-user. During run-time phase210, periodic challenges are generated that verify the platform is authorized to use the specified application(s). Accordingly, run-time phase210is performed during end-user activities on a generally on-going basis.

Referring toFIG. 3, in one embodiment pre-use phase205is performed at platform manufacture time. Following assembly of the target hardware platform including, intera/ia, inclusion of TPM130(block300), the unit's hardware is tested (block305). On successful conclusion of hardware tests, the platform is authorized to execute the specified applications (block310), after which applications may be loaded onto the platform's non-volatile storage device(s) (block315) and the unit shipped to the end-user (block320).

The acts of authorizing a hardware platform in accordance with one embodiment of the invention and pursuant to block310ofFIG. 3are illustrated inFIG. 4. As shown, the TPM's public key is obtained (block400) and used to encrypt the authorizing entity's key (block405). That is, the authorizing entity's private key may be encrypted external to TPM130. In one embodiment, the authorizing entity's key may be a key unique to the application being authorized. In another embodiment, the authorizing entity's key may be a key unique to the entity (e.g., the business). One of ordinary skill in the art will recognize that key blob410resulting from the acts of block405is clear-text. That is, it can be read, stored and transmitted as ordinary text. Once generated, the key blob is stored on the target platform (block415). Typically, key blob410would be stored within TPM130, although it may also be stored in non-volatile memory (e.g., non-volatile RAM and/or disk memory) associated with system100. In another embodiment, the authorizing entity's key may be transmitted to the TPM which encrypts it using internal hardware capabilities (see discussion above). Again, the resulting key block could be stored within TPM130and/or in non-volatile memory associated with the rest of system100.

At some point in time following completion of pre-use phase205, a user obtains and begins using system100. It is at this time that run-time phase210begins. Referring toFIG. 5, run-time phase210periodically generates a challenge to system100(block500). As discussed more fully below, a challenge causes system100to inject code into an application's executing code sequence/stream that causes data to be sent to TPM130for cryptologic signing. The resulting signature is then checked to verify that it was signed using the authorizing entity's key in accordance withFIG. 4. If the comparison determines that the platform is authorized to execute one or more running applications (the “YES” prong of block505), another challenge is generated in accordance with the acts of block500at some time in the future. If the platform is not authorized (the “NO” prong of block505), the effective use of system100is halted (block510).

In general, the component generating the challenge (injecting code into an executing code path at run-time) is a trusted component of system100so that its operation can be relied upon. In one embodiment, designed for use on a platform executing the MAC OS X operating system (“OS”) from APPLE COMPUTER, INC. of Cupertino, Calif., the component responsible for generating challenges (block500), determining the veracity of the results thereto (block505) and, if necessary, halting the system (block510) is the dynamic translator component of the operating system.

It will be recognized that the dynamic translator is that component of the operating system that invokes and manages dynamically generated object code threads. That is, threads (or processes) whose object code and execution are controlled through just-in-time (“JIT”) compilation techniques. In the MAC OS X, the dynamic translator is responsible for the execution of, inter alia, system and user interface critical applications such as, for example, the system font server and system user-interface server applications. In other embodiments, however, dynamically generated object code entities (e.g., threads or processes) may be associated with any application. For example, spreadsheet, word processing or audio playback applications. Referring toFIG. 6, in the MAC OS X environment, dynamic translator600retrieves code at run-time associated with certain system critical applications (APP(1)605through APP(N)610) and compiles the code for execution into threads (T(1)615through T(M)620) that run in operating system dedicated RAM115. As part of this process, dynamic translator600maintains information identifying which applications have threads instantiated in memory115, which applications each thread is associated with and the state of each thread (e.g., executing or blocked).

Referring toFIG. 7, a more detailed discussion of the acts associated with block500are described. At periodic times (e.g., every 5-10 minutes) dynamic translator600selects a thread from those it has instantiated (block700). In general, the selected time period should be small enough to prevent significant use of an unauthorized application or system, yet long enough so as not to degrade system performance. In one embodiment, threads are selected randomly from all those threads available to dynamic translator600, excluding those currently being used to generate challenges. In another embodiment, dynamic translator600selects a thread based upon one or more specified criteria. For example, the most recently (or least recently) invoked thread not already being used to generate a challenge. Next, dynamic translator600injects instructions into the translated code stream to cause the selected thread to generate a cryptographic challenge (block705). At some time in the future (e.g., 30 seconds to 2 minutes), dynamic translator600injects instructions into the translated code stream to cause the selected thread to obtain the results of the cryptographic challenge from TPM130and prove the challenge (block710). It will be recognized that the acts of block710are performed after TPM130has had an opportunity to complete its tasks (see discussion below).

In one embodiment, instructions injected into a thread's translated code stream by dynamic translator600in accordance with block705perform the functions outlined inFIG. 8. First, a quantum of data is generated (block800). In one embodiment, the quantum is twenty (20) bytes of randomly generated data. Next, the data quantum and key blob410obtained during the acts of block405are transmitted to TPM130(block805) which is then commanded to “sign” the data quantum (block810). In accordance with cryptologic standards, TPM130will then initiate a process that extracts the authorizing entity's private key from key blob410and use the extracted private key to “sign” the data quantum—producing a “signed block.” In one embodiment, key blob410is transmitted to a TPM each time a challenge is generated (seeFIG. 8). In another embodiment, the TPM is loaded with key blob410at computer system boot time and/or whenever a system wake event occurs (i.e., upon coming out of a system “sleep” operation).

In one embodiment, instructions inserted into a thread's translated code stream by dynamic translator600in accordance with block710perform the functions outlined inFIG. 9. As shown, the thread first obtains the signed block (block900) and then verifies the signature by performing a cryptologic signature verification (block905). Illustrative signature verification algorithms include, but are not limited to, the digital signature algorithm (“DSA”) as specified in the digital signature standard (“DSS”) published by the US government (see, for example, the Federal Information Processing Standards Publication 186) or a compatible algorithm such as, for example, an RSA digital signature algorithm.

Referring again toFIG. 5, in the described embodiment the acts of block505correspond to determining whether the signature verification algorithm used in accordance with block710indicates a match (meaning the data quantum generated in accordance with block800was signed by the private key encoded within key blob410and passed to the TPM during the acts of block805) or not. Since the only way the data quantum could have been signed using the authorizing entity's private key was for that key to be encoded within key blob410during pre-use phase205, a match (the “YES” prong of block505) indicates the hardware platform is authorized to use the specific application(s) executing thereon. A match failure (the “NO” prong of block505) indicates the hardware platform is not authorized to do so. In accordance with block510, the thread associated with a failed challenge is terminated—effectively disabling continued use of system100. In one embodiment, only the thread associated with the failed challenge is halted. In another embodiment, the dynamic translator is halted. In yet another embodiment, all threads associated with the application associated with the failed challenge are halted.

In an embodiment utilizing dynamic translator600(or a functionally similar component), threads may not be able to obtain the results of a challenge for one or more reasons. For example, the selected thread may terminate abnormally before a challenge is proved (block710). In addition, the selected thread may block precluding the timely performance of proving a challenge. In the event either of this conditions are detected (such information being available to dynamic translator600), another thread may be selected where after acts in accordance with block500are initiated for that thread. It will be understood that this approach permits more than one challenge to be “in progress” at any given time.

A digital authorization, or run-time check, technique in accordance with the invention permits an authorizing entity to restrict the execution of specific applications to unique (pre-authorized) hardware platforms in a secure manner. For example, using dynamic translator600(or a functionally similar component) in the manner described permits a substantially unpredictable memory location from which challenges are generated and proved. Additional security may be obtained by calculating the authorizing entity's public key (see block905) rather than retrieving it from a predetermined location. For still additional security, memory115assigned by dynamic translator600(or a functionally similar component) to a thread used in accordance with the invention may be tagged for immediate reuse by another thread/application in the event authorization in accordance with block505fails, or, once the thread completes processing (in the event authorization in accordance with block505is successful). Further, by ensuring the time between issuing successive challenges is relatively short (e.g., 5 to 10 minutes), a single authorized platform can be precluded from acting as an “authoring agent” for a commercially significant number of secondary systems. (That is, the TPM component of an authorized platform can be substantially prevented from being used by secondary, unauthorized, systems.)

Various changes in the materials, components, circuit elements, as well as in the details of the illustrated operational methods are possible without departing from the scope of the following claims. In one variation, pre-use phase205can be implemented after manufacture as long as the agent providing the authorizing entity's key has access to same. In these “post-build” embodiments, TPM130or system flash memory may be used to retain a plurality of hardware platform specific key blobs—one for each application or entity granting a user the right to execute their application(s). In another variation TPM130is not used. That is, the inventive techniques to perform checks through run-time code injection may be used in systems that do not have a TPM or other hardware dedicated cryptologic computational engine. In these cases, a general purpose computational element (e.g., a central processing or arithmetic processing unit) may be used instead of TPM130. In addition, the illustrative system ofFIG. 1may include additional or fewer components than shown. Further, acts in accordance withFIGS. 2-9may be performed by a programmable control device executing instructions organized into one or more program modules. A programmable control device may be a single computer processor, a special purpose processor (e.g., a digital signal processor, “DSP”), a plurality of processors coupled by a communications link or, at least in part, by a custom designed state machine. Custom designed state machines may be embodied in a hardware device such as an integrated circuit including, but not limited to, application specific integrated circuits (“ASICs”) or field programmable gate array (“FPGAs”). Storage devices suitable for tangibly embodying program instructions include, but are not limited to: magnetic disks (fixed, floppy, and removable) and tape; optical media such as CD-ROMs and digital video disks (“DVDs”); and semiconductor memory devices such as Electrically Programmable Read-Only Memory (“EPROM”), Electrically Erasable Programmable Read-Only Memory (“EEPROM”), Programmable Gate Arrays and flash devices.

The preceding description was presented to enable any person skilled in the art to make and use the invention as claimed and is provided in the context of the particular examples discussed above, variations of which will be readily apparent to those skilled in the art. Accordingly, the claims appended hereto are not intended to be limited by the disclosed embodiments, but are to be accorded their widest scope consistent with the principles and features disclosed herein.