Re: [PATCH 10/13] integrity/ima: switch to using __kernel_read

From: Linus Torvalds
Date: Mon Jun 15 2020 - 12:46:36 EST


On Mon, Jun 15, 2020 at 5:13 AM Christoph Hellwig <hch@xxxxxx> wrote:
>
> __kernel_read has a bunch of additional sanity checks, and this moves
> the set_fs out of non-core code.

Wel, you also seem to be removing this part:

> - if (!(file->f_mode & FMODE_READ))
> - return -EBADF;

which you didn't add in the previous patch that implemented __kernel_read().

It worries me that you're making these kinds of transformations where
the comments imply it's a no-op, but the actual code doesn't agree.

Especially when it's part of one large patch series and each commit
looks trivial.

This kind of series needs more care. Maybe that test isn't necessary,
but it isn't obvious, and I really don't like how you completely
glossed over totally changing what the code did.

Linus