[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181024123740.GA32577@ZenIV.linux.org.uk>
Date: Wed, 24 Oct 2018 13:37:40 +0100
From: Al Viro <viro@...IV.linux.org.uk>
To: Phillip Potter <phil@...lpotter.co.uk>
Cc: linux-kernel@...r.kernel.org, amir73il@...il.com,
linux-fsdevel@...r.kernel.org
Subject: Re: [RFC][PATCH v3 01/10] fs: common implementation of file type
On Tue, Oct 23, 2018 at 09:19:53PM +0100, Phillip Potter wrote:
> +static inline unsigned char fs_dtype(int filetype)
That "int" is asking for trouble, especially since negative
argument will blow up. And it comes from untrusted source...
> +{
> + if (filetype >= FT_MAX)
> + return DT_UNKNOWN;
> +
> + return fs_dtype_by_ftype[filetype];
> +}
Powered by blists - more mailing lists