Re: [net-next 0/4] devlink: add dry run support for flash update
From: Jakub Kicinski <kuba@kernel.org>
Date: 2021-10-09 01:31:36
On Sat, 9 Oct 2021 00:32:49 +0000 Keller, Jacob E wrote:
Ah.. I see how its done. It's passed as the argument so you don't see a direct comparison which makes it look like there isn't one... Feels like there could probably be a better abstraction that was more readable here... Anyways. I'll confirm what happens on the kernel that doesn't have the attribute defined at all. I wonder if the thing I saw differently was because the attribute *was* known but wasn't in policy. I.e. because it was defined it was validated.... Yep, I confirm that on a kernel without the DRY_RUN flag that it would allow the run because we aren't being strict. I am guessing that we can't convert devlink over to strict validation?
I think the current best practice is not to opt-in commands which started out as non-strict into strict validation. That said opting it in for MAXTYPE validation seems reasonable to me. Alternatively, as I said, you can just check the max attr for the family in user space. CTRL_CMD_GETFAMILY returns it as part of family info (CTRL_ATTR_MAXATTR). We can make user space do the rejecting.