From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Thu, 4 Apr 2013 15:50:54 -0400 To: 9fans@9fans.net Message-ID: <1d60ad5fac2f22abe5687a2325ab9c63@ladd.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] IOHDRSZ Topicbox-Message-UUID: 3e7dae96-ead8-11e9-9d60-3106f5b1d025 i wonder if the typical use of IOHDRSZ is correct. many programs set msize = bufsize + IOHDRSIZE but Twrite has 2+4+8+4=18 bytes overhead, so i think this assumption is going to lead to 6-byte buffer overruns. - erik From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <1d60ad5fac2f22abe5687a2325ab9c63@ladd.quanstro.net> References: <1d60ad5fac2f22abe5687a2325ab9c63@ladd.quanstro.net> Date: Thu, 4 Apr 2013 21:14:08 +0100 Message-ID: From: Charles Forsyth To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=089e010d8574f7adb104d98e9c84 Subject: Re: [9fans] IOHDRSZ Topicbox-Message-UUID: 3e8d58b4-ead8-11e9-9d60-3106f5b1d025 --089e010d8574f7adb104d98e9c84 Content-Type: text/plain; charset=UTF-8 On 4 April 2013 20:50, erik quanstrom wrote: > so > i think this assumption is going to lead to > 6-byte buffer overruns. > I don't follow the reasoning. bufsize + Rread or Twrite will always fit. bufsize is the limit for application data. The receiving 9P also trims the count to match the receiving buffer. --089e010d8574f7adb104d98e9c84 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On 4 April 2013 20:50, erik quanstrom <quanstro@quanstro.net> wrote:
so
i think this assumption is going to lead to
6-byte buffer overruns.
=
I don't follow the reasoning. bufsize + Rread or Twrite will = always fit.
bufsize is the limit for = application data. The receiving 9P also trims the count
to match the receiving buffer.

--089e010d8574f7adb104d98e9c84-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Thu, 4 Apr 2013 16:49:08 -0400 To: 9fans@9fans.net Message-ID: <0b2786f721d464915432e88eed91c18f@ladd.quanstro.net> In-Reply-To: References: <1d60ad5fac2f22abe5687a2325ab9c63@ladd.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] IOHDRSZ Topicbox-Message-UUID: 3e986312-ead8-11e9-9d60-3106f5b1d025 > On 4 April 2013 20:50, erik quanstrom wrote: > > > so > > i think this assumption is going to lead to > > 6-byte buffer overruns. > > > > I don't follow the reasoning. bufsize + Rread or Twrite will always fit. > bufsize is the limit for application data. The receiving 9P also trims the > count > to match the receiving buffer. i'm thinking of applications that have a seperate buffer for data. in this case, i can't think of a clean way of sizing that seperate buffer correctly. if msize=bufsize+IOHDRSZ, then incoming bytes would be too big. - erik