public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: Andrew Morton <akpm@linux-foundation.org>, Sean Fu <fxinrong@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Ulrich Obergfell <uobergfe@redhat.com>,
	"Steven Rostedt (Red Hat)" <rostedt@goodmis.org>,
	Prarit Bhargava <prarit@redhat.com>,
	Eric B Munson <emunson@akamai.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Don Zickus <dzickus@redhat.com>,
	David Rientjes <rientjes@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.
Date: Mon, 24 Aug 2015 23:24:37 +0200	[thread overview]
Message-ID: <55DB8B95.7050005@gmx.de> (raw)
In-Reply-To: <20150824134408.be0ffaa654f7d26802119b81@linux-foundation.org>

This seems to be the relevant patch:

https://lkml.org/lkml/2010/5/5/104
Amerigo Wang <amwang@redhat.com>  2010-05-05 02:26:45
00b7c3395aec3df43de5bd02a3c5a099ca51169f
+static const char proc_wspace_sep[] = { ' ', '\t', '\n' };

So since 2010 we have the current behavior.

Best regards

Heinrich Schuchardt

On 24.08.2015 22:44, Andrew Morton wrote:
> On Mon, 24 Aug 2015 23:33:58 +0800 Sean Fu <fxinrong@gmail.com> wrote:
> 
>> On Mon, Aug 24, 2015 at 8:27 PM, Eric W. Biederman
>> <ebiederm@xmission.com> wrote:
>>>
>>>
>>> On August 24, 2015 1:56:13 AM PDT, Sean Fu <fxinrong@gmail.com> wrote:
>>>> when the input argument "count" including the terminating byte "\0",
>>>> The write system call return EINVAL on proc file.
>>>> But it return success on regular file.
>>>
>>> Nonsense.  It will write the '\0' to a regular file because it is just data.
>>>
>>> Integers in proc are more than data.
>>>
>>> So I see no justification for this change.
>> In fact, "write(fd, "1\0", 2)" on Integers proc file return success on
>> 2.6 kernel. I already tested it on 2.6.6.60 kernel.
>>
>> So, The latest behavior of "write(fd, "1\0", 2)" is different from old
>> kernel(2.6).
>> This maybe impact the compatibility of some user space program.
> 
> 2.6 was a long time ago.  If this behaviour change has happened in the
> last 1-2 kernel releases then there would be a case to consider making
> changes.  But if the kernel has been this way for two years then it's
> too late to bother switching back to the old (and strange) behaviour.
> 
> 

  reply	other threads:[~2015-08-24 21:25 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24  8:56 [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success Sean Fu
2015-08-24 12:27 ` Eric W. Biederman
2015-08-24 15:33   ` Sean Fu
2015-08-24 20:44     ` Andrew Morton
2015-08-24 21:24       ` Heinrich Schuchardt [this message]
2015-08-24 16:59 ` Steven Rostedt
2015-08-25  0:57   ` Sean Fu
2015-08-25  2:24     ` Eric W. Biederman
2015-08-25  7:50       ` Sean Fu
2015-08-25 14:15         ` Steven Rostedt
2015-08-25 16:44           ` Sean Fu
2015-08-25 17:33             ` Austin S Hemmelgarn
2015-08-25 19:05               ` Steven Rostedt
2015-08-26 15:48                 ` Sean Fu
2015-08-26 20:36                   ` Steven Rostedt
2015-08-27  0:17                     ` Sean Fu
2015-08-27  2:32                       ` Steven Rostedt
2015-08-27  8:32                         ` Sean Fu
2015-08-28  3:31                           ` Sean Fu
2015-09-08  3:11                             ` Sean Fu
2015-09-08 15:17                               ` Steven Rostedt
2015-09-08 16:19                                 ` Eric W. Biederman
2015-09-08 16:36                                   ` Steven Rostedt
2015-09-11  9:05                                     ` Sean Fu
2015-09-11 13:49                                       ` Steven Rostedt
2015-09-11 17:01                                       ` Eric W. Biederman
2015-09-13 12:39                                         ` Sean Fu
2015-09-13 16:44                                           ` Eric W. Biederman
2015-09-15  9:30                                             ` Sean Fu
2015-09-15 14:11                                               ` Eric W. Biederman
2015-09-13 20:05                                           ` Steven Rostedt
2015-09-15  9:10                                             ` Sean Fu
2015-09-15 13:51                                               ` Steven Rostedt
2015-08-25  3:12     ` Sean Fu
2015-08-25 20:39 ` Heinrich Schuchardt
2015-08-26  9:30   ` Sean Fu
2015-08-27  0:32   ` Sean Fu

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=55DB8B95.7050005@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=akpm@linux-foundation.org \
    --cc=dzickus@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=emunson@akamai.com \
    --cc=fxinrong@gmail.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=prarit@redhat.com \
    --cc=rientjes@google.com \
    --cc=rostedt@goodmis.org \
    --cc=ryabinin.a.a@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=uobergfe@redhat.com \
    /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