<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nginx.git/src/os, branch release-1.10.3</title>
<subtitle>nginx</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/'/>
<entry>
<title>Fixed trailer construction with limit on FreeBSD and macOS.</title>
<updated>2017-01-20T18:12:48+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2017-01-20T18:12:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=4e4083fc683f66874006c0fb4ea70b3194e4fb6a'/>
<id>4e4083fc683f66874006c0fb4ea70b3194e4fb6a</id>
<content type='text'>
The ngx_chain_coalesce_file() function may produce more bytes to send then
requested in the limit passed, as it aligns the last file position
to send to memory page boundary.  As a result, (limit - send) may become
negative.  This resulted in big positive number when converted to size_t
while calling ngx_output_chain_to_iovec().

Another part of the problem is in ngx_chain_coalesce_file(): it changes cl
to the next chain link even if the current buffer is only partially sent
due to limit.

Therefore, if a file buffer was not expected to be fully sent due to limit,
and was followed by a memory buffer, nginx called sendfile() with a part
of the file buffer, and the memory buffer in trailer.  If there were enough
room in the socket buffer, this resulted in a part of the file buffer being
skipped, and corresponding part of the memory buffer sent instead.

The bug was introduced in 8e903522c17a (1.7.8).  Configurations affected
are ones using limits, that is, limit_rate and/or sendfile_max_chunk, and
memory buffers after file ones (may happen when using subrequests or
with proxying with disk buffering).

Fix is to explicitly check if (send &lt; limit) before constructing trailer
with ngx_output_chain_to_iovec().  Additionally, ngx_chain_coalesce_file()
was modified to preserve unfinished file buffers in cl.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ngx_chain_coalesce_file() function may produce more bytes to send then
requested in the limit passed, as it aligns the last file position
to send to memory page boundary.  As a result, (limit - send) may become
negative.  This resulted in big positive number when converted to size_t
while calling ngx_output_chain_to_iovec().

Another part of the problem is in ngx_chain_coalesce_file(): it changes cl
to the next chain link even if the current buffer is only partially sent
due to limit.

Therefore, if a file buffer was not expected to be fully sent due to limit,
and was followed by a memory buffer, nginx called sendfile() with a part
of the file buffer, and the memory buffer in trailer.  If there were enough
room in the socket buffer, this resulted in a part of the file buffer being
skipped, and corresponding part of the memory buffer sent instead.

The bug was introduced in 8e903522c17a (1.7.8).  Configurations affected
are ones using limits, that is, limit_rate and/or sendfile_max_chunk, and
memory buffers after file ones (may happen when using subrequests or
with proxying with disk buffering).

Fix is to explicitly check if (send &lt; limit) before constructing trailer
with ngx_output_chain_to_iovec().  Additionally, ngx_chain_coalesce_file()
was modified to preserve unfinished file buffers in cl.
</pre>
</div>
</content>
</entry>
<entry>
<title>Core: skip special buffers on writing (ticket #981).</title>
<updated>2016-05-31T02:13:30+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2016-05-31T02:13:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=969105accdcc3df885082a90012eb5cc8f31d5b7'/>
<id>969105accdcc3df885082a90012eb5cc8f31d5b7</id>
<content type='text'>
A special last buffer with cl-&gt;buf-&gt;pos set to NULL can be present in
a chain when writing request body if chunked encoding was used.  This
resulted in a NULL pointer dereference if it happened to be the only
buffer left after a do...while loop iteration in ngx_write_chain_to_file().

The problem originally appeared in nginx 1.3.9 with chunked encoding
support.  Additionally, rev. 3832b608dc8d (nginx 1.9.13) changed the
minimum number of buffers to trigger this from IOV_MAX (typically 1024)
to NGX_IOVS_PREALLOCATE (typically 64).

Fix is to skip such buffers in ngx_chain_to_iovec(), much like it is
done in other places.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A special last buffer with cl-&gt;buf-&gt;pos set to NULL can be present in
a chain when writing request body if chunked encoding was used.  This
resulted in a NULL pointer dereference if it happened to be the only
buffer left after a do...while loop iteration in ngx_write_chain_to_file().

The problem originally appeared in nginx 1.3.9 with chunked encoding
support.  Additionally, rev. 3832b608dc8d (nginx 1.9.13) changed the
minimum number of buffers to trigger this from IOV_MAX (typically 1024)
to NGX_IOVS_PREALLOCATE (typically 64).

Fix is to skip such buffers in ngx_chain_to_iovec(), much like it is
done in other places.
</pre>
</div>
</content>
</entry>
<entry>
<title>Removed redundant "u" format specifier.</title>
<updated>2016-04-08T12:03:38+00:00</updated>
<author>
<name>Ruslan Ermilov</name>
<email>ru@nginx.com</email>
</author>
<published>2016-04-08T12:03:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=37a3a2b2e8ef3202045e4095d894f806ed5e7654'/>
<id>37a3a2b2e8ef3202045e4095d894f806ed5e7654</id>
<content type='text'>
It is implied for "x" and "X".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is implied for "x" and "X".
</pre>
</div>
</content>
</entry>
<entry>
<title>Simplified ngx_unix_recv() and ngx_readv_chain().</title>
<updated>2016-04-08T13:49:35+00:00</updated>
<author>
<name>Ruslan Ermilov</name>
<email>ru@nginx.com</email>
</author>
<published>2016-04-08T13:49:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=4d1f67fd910a183ded8b4399f81c20c2a67ac83e'/>
<id>4d1f67fd910a183ded8b4399f81c20c2a67ac83e</id>
<content type='text'>
This makes ngx_unix_recv() and ngx_udp_unix_recv() differ minimally.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes ngx_unix_recv() and ngx_udp_unix_recv() differ minimally.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merged implementations of ngx_unix_recv().</title>
<updated>2016-04-08T13:41:45+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2016-04-08T13:41:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=dbabc66b680dfc0b2cc77dd086972f9927c23fdf'/>
<id>dbabc66b680dfc0b2cc77dd086972f9927c23fdf</id>
<content type='text'>
There's no real need in two separate implementations,
with and without kqueue support.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's no real need in two separate implementations,
with and without kqueue support.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixed small inconsistency in handling EOF among receive functions.</title>
<updated>2016-04-08T13:39:49+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2016-04-08T13:39:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=900ef17c4775d635f711a568c2e2707dbdfdcfc9'/>
<id>900ef17c4775d635f711a568c2e2707dbdfdcfc9</id>
<content type='text'>
Now all functions always drop the ready flag in this case.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now all functions always drop the ready flag in this case.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merged implementations of ngx_udp_unix_recv().</title>
<updated>2016-04-08T13:38:42+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2016-04-08T13:38:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=8e7d8757c656b9d8f0af7953716929c97657474f'/>
<id>8e7d8757c656b9d8f0af7953716929c97657474f</id>
<content type='text'>
There's no real need in two separate implementations,
with and without kqueue support.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's no real need in two separate implementations,
with and without kqueue support.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixed spelling.</title>
<updated>2016-04-07T08:50:13+00:00</updated>
<author>
<name>Josh Soref</name>
<email>timeless@gmail.com</email>
</author>
<published>2016-04-07T08:50:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=73d27510c0d7022384a611269af22ff01634c6d0'/>
<id>73d27510c0d7022384a611269af22ff01634c6d0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixed ngx_os_signal_process() prototype.</title>
<updated>2016-03-31T19:00:33+00:00</updated>
<author>
<name>Ruslan Ermilov</name>
<email>ru@nginx.com</email>
</author>
<published>2016-03-31T19:00:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=5ad6e01b464efe0eb140294fa15d71da38738ed3'/>
<id>5ad6e01b464efe0eb140294fa15d71da38738ed3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixed ngx_pid_t formatting in ngx_sprintf() and logging.</title>
<updated>2016-03-30T23:34:04+00:00</updated>
<author>
<name>Sergey Kandaurov</name>
<email>pluknet@nginx.com</email>
</author>
<published>2016-03-30T23:34:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=60a6551e1f28337f7b358719fe46d4c91409dbf3'/>
<id>60a6551e1f28337f7b358719fe46d4c91409dbf3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
