[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140806183200.GQ14872@ubuntumail>
Date: Wed, 6 Aug 2014 18:32:00 +0000
From: Serge Hallyn <serge.hallyn@...ntu.com>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: "Serge E. Hallyn" <serge@...lyn.com>,
linux-fsdevel@...r.kernel.org, linux-api@...r.kernel.org,
Linux Containers <containers@...ts.linux-foundation.org>,
"Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>,
linux-kernel@...r.kernel.org
Subject: Re: [REVIEW][PATCH 2/4] proc: Implement /proc/thread-self to point
at the directory of the current thread
Quoting Eric W. Biederman (ebiederm@...ssion.com):
> > Hi Eric,
> >
> > I've not had a chance to test these, but apart from two trivial
> > comments below these look good to me, and I appreciate the feature.
> > So with the two fixes (if needed),
> >
> > Acked-by: Serge Hallyn <serge.hallyn@...onical.com>
>
> >> +static int proc_thread_self_readlink(struct dentry *dentry, char __user *buffer,
> >> + int buflen)
> >> +{
> >> + struct pid_namespace *ns = dentry->d_sb->s_fs_info;
> >> + pid_t tgid = task_tgid_nr_ns(current, ns);
> >> + pid_t pid = task_pid_nr_ns(current, ns);
> >> + char tmp[PROC_NUMBUF + 6 + PROC_NUMBUF];
> >
> > In the extreme case you're not adding space for a \0 ? (Unless
> > PROC_NUMBUF includes that)
>
> PROC_NUMBUF has enough space for a sign for the maximum of 10 digits
> for a newline and a terminating \0. So yes PROC_NUMBUF includes the
> space for a terminating \0.
Ah, I see it's 13. Sounds good then, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists