All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <krisman@suse.de>
To: axboe@kernel.dk
Cc: io-uring@vger.kernel.org
Subject: Re: [PATCH liburing 1/2] test/send_recvmsg: Preserve msghdr until op_recvmsg completes
Date: Wed, 22 Jul 2026 14:24:55 -0400	[thread overview]
Message-ID: <87ik66evbc.fsf@mailhost.krisman.be> (raw)
In-Reply-To: <20260722181710.79099-2-krisman@suse.de>

Gabriel Krisman Bertazi <krisman@suse.de> writes:

> msghdr is allocated on the stack at recv_prep, which means it may go out
> of scope before the kernel has a chance to complete the operation.  This
> results in spurious test failures when we reach far enough into recv_fn
> to reuse the stack space before op_recvmsg executes.  I found it easily
> reproducible when compiling with '-O0 -g3' to avoid gcc from optimizing
> further local variables out of the stack.

In hindsight, I should clarify that by 'test failure' I mean a
segmentation fault in the testcase, not a T_EXIT_FAIL. Should have put
that in the commit message.

-- 
Gabriel Krisman Bertazi

  reply	other threads:[~2026-07-22 18:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 18:17 [PATCH liburing 0/2] Fix op_recv stack corruption Gabriel Krisman Bertazi
2026-07-22 18:17 ` [PATCH liburing 1/2] test/send_recvmsg: Preserve msghdr until op_recvmsg completes Gabriel Krisman Bertazi
2026-07-22 18:24   ` Gabriel Krisman Bertazi [this message]
2026-07-22 19:21   ` Jens Axboe
2026-07-22 20:00     ` Gabriel Krisman Bertazi
2026-07-22 20:33       ` Gabriel Krisman Bertazi
2026-07-22 18:17 ` [PATCH liburing 2/2] test/recv-msgall-stream: " Gabriel Krisman Bertazi

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=87ik66evbc.fsf@mailhost.krisman.be \
    --to=krisman@suse.de \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.