Preheat oven to 350°F (175°C). Grease and flour two 9-inch round cake pans.
Whisk flour, sugar, baking soda, salt, and cocoa powder in a large bowl until combined.
Whisk oil, buttermilk, eggs, vanilla, vinegar, and red food coloring in a separate bowl until smooth.
Gradually add wet ingredients to dry ingredients. Mix until smooth, being careful not to overmix.
Divide batter evenly between pans. Bake for 30–35 minutes, or until a toothpick comes out clean.
Let cakes cool in pans for 10 minutes, then transfer to a wire rack to cool completely.
Beat softened cream cheese and butter until smooth. Add vanilla and salt. Gradually mix in powdered sugar until fluffy.
Place one cake layer on a plate. Spread frosting on top, stack the second layer, and frost the top and sides. Decorate with piping swirls if desired. Refrigerate cake for 30 minutes to set before slicing.