EXHIBIT 5.1

601 Lexington Avenue
New York, New York 10022
(212) 446-4800
www.kirkland.com
August 17, 2017
Ally Auto Assets LLC
Corporation Trust Center
1209 Orange Street
Wilmington, Delaware 19801
| Re: | Enforceability Opinion |
Ladies and Gentlemen:
We are issuing this opinion letter in our capacity as special counsel to Ally Bank and Ally Auto Assets LLC (the “Depositor”) in connection with the issuance of the Offered Notes (as defined on Exhibit A hereto) by Ally Auto Receivables Trust2017-4 (the “Issuing Entity”) pursuant to an Indenture (the “Indenture”), to be dated as of August 23, 2017 (the “Issuance Date”), between the Issuing Entity and Deutsche Bank Trust Company Americas, as indenture trustee (the “Indenture Trustee”), and certificates (the “Certificates”) pursuant to a Trust Agreement (the “Original Trust Agreement”), dated as of July 24, 2017, to be amended and restated as of the Issuance Date (the “Trust Agreement”), between the Depositor and BNY Mellon Trust of Delaware, as owner trustee and paying agent. The Issuing Entity will also issue notes and Certificates (as defined on Exhibit B hereto), at least 5% of which will be initially retained or held by the Depositor or a majority-owned affiliate of Ally Bank and approximately 95% of which will be initially held by the Depositor or an affiliate of the Depositor. Only the Offered Notes are being offered for sale in a transaction pursuant to the registration requirements of the Securities Act of 1933, as amended (the “Act”).
The Issuing Entity intends to issue the Offered Notes on the Issuance Date.
We are generally familiar with the proceedings required to be taken in connection with the proposed authorization, issuance and sale of the Offered Notes, and in order to express the opinion hereinafter stated, we have, among other things, examined and relied, to the extent we deem proper, on the following documents:
(i) a copy of the registration statement on FormSF-3 (FileNo. 333-204844) that was filed with the Securities and Exchange Commission (the “Commission”) pursuant to Rule 415 under the Act on June 9, 2015, as amended byPre-Effective
Beijing Chicago Hong Kong Houston London Los Angeles Munich Palo Alto San Francisco Shanghai Washington, D.C.

Ally Auto Assets LLC
August 17, 2017
Page 2
Amendment No. 1 on August 14, 2015, byPre-Effective Amendment No. 2 on September 24, 2015, byPre-Effective Amendment No. 3 on October 22, 2015, byPre-Effective Amendment No. 4 on October 30, 2015 and byPre-Effective Amendment No. 5 on November 6, 2015, with respect to asset-backed notes, including the Offered Notes, to be issued and sold in series from time to time, including the exhibits thereto, in the form in which it most recently became effective;
(ii) a copy of the preliminary prospectus, dated August 9, 2017 (the “Preliminary Prospectus”), relating to the Offered Notes that filed with the Commission pursuant to Rule 424(h) under the Act on August 9, 2017, and a copy of the prospectus, dated August 15, 2017 (the “Prospectus”), relating to the Offered Notes to be filed with the Commission pursuant to Rule 424(b)(5) under the Act on August 17, 2017;
(iii) the Original Trust Agreement and a form of the Trust Agreement;
(iv) a form of the Servicing Agreement among the Depositor, Ally Bank, as servicer, and the Issuing Entity;
(v) a form of the Trust Sale Agreement between the Depositor and the Issuing Entity;
(vi) a form of the Indenture;
(vii) a form of the Asset Representations Review Agreement among Clayton Fixed Income Services LLC, Ally Bank and the Issuing Entity;
(viii) a form of the Pooling Agreement between Ally Bank and the Depositor;
(ix) a form of the Administration Agreement among the Issuing Entity, the Indenture Trustee and Ally Bank, as administrator; and
(x) such other documents as we have deemed necessary for the expression of the opinions contained herein (collectively, the documents described in clauses (iii) through (ix) are referred to herein as the “Transaction Documents”).
In our examination, we have assumed that the Transaction Documents will be executed in the form submitted to us. We have also assumed, without independent verification, that the facts and representations and warranties in the documents upon which we relied are true and correct, and that the transactions contemplated by such documents have been or will be consummated strictly in accordance with their terms.

Ally Auto Assets LLC
August 17, 2017
Page 3
On the basis of the foregoing and on the basis of our examination of the Depositor’s Certificate of Formation and its Limited Liability Company Agreement, as amended, and a review of a Certificate of the Secretary of State of the State of Delaware as to the good standing of the Depositor, it is our opinion that:
(a) The Depositor is a limited liability company validly existing and in good standing under the laws of the State of Delaware.
(b) When duly executed and authenticated by the Indenture Trustee, in accordance with the terms of the Indenture, and issued and delivered against payment thereof, the Offered Notes will have been duly authorized by all necessary action of the Issuing Entity and will have been legally issued and will be enforceable in accordance with their terms and entitled to the benefits of the Transaction Documents, except as the same may be limited by Title 11 of the United States Code or other bankruptcy, insolvency, reorganization, moratorium or other laws relating to or affecting the enforcement of creditors’ rights or the relief of debtors, as may be in effect from time to time, or by general principles of equity.
We do not find it necessary for the purposes of this opinion, and accordingly we do not purport to cover herein, the application of securities or “Blue Sky” laws of the various states to the offer or sale of the Offered Notes.
We wish to advise you that we are members of the bar of the State of New York and the opinions expressed herein are limited to the laws of the State of New York, the federal law of the United States of America and the Delaware Limited Liability Company Act.
We hereby consent to the filing of this opinion with Form8-K in connection with the sale of the Offered Notes and the reference to our firm in the Prospectus under the captions “Legal Opinions.” In giving this consent, we do not thereby admit that we come within the category of persons whose consent is required under Section 7 of the Act or the rules and regulations of the Commission thereunder.
| | | | | | |
| | | | | | Sincerely, |
| | | |
| | | | | | /s/ Kirkland & Ellis LLP |
| | | |
| | | | | | KIRKLAND & ELLIS LLP |
EXHIBIT A
Offered Notes
$266,000,000 aggregate principal amount of theClass A-1 1.35000% Asset Backed Notes (the “ClassA-1 Notes”);
$320,150,000 aggregate principal amount of theClass A-2 1.59% Asset Backed Notes (the “ClassA-2 Notes”);
$320,150,000 aggregate principal amount of the Class A-3 1.75% Asset Backed Notes (the “ClassA-3 Notes”); and
$87,230,000 aggregate principal amount of the Class A-4 1.96% Asset Backed Notes (the “ClassA-4 Notes”).
TheClass A-1 Notes, theClass A-2 Notes, theClass A-3 Notes and theClass A-4 Notes are referred to collectively herein as the “Offered Notes.”
EXHIBIT B
Certificates
100% Fractional Undivided Interest of Asset Backed Certificates (the “Certificates”).