* [pseudo][PATCH 0/1] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak
@ 2023-03-01 0:03 Yoann Congal
2023-03-01 0:03 ` [pseudo][PATCH 1/1] " Yoann Congal
0 siblings, 1 reply; 7+ messages in thread
From: Yoann Congal @ 2023-03-01 0:03 UTC (permalink / raw)
To: openembedded-core; +Cc: Yoann Congal, Pavel Modilaynen, Mingli Yu
Hi,
The following patch is the work done by Pavel Modilaynen in 04-2019 on
[YOCTO #13311]. Then, Mingli Yu tried to get it merged in 01-2020 without
success.
I just added a ref to [YOCTO #13311] in the commit message.
Best regards,
Yoann
Pavel Modilaynen (1):
pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak
pseudo_util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
2.30.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* [pseudo][PATCH 1/1] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak
2023-03-01 0:03 [pseudo][PATCH 0/1] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak Yoann Congal
@ 2023-03-01 0:03 ` Yoann Congal
2023-03-01 8:52 ` [OE-core] " Alexandre Belloni
2023-03-01 10:18 ` Richard Purdie
0 siblings, 2 replies; 7+ messages in thread
From: Yoann Congal @ 2023-03-01 0:03 UTC (permalink / raw)
To: openembedded-core; +Cc: Pavel Modilaynen, Mingli Yu, Yoann Congal
From: Pavel Modilaynen <pavelmn@axis.com>
Use close-on-exec (O_CLOEXEC) flag when open log file to
make sure its file descriptor is not leaked to parent
process on fork/exec.
Fixes [YOCTO #13311]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
pseudo_util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pseudo_util.c b/pseudo_util.c
index 64636b7..b58036f 100644
--- a/pseudo_util.c
+++ b/pseudo_util.c
@@ -1611,7 +1611,7 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) {
}
free(filename);
}
- fd = open(pseudo_path, O_WRONLY | O_APPEND | O_CREAT, 0644);
+ fd = open(pseudo_path, O_WRONLY | O_APPEND | O_CREAT | O_CLOEXEC, 0644);
if (fd == -1) {
pseudo_diag("help: can't open log file %s: %s\n", pseudo_path, strerror(errno));
} else {
--
2.30.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [OE-core] [pseudo][PATCH 1/1] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak
2023-03-01 0:03 ` [pseudo][PATCH 1/1] " Yoann Congal
@ 2023-03-01 8:52 ` Alexandre Belloni
2023-03-01 9:00 ` Yoann Congal
2023-03-01 10:18 ` Richard Purdie
1 sibling, 1 reply; 7+ messages in thread
From: Alexandre Belloni @ 2023-03-01 8:52 UTC (permalink / raw)
To: Yoann Congal; +Cc: openembedded-core, Pavel Modilaynen, Mingli Yu
On 01/03/2023 01:03:04+0100, Yoann Congal wrote:
> From: Pavel Modilaynen <pavelmn@axis.com>
>
> Use close-on-exec (O_CLOEXEC) flag when open log file to
> make sure its file descriptor is not leaked to parent
> process on fork/exec.
>
> Fixes [YOCTO #13311]
>
This is missing the author's SoB
> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> ---
> pseudo_util.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/pseudo_util.c b/pseudo_util.c
> index 64636b7..b58036f 100644
> --- a/pseudo_util.c
> +++ b/pseudo_util.c
> @@ -1611,7 +1611,7 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) {
> }
> free(filename);
> }
> - fd = open(pseudo_path, O_WRONLY | O_APPEND | O_CREAT, 0644);
> + fd = open(pseudo_path, O_WRONLY | O_APPEND | O_CREAT | O_CLOEXEC, 0644);
> if (fd == -1) {
> pseudo_diag("help: can't open log file %s: %s\n", pseudo_path, strerror(errno));
> } else {
> --
> 2.30.2
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#177861): https://lists.openembedded.org/g/openembedded-core/message/177861
> Mute This Topic: https://lists.openembedded.org/mt/97303652/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [pseudo][PATCH 1/1] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak
2023-03-01 8:52 ` [OE-core] " Alexandre Belloni
@ 2023-03-01 9:00 ` Yoann Congal
2023-03-01 9:04 ` Alexander Kanavin
2023-03-01 10:16 ` Richard Purdie
0 siblings, 2 replies; 7+ messages in thread
From: Yoann Congal @ 2023-03-01 9:00 UTC (permalink / raw)
To: Alexandre Belloni; +Cc: openembedded-core, Mingli Yu
Hi,
On 3/1/23 09:52, Alexandre Belloni wrote:
> On 01/03/2023 01:03:04+0100, Yoann Congal wrote:
>> From: Pavel Modilaynen <pavelmn@axis.com>
>>
>> Use close-on-exec (O_CLOEXEC) flag when open log file to
>> make sure its file descriptor is not leaked to parent
>> process on fork/exec.
>>
>> Fixes [YOCTO #13311]
>>
>
> This is missing the author's SoB
That is right. But, as you would have noticed by now, his mail address is not valid anymore...
What is the proper way to handle this?
* Should I track him to ask him a proper "Signed-off" patch ? (He seems to have changed company)
* Should I change the author of the patch? (I do not like this but on the other hand, the change is quite trivial)
* Something I have not thought of?
>
>> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
>> ---
>> pseudo_util.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/pseudo_util.c b/pseudo_util.c
>> index 64636b7..b58036f 100644
>> --- a/pseudo_util.c
>> +++ b/pseudo_util.c
>> @@ -1611,7 +1611,7 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) {
>> }
>> free(filename);
>> }
>> - fd = open(pseudo_path, O_WRONLY | O_APPEND | O_CREAT, 0644);
>> + fd = open(pseudo_path, O_WRONLY | O_APPEND | O_CREAT | O_CLOEXEC, 0644);
>> if (fd == -1) {
>> pseudo_diag("help: can't open log file %s: %s\n", pseudo_path, strerror(errno));
>> } else {
>> --
>> 2.30.2
>>
>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#177861): https://lists.openembedded.org/g/openembedded-core/message/177861
>> Mute This Topic: https://lists.openembedded.org/mt/97303652/3617179
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
>
>
--
Yoann Congal
Smile ECS - Tech Expert
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [pseudo][PATCH 1/1] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak
2023-03-01 9:00 ` Yoann Congal
@ 2023-03-01 9:04 ` Alexander Kanavin
2023-03-01 10:16 ` Richard Purdie
1 sibling, 0 replies; 7+ messages in thread
From: Alexander Kanavin @ 2023-03-01 9:04 UTC (permalink / raw)
To: Yoann Congal; +Cc: Alexandre Belloni, openembedded-core, Mingli Yu
I believe we need only the submitter's s-o-b, not the author?
Alex
On Wed, 1 Mar 2023 at 10:01, Yoann Congal <yoann.congal@smile.fr> wrote:
>
> Hi,
>
> On 3/1/23 09:52, Alexandre Belloni wrote:
> > On 01/03/2023 01:03:04+0100, Yoann Congal wrote:
> >> From: Pavel Modilaynen <pavelmn@axis.com>
> >>
> >> Use close-on-exec (O_CLOEXEC) flag when open log file to
> >> make sure its file descriptor is not leaked to parent
> >> process on fork/exec.
> >>
> >> Fixes [YOCTO #13311]
> >>
> >
> > This is missing the author's SoB
>
> That is right. But, as you would have noticed by now, his mail address is not valid anymore...
>
> What is the proper way to handle this?
> * Should I track him to ask him a proper "Signed-off" patch ? (He seems to have changed company)
> * Should I change the author of the patch? (I do not like this but on the other hand, the change is quite trivial)
> * Something I have not thought of?
>
> >
> >> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> >> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> >> ---
> >> pseudo_util.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/pseudo_util.c b/pseudo_util.c
> >> index 64636b7..b58036f 100644
> >> --- a/pseudo_util.c
> >> +++ b/pseudo_util.c
> >> @@ -1611,7 +1611,7 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) {
> >> }
> >> free(filename);
> >> }
> >> - fd = open(pseudo_path, O_WRONLY | O_APPEND | O_CREAT, 0644);
> >> + fd = open(pseudo_path, O_WRONLY | O_APPEND | O_CREAT | O_CLOEXEC, 0644);
> >> if (fd == -1) {
> >> pseudo_diag("help: can't open log file %s: %s\n", pseudo_path, strerror(errno));
> >> } else {
> >> --
> >> 2.30.2
> >>
> >
> >>
> >>
> >>
> >
> >
>
> --
> Yoann Congal
> Smile ECS - Tech Expert
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#177877): https://lists.openembedded.org/g/openembedded-core/message/177877
> Mute This Topic: https://lists.openembedded.org/mt/97303652/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [pseudo][PATCH 1/1] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak
2023-03-01 9:00 ` Yoann Congal
2023-03-01 9:04 ` Alexander Kanavin
@ 2023-03-01 10:16 ` Richard Purdie
1 sibling, 0 replies; 7+ messages in thread
From: Richard Purdie @ 2023-03-01 10:16 UTC (permalink / raw)
To: Yoann Congal, Alexandre Belloni; +Cc: openembedded-core, Mingli Yu
On Wed, 2023-03-01 at 10:00 +0100, Yoann Congal wrote:
> Hi,
>
> On 3/1/23 09:52, Alexandre Belloni wrote:
> > On 01/03/2023 01:03:04+0100, Yoann Congal wrote:
> > > From: Pavel Modilaynen <pavelmn@axis.com>
> > >
> > > Use close-on-exec (O_CLOEXEC) flag when open log file to
> > > make sure its file descriptor is not leaked to parent
> > > process on fork/exec.
> > >
> > > Fixes [YOCTO #13311]
> > >
> >
> > This is missing the author's SoB
>
> That is right. But, as you would have noticed by now, his mail address is not valid anymore...
>
> What is the proper way to handle this?
> * Should I track him to ask him a proper "Signed-off" patch ? (He seems to have changed company)
> * Should I change the author of the patch? (I do not like this but on the other hand, the change is quite trivial)
> * Something I have not thought of?
We need the submitters SoB line, it doesn't have to have the author's
although obviously it is better if we can. Since we can't here it just
means others have to verify the terms of the contribution. The patch is
trivial so it should all be fine.
Cheers,
Richard
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [pseudo][PATCH 1/1] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak
2023-03-01 0:03 ` [pseudo][PATCH 1/1] " Yoann Congal
2023-03-01 8:52 ` [OE-core] " Alexandre Belloni
@ 2023-03-01 10:18 ` Richard Purdie
1 sibling, 0 replies; 7+ messages in thread
From: Richard Purdie @ 2023-03-01 10:18 UTC (permalink / raw)
To: Yoann Congal, openembedded-core, Alexandre Belloni
Cc: Pavel Modilaynen, Mingli Yu
On Wed, 2023-03-01 at 01:03 +0100, Yoann Congal wrote:
> From: Pavel Modilaynen <pavelmn@axis.com>
>
> Use close-on-exec (O_CLOEXEC) flag when open log file to
> make sure its file descriptor is not leaked to parent
> process on fork/exec.
>
> Fixes [YOCTO #13311]
>
> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> ---
> pseudo_util.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/pseudo_util.c b/pseudo_util.c
> index 64636b7..b58036f 100644
> --- a/pseudo_util.c
> +++ b/pseudo_util.c
> @@ -1611,7 +1611,7 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) {
> }
> free(filename);
> }
> - fd = open(pseudo_path, O_WRONLY | O_APPEND | O_CREAT, 0644);
> + fd = open(pseudo_path, O_WRONLY | O_APPEND | O_CREAT | O_CLOEXEC, 0644);
> if (fd == -1) {
> pseudo_diag("help: can't open log file %s: %s\n", pseudo_path, strerror(errno));
> } else {
Thanks. I've put this on the oe-core-next branch in the pseudo repo.
I'm hoping Alexandre could run a test build please?
Cheers,
Richard
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-03-01 10:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01 0:03 [pseudo][PATCH 0/1] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak Yoann Congal
2023-03-01 0:03 ` [pseudo][PATCH 1/1] " Yoann Congal
2023-03-01 8:52 ` [OE-core] " Alexandre Belloni
2023-03-01 9:00 ` Yoann Congal
2023-03-01 9:04 ` Alexander Kanavin
2023-03-01 10:16 ` Richard Purdie
2023-03-01 10:18 ` Richard Purdie
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.