Limiting the effects of source code patches on corresponding native-code patches

US10248409B1 · US · B1

Patent metadata
FieldValue
Publication numberUS-10248409-B1
Application numberUS-201414559869-A
CountryUS
Kind codeB1
Filing dateDec 3, 2014
Priority dateDec 3, 2014
Publication dateApr 2, 2019
Grant dateApr 2, 2019

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

A code patching component may insert a binary patch into a native-code representation of a program during execution. Prior to inserting the binary patch, a patch code analysis tool may receive a source code patch for the program, and determine that applying the source code patch would change the binary for the program outside of the patched area (e.g., due to changes in the number of lines, changes in the file names or path information for source code files from which the program is built, or line directives that embed line numbers or file names in the binary for the patched program). The tool may modify the source code patch to limit its effects to the patch area by adding empty lines, merging of lines of code, or forcing a line number change. The tool may filter line directives to match previously embedded file name information.

First claim

Opening claim text (preview).

What is claimed is: 1. A method, comprising: performing by one or more computers: creating a source code patch for a first source code representation of a software program; generating a binary update to be applied to a first binary code representation of the software program during execution of the first binary code representation of the software program, wherein generating the binary update comprises: transforming the source code patch to avoid introducing differences between line number information that is embedded in the first binary code representation of the software program and line number information that will be embedded in a new binary code representation of the software program other than in the portion of the new binary representation of the software program that includes the binary update; applying the transformed source code patch to the first source code representation of the software program to produce a patched version of the source code representation of the software program; determining that a representation of a source code file name that will be embedded in the new binary code representation of the software program does not match a representation of a corresponding source code file name that is embedded in the first binary code representation of the software program; responsive to the determination, transforming the representation of the source code file name that will be embedded in the new binary code representation of the software program prior to creating the new binary code representation of the software program from the patched version of the source code representation of the software program; creating the new binary code representation of the software program from the patched version of the source code representation of the software program, wherein the new binary code representation includes at least one instance of the transformed representation of the source code file name; comparing the first binary code representation of the software program to the new binary code representation of the software program; and generating the binary update, based at least in part on said comparing; and applying the binary update to the first binary code representation of the software program during execution of the first binary code representation of the software program. 2. The method of claim 1 , wherein transforming the source code patch comprises: applying the source code patch to the first source code representation of the software program to produce an intermediate source code representation of the software program; performing an operation to compare the intermediate source code representation of the software program to the first source code representation of the software program and to create a representation of the differences between the intermediate source code representation of the software program and the first source code representation of the software program; determining, based at least in part on the representation of the differences, that applying the source code patch to the first source code representation of the software program changed the number of lines in at least a portion of the source code representation of the software program; and performing one or more of: inserting a non-functional line in the source code patch; or merging the contents of two or more lines in the source code patch onto a single line in the source code patch. 3. The method of claim 1 , wherein transforming the source code patch comprises: applying the source code patch to the first source code representation of the software program to produce an intermediate source code representation of the software program; performing an operation to compare the intermediate source code representation of the software program to the first source code representation of the software program and to create a representation of the differences between the intermediate source code representation of the software program and the first source code representation of the software program; determining, based at least in part on the representation of the differences, that applying the source code patch to the first source code representation of the software program changed the number of lines in at least a portion of the source code representation of the software program; and inserting a directive into the source code patch that modifies a line number value that is associated with the line in the source code patch on which the directive is inserted. 4. The method of claim 1 , wherein applying the binary update to the first binary code representation of the software program comprises inserting the binary update into the memory in which the first binary code representation of the software program is located such that a sequence of native-code program instructions in the memory are replaced by another sequence of native-code program instructions. 5. A system, comprising: one or more processors; and a memory coupled to the one or more processors; wherein the memory stores a native-code representation of a program that is executable by the one or more processors; and a code patching component; wherein during execution of the program and the code patching component, the code patching component is configured to: receive a source code patch representing an update that is directed to a given portion of the program; perform one or more operations to ensure that, when the update represented by the source code patch is applied to a source code representation of the given portion of the program, changes to the native-code representation of the program in one or more other portions of the program are reduced or avoided, including: determine that a representation of a source code file name that will be embedded in a new native-code representation of the program does not match a representation of a corresponding source code file name that is embedded in a native-code representation of the program; responsive to the determination, transforming the representation of the source code file name that will be embedded in the new native-code representation of the program prior to creating the new native-code representation of the program from the patched version of the source code representation of the software program; and apply the update to the given portion of the program, wherein to apply the update to the given portion of the program, the code patching component: applies the source code patch to the source code representation of the given portion of the program or applies a modified source code patch representing the update to the source code representation of the given portion of the program to produce an intermediate source code representation of the program, creates the new native-code representation of the program from the intermediate source code representation of the program and replaces at least one instance of the representation of the source code file name in the new native-code representation with the transformed representation of the source code file name, compares the native-code representation of the program to the new native-code representation of the program, and generates a native-code patch dependent at least in part on the comparison. 6. The system of claim 5 , wherein the one or more operations comprise an operation to generate the modified source code patch from the source code patch that, when applied to the source code representation of the given portion of the program, isolates changes to the native-code representation of the program to the given portion of the program; and wherein to apply the update to the given portion of the program, the code patching component is configured to apply the modified source code patch to the source code representation of the given port

Assignees

Inventors

Classifications

  • Updates (security arrangements therefor G06F21/57) · CPC title

  • G06F8/656Primary

    while running · CPC title

  • Version control (security arrangements therefor G06F21/57); Configuration management · CPC title

  • Incremental updates; Differential updates · CPC title

  • Creation or generation of source code · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US10248409B1 cover?
A code patching component may insert a binary patch into a native-code representation of a program during execution. Prior to inserting the binary patch, a patch code analysis tool may receive a source code patch for the program, and determine that applying the source code patch would change the binary for the program outside of the patched area (e.g., due to changes in the number of lines, cha…
Who is the assignee on this patent?
Amazon Tech Inc
What technology area does this patent fall under?
Primary CPC classification G06F8/656. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Apr 02 2019 00:00:00 GMT+0000 (Coordinated Universal Time) (B1). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 8 related publications on this page (citations in our corpus or others sharing the same primary CPC).