The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sysctl: Check length at deprecated_sysctl_warning.
Date: Mon, 12 Nov 2007 02:44:36 -0700	[thread overview]
Message-ID: <m14pfr6bnf.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <200711080819.lA88J8Pv072259@www262.sakura.ne.jp> (Tetsuo Handa's message of "Thu, 08 Nov 2007 17:19:08 +0900")

Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> writes:

> Hello.
>
> Thanks for reformatting my patch
> and sorry for surprising you with directory name
> (I meant to type linux-2.6.24-rc2, not linux-2.6.22-rc2).
>
> According to linux-2.6.23,
> it seems that I should return -ENOTDIR
> for invalid args->nlen value.
>
> I got a question here regarding interpretation of CTL_MAXNAME .
> Is args->nlen == CTL_MAXNAME valid?
> It is treated as invalid while the definition says
>
>   /* how many path components do we allow in a
>      call to sysctl?   In other words, what is
>      the largest acceptable value for the nlen
>      member of a struct __sysctl_args to have? */
>
> If "name[CTL_MAXNAME];" is what the author intended,
> I think args->nlen == CTL_MAXNAME is valid.

name[CTL_MAXNAME} is not valid.
name[0...CTL_MAXNAME-1] is valid.


The check that got lost in the refactoring was specfically:

-       if (tmp.nlen <= 0 || tmp.nlen >= CTL_MAXNAME)
-               return -ENOTDIR;

Eric


  reply	other threads:[~2007-11-12  9:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-08  2:57 [PATCH] sysctl: Check length at deprecated_sysctl_warning Tetsuo Handa
2007-11-08  3:22 ` Andrew Morton
2007-11-08  8:19   ` Tetsuo Handa
2007-11-12  9:44     ` Eric W. Biederman [this message]
2007-11-12 11:42       ` Tetsuo Handa
2007-11-13  3:07       ` Tetsuo Handa
2007-11-13  3:13         ` Andrew Morton
2007-11-13  3:50           ` Tetsuo Handa
2007-11-13 13:24             ` Eric W. Biederman

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=m14pfr6bnf.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    /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