mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Geyslan G. Bem" <geyslan@gmail.com>
Cc: ericvh@gmail.com, rminnich@sandia.gov, lucho@ionkov.net,
	v9fs-developer@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, kernel-br@googlegroups.com
Subject: Re: [PATCH] 9p: unsigned/signed wrap in p9/unix modes.
Date: Mon, 07 Oct 2013 15:33:24 -0700	[thread overview]
Message-ID: <1381185204.2081.221.camel@joe-AO722> (raw)
In-Reply-To: <1381184340-11190-1-git-send-email-geyslan@gmail.com>

On Mon, 2013-10-07 at 19:19 -0300, Geyslan G. Bem wrote:
> Changes the sign type to unsigned, avoiding the possibility of
> wrap when ORing the p9 or unix bit modes.
[]
> diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
[]
> @@ -144,7 +144,7 @@ static umode_t p9mode2unixmode(struct v9fs_session_info *v9ses,
>  	else if ((mode & P9_DMDEVICE) && (v9fs_proto_dotu(v9ses))
>  		 && (v9ses->nodev == 0)) {
>  		char type = 0, ext[32];
> -		int major = -1, minor = -1;
> +		u32 major = 0, minor = 0;
>  
>  		strlcpy(ext, stat->extension, sizeof(ext));
>  		sscanf(ext, "%c %u %u", &type, &major, &minor);

This bit changes the MKDEV below it.

I would think that the sscanf return should be
checked for 3 and maybe MKDEV should not be
constructed when it's not.



  reply	other threads:[~2013-10-07 22:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-07 22:19 Geyslan G. Bem
2013-10-07 22:33 ` Joe Perches [this message]
2013-10-08  0:09   ` Geyslan Gregório Bem
2013-10-08  0:12     ` Joe Perches
2013-10-08  0:18       ` Geyslan Gregório Bem
     [not found]         ` <CAFkjPTmFOkw5n964zGuiON1oLSy1CsPQQ8TrGNho6L-+M5Z7SA@mail.gmail.com>
2013-10-21 11:03           ` Geyslan Gregório Bem
2013-10-21 21:13             ` Geyslan Gregório Bem
2013-10-22 10:35               ` Geyslan Gregório Bem
     [not found]                 ` <CAFkjPTm_JhrWVzk0njqaUwpn5RxqYgRWYV2ZvPyrYoFKZHkgog@mail.gmail.com>
     [not found]                   ` <CAGG-pURzs512=6zu2_vBz5vtJu3Dm8hsdV=qZuUa5GJng6Eceg@mail.gmail.com>
2013-10-29  1:48                     ` Geyslan Gregório Bem
2013-10-29 20:59                       ` Geyslan Gregório Bem

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=1381185204.2081.221.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=ericvh@gmail.com \
    --cc=geyslan@gmail.com \
    --cc=kernel-br@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucho@ionkov.net \
    --cc=rminnich@sandia.gov \
    --cc=v9fs-developer@lists.sourceforge.net \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®