Re: [PATCH RESEND] KEYS: fix parsing invalid pkey info string
From: Linus Torvalds
Date: Mon Dec 17 2018 - 13:50:22 EST
On Mon, Dec 17, 2018 at 10:43 AM Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> Or maybe just remove it entirely, since it's clearly entirely
> incorrect from the very start.
.. or another alternative: remove the "Opt_err = -1" entirely.
Again, this seems to be a buggy pattern exclusive to the security
code. Nobody else does it, and using that negative value is basically
the source of those two bugs. It seems pointless and wrong.
So the *simplest* fix would seem to be to literally remove all those
"= -1" for the Opt_err initialization. Making the code smaller,
simpler, and fixing the bug in the process.
Hmm?
Linus