Heat a medium pot over medium heat. When hot, add the oil.
Add the mushrooms and cook until lightly browned, approximately 3 minutes.
Add the garlic, rosemary, and cornstarch. Stir to combine. Cook until fragrant and flour is cooked, 1 minute.
Add the wine, stock, salt, and pepper. Simmer for 10 minutes.
Add the butter and stir in to combine into the sauce. Remove from heat.
Toss with pasta or use as desired. Add more stock, pasta water, or water as needed to loosen and get the consistency you want. Or thicken with more cornstarch mixed into liquid over a simmer.