Re: [PATCH] bug: Switch data corruption check to __must_check

From: Kees Cook
Date: Mon Feb 06 2017 - 16:18:41 EST


On Mon, Feb 6, 2017 at 1:04 PM, Arnd Bergmann <arnd@xxxxxxxx> wrote:
> On Mon, Feb 6, 2017 at 9:45 PM, Kees Cook <keescook@xxxxxxxxxxxx> wrote:
>> The CHECK_DATA_CORRUPTION() macro was designed to have callers do
>> something meaningful/protective on failure. However, using "return false"
>> in the macro too strictly limits the design patterns of callers. Instead,
>> let callers handle the logic test directly, but make sure that the result
>> IS checked by forcing __must_check (which appears to not be able to be
>> used directly on macro expressions).
>>
>> Suggested-by: Arnd Bergmann <arnd@xxxxxxxx>
>> Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
>
> The patch looks ok, but I have no memory of suggesting this. Was this an older
> conversation we had that I already forgot, or did you confuse me with someone
> else?

Old conversation that we had. :)

https://patchwork.kernel.org/patch/9286627/

It just took me *cough* 6 months ... :P

-Kees

--
Kees Cook
Pixel Security