Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1214255

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

From Sean Fu <fxinrong@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.
Date 2015-08-27 02:20 +0200
Message-ID <q1T57-4IF-1@gated-at.bofh.it> (permalink)
References (6 earlier) <q1pA6-3OE-23@gated-at.bofh.it> <q1qmt-4Ya-9@gated-at.bofh.it> <q1rLA-77n-33@gated-at.bofh.it> <q1L7A-1AG-27@gated-at.bofh.it> <q1PEe-89i-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Aug 27, 2015 at 4:36 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
> On Wed, 26 Aug 2015 23:48:01 +0800
> Sean Fu <fxinrong@gmail.com> wrote:
>
>
>> > Defending the patch, I can't imagine any user space code expecting the
>> > current behavior. The current behavior is that if you write "1\0" it
>> > will error out instead of accepting the "1". I can't come up with a
>> > scenario that would require userspace to expect "1\0" to fail. Can you?
>> Thanks
>
> Although, with the current patch, would "1\02" fail? It should.
Yes, "1\02" is equal to "1\2"(count=2) or "1\2\0"(count=3), So it should fail.

code
len = write(fd, "1\0\2", 3);

strace execute result:
write(3, "1\2\0", 3)                    = -1 EINVAL (Invalid argument)

>
> -- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] kernel/sysctl.c: If "count" including the terminating byte  '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-08-24 11:00 +0200
  Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. "Eric W. Biederman" <ebiederm@xmission.com> - 2015-08-24 14:30 +0200
    Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-08-24 17:40 +0200
      Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Andrew Morton <akpm@linux-foundation.org> - 2015-08-24 22:50 +0200
        Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Heinrich Schuchardt <xypron.glpk@gmx.de> - 2015-08-24 23:30 +0200
  Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Steven Rostedt <rostedt@goodmis.org> - 2015-08-24 19:00 +0200
    Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-08-25 03:00 +0200
      Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. "Eric W. Biederman" <ebiederm@xmission.com> - 2015-08-25 04:30 +0200
        Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-08-25 10:10 +0200
          Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Steven Rostedt <rostedt@goodmis.org> - 2015-08-25 16:20 +0200
            Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-08-25 18:50 +0200
              Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Austin S Hemmelgarn <ahferroin7@gmail.com> - 2015-08-25 19:40 +0200
                Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Steven Rostedt <rostedt@goodmis.org> - 2015-08-25 21:10 +0200
                Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-08-26 17:50 +0200
                Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Steven Rostedt <rostedt@goodmis.org> - 2015-08-26 22:40 +0200
                Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-08-27 02:20 +0200
                Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Steven Rostedt <rostedt@goodmis.org> - 2015-08-27 04:40 +0200
                Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-08-27 10:40 +0200
                Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-08-28 05:40 +0200
      Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-08-25 05:20 +0200
  Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Heinrich Schuchardt <xypron.glpk@gmx.de> - 2015-08-25 22:50 +0200
    Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-08-26 11:40 +0200
    Re: [PATCH] kernel/sysctl.c: If "count" including the terminating  byte '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-08-27 02:40 +0200

csiph-web