[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y5UbhBTB2nSMN4UD@ZenIV>
Date: Sat, 10 Dec 2022 23:51:32 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Nhat Pham <nphamcs@...il.com>
Cc: akpm@...ux-foundation.org, hannes@...xchg.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, bfoster@...hat.com,
willy@...radead.org, kernel-team@...a.com
Subject: Re: [PATCH v2 3/4] cachestat: implement cachestat syscall
On Mon, Dec 05, 2022 at 09:51:39AM -0800, Nhat Pham wrote:
> + if (!access_ok(cstat, sizeof(struct cachestat)))
> + return -EFAULT;
What for? You are using copy_to_user() later, right?
> + f = fdget(fd);
> + if (f.file) {
It would be easier to read if you inverted the condition here.
Powered by blists - more mailing lists