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

Linus Torvalds torvalds at linux-foundation.org
Mon Jun 15 16:46:12 UTC 2020


On Mon, Jun 15, 2020 at 5:13 AM Christoph Hellwig <hch at lst.de> 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



More information about the Linux-security-module-archive mailing list