From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: Logan Gunthorpe <logang@deltatee.com>
Cc: linux-raid@vger.kernel.org, Jes Sorensen <jsorensen@fb.com>,
Song Liu <song@kernel.org>, Christoph Hellwig <hch@infradead.org>,
Donald Buczek <buczek@molgen.mpg.de>,
Guoqing Jiang <guoqing.jiang@linux.dev>, Xiao Ni <xni@redhat.com>,
Himanshu Madhani <himanshu.madhani@oracle.com>,
Coly Li <colyli@suse.de>, Bruce Dubbs <bruce.dubbs@gmail.com>,
Stephen Bates <sbates@raithlin.com>,
Martin Oliveira <Martin.Oliveira@eideticom.com>,
David Sloan <David.Sloan@eideticom.com>,
Alex Wu <alexwu@synology.com>,
BingJing Chang <bingjingc@synology.com>,
Danny Shih <dannyshih@synology.com>,
ChangSyun Peng <allenpeng@synology.com>
Subject: Re: [PATCH mdadm v1 04/14] mdadm/Grow: Fix use after close bug by closing after fork
Date: Mon, 20 Jun 2022 16:27:57 +0200 [thread overview]
Message-ID: <20220620162757.00007d17@linux.intel.com> (raw)
In-Reply-To: <20220609211130.5108-5-logang@deltatee.com>
On Thu, 9 Jun 2022 15:11:20 -0600
Logan Gunthorpe <logang@deltatee.com> wrote:
> ---
> Grow.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/Grow.c b/Grow.c
> index 8a242b0f8725..ba5dc1aead64 100644
> --- a/Grow.c
> +++ b/Grow.c
> @@ -3506,7 +3506,6 @@ started:
> return 0;
> }
>
> - close(fd);
> /* Now we just need to kick off the reshape and watch, while
> * handling backups of the data...
> * This is all done by a forked background process.
> @@ -3527,6 +3526,9 @@ started:
> break;
> }
>
> + /* Close unused file descriptor in the forked process */
> + close(fd);
> +
> /* If another array on the same devices is busy, the
> * reshape will wait for them. This would mean that
> * the first section that we suspend will stay suspended
Please use close_fd() helper to invalidate fd too.
next prev parent reply other threads:[~2022-06-20 15:01 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-09 21:11 [PATCH mdadm v1 00/14] Bug fixes and testing improvments Logan Gunthorpe
2022-06-09 21:11 ` [PATCH mdadm v1 01/14] Makefile: Don't build static build with everything Logan Gunthorpe
2022-06-20 14:08 ` Mariusz Tkaczyk
2022-06-22 16:39 ` Logan Gunthorpe
2022-06-09 21:11 ` [PATCH mdadm v1 02/14] DDF: Cleanup validate_geometry_ddf_container() Logan Gunthorpe
2022-06-20 14:14 ` Mariusz Tkaczyk
2022-06-09 21:11 ` [PATCH mdadm v1 03/14] DDF: Fix NULL pointer dereference in validate_geometry_ddf() Logan Gunthorpe
2022-06-20 14:13 ` Mariusz Tkaczyk
2022-06-09 21:11 ` [PATCH mdadm v1 04/14] mdadm/Grow: Fix use after close bug by closing after fork Logan Gunthorpe
2022-06-20 14:27 ` Mariusz Tkaczyk [this message]
2022-06-09 21:11 ` [PATCH mdadm v1 05/14] monitor: Avoid segfault when calling NULL get_bad_blocks Logan Gunthorpe
2022-06-20 14:29 ` Mariusz Tkaczyk
2022-06-09 21:11 ` [PATCH mdadm v1 06/14] mdadm: Fix mdadm -r remove option regresision Logan Gunthorpe
2022-06-20 14:35 ` Mariusz Tkaczyk
2022-06-20 15:26 ` Paul Menzel
2022-06-09 21:11 ` [PATCH mdadm v1 07/14] mdadm: Fix optional --write-behind parameter Logan Gunthorpe
2022-06-20 14:37 ` Mariusz Tkaczyk
2022-06-09 21:11 ` [PATCH mdadm v1 08/14] tests/00raid0: add a test that validates raid0 with layout fails for 0.9 Logan Gunthorpe
2022-06-09 21:11 ` [PATCH mdadm v1 09/14] tests: fix raid0 tests for 0.90 metadata Logan Gunthorpe
2022-06-09 21:11 ` [PATCH mdadm v1 10/14] tests/04update-metadata: avoid passing chunk size to raid1 Logan Gunthorpe
2022-06-09 21:11 ` [PATCH mdadm v1 11/14] tests/02lineargrow: clear the superblock at every iteration Logan Gunthorpe
2022-06-09 21:11 ` [PATCH mdadm v1 12/14] mdadm/test: Add a mode to repeat specified tests Logan Gunthorpe
2022-06-09 21:11 ` [PATCH mdadm v1 13/14] mdadm/test: Mark and ignore broken test failures Logan Gunthorpe
2022-06-09 21:11 ` [PATCH mdadm v1 14/14] tests: Add broken files for all broken tests Logan Gunthorpe
2022-06-10 9:49 ` Guoqing Jiang
2022-06-10 15:17 ` Logan Gunthorpe
2022-06-10 16:16 ` Donald Buczek
2022-06-10 10:14 ` [PATCH mdadm v1 00/14] Bug fixes and testing improvments Paul Menzel
2022-06-10 15:27 ` Logan Gunthorpe
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=20220620162757.00007d17@linux.intel.com \
--to=mariusz.tkaczyk@linux.intel.com \
--cc=David.Sloan@eideticom.com \
--cc=Martin.Oliveira@eideticom.com \
--cc=alexwu@synology.com \
--cc=allenpeng@synology.com \
--cc=bingjingc@synology.com \
--cc=bruce.dubbs@gmail.com \
--cc=buczek@molgen.mpg.de \
--cc=colyli@suse.de \
--cc=dannyshih@synology.com \
--cc=guoqing.jiang@linux.dev \
--cc=hch@infradead.org \
--cc=himanshu.madhani@oracle.com \
--cc=jsorensen@fb.com \
--cc=linux-raid@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=sbates@raithlin.com \
--cc=song@kernel.org \
--cc=xni@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).