linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Phillip Potter <phil@philpotter.co.uk>
Cc: linux-kernel@vger.kernel.org, amir73il@gmail.com,
	linux-fsdevel@vger.kernel.org
Subject: Re: [RFC][PATCH v3 01/10] fs: common implementation of file type
Date: Wed, 24 Oct 2018 13:37:40 +0100	[thread overview]
Message-ID: <20181024123740.GA32577@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20181023201953.GA15687@pathfinder>

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];
> +}

  parent reply	other threads:[~2018-10-24 12:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23 20:19 Phillip Potter
2018-10-24  6:16 ` Amir Goldstein
2018-10-24  8:21   ` Phillip Potter
2018-10-24  9:20     ` Amir Goldstein
2018-10-24  9:31       ` Phillip Potter
2018-10-24  9:44         ` Amir Goldstein
2018-10-24  9:56           ` Phillip Potter
2018-10-24 10:06             ` Amir Goldstein
2018-10-24 12:37 ` Al Viro [this message]
2018-10-24 13:02 ` Theodore Y. Ts'o
2018-10-24 14:41   ` Amir Goldstein
2018-10-25 11:20 ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181024123740.GA32577@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=amir73il@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phil@philpotter.co.uk \
    --subject='Re: [RFC][PATCH v3 01/10] fs: common implementation of file type' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).