[nginx] Restored zeroing of ngx_channel_t in ngx_pass_open_channel().

Frank Liu gfrankliu at gmail.com
Thu Apr 22 19:41:57 UTC 2021


How does this impact 1.20.0? Shall we wait for 1.20.1?

On Thu, Apr 22, 2021 at 6:19 AM Ruslan Ermilov <ru at nginx.com> wrote:

> details:   https://hg.nginx.org/nginx/rev/f2ff291bbdac
> branches:
> changeset: 7830:f2ff291bbdac
> user:      Ruslan Ermilov <ru at nginx.com>
> date:      Thu Apr 22 16:12:52 2021 +0300
> description:
> Restored zeroing of ngx_channel_t in ngx_pass_open_channel().
>
> Due to structure's alignment, some uninitialized memory contents may have
> been passed between processes.
>
> Zeroing was removed in 0215ec9aaa8a.
>
> Reported by Johnny Wang.
>
> diffstat:
>
>  src/os/unix/ngx_process_cycle.c |  2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diffs (12 lines):
>
> diff -r 2851e4c7de03 -r f2ff291bbdac src/os/unix/ngx_process_cycle.c
> --- a/src/os/unix/ngx_process_cycle.c   Wed Apr 21 23:24:59 2021 +0300
> +++ b/src/os/unix/ngx_process_cycle.c   Thu Apr 22 16:12:52 2021 +0300
> @@ -398,6 +398,8 @@ ngx_pass_open_channel(ngx_cycle_t *cycle
>      ngx_int_t      i;
>      ngx_channel_t  ch;
>
> +    ngx_memzero(&ch, sizeof(ngx_channel_t));
> +
>      ch.command = NGX_CMD_OPEN_CHANNEL;
>      ch.pid = ngx_processes[ngx_process_slot].pid;
>      ch.slot = ngx_process_slot;
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20210422/337eed82/attachment.htm>


More information about the nginx-devel mailing list