All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [yocto] meta-selinux: dunfell: libselinux: 0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch fails to apply
       [not found] ` <CO6PR04MB7779052FDF100E8648E231DDB2919@CO6PR04MB7779.namprd04.prod.outlook.com>
@ 2021-11-08 13:13   ` Maurizio Macrina
  2021-11-08 17:26     ` Maurizio Macrina
  0 siblings, 1 reply; 2+ messages in thread
From: Maurizio Macrina @ 2021-11-08 13:13 UTC (permalink / raw)
  To: jonas.brich, yocto


[-- Attachment #1.1.1: Type: text/plain, Size: 3184 bytes --]

Hello Jonas,
I’ve also recently hit an error during the do_patch task of libselinux.
001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch has been recently added to the dunfell branch but fails to apply:

ERROR: Applying patch '0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch' on target directory '/yocto/c2100-catchpoint-system-image/poky/build/tmp/work/core2-64-poky-linux/libselinux/3.0-r0/libselinux-3.0'
Command Error: 'quilt --quiltrc /yocto/c2100-catchpoint-system-image/poky/build/tmp/work/core2-64-poky-linux/libselinux/3.0-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0  Output:
Applying patch 0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch
can't find file to patch at input line 22
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 08f5e30177218fae7ce9f5c8d6856690126b2b30 Mon Sep 17 00:00:00 2001
|From: Ji Qin <jiqin.ji@huawei.com>
|Date: Sun, 14 Jun 2020 21:20:23 -0400
|Subject: [PATCH] libselinux: Fix NULL pointer use in
| selinux_restorecon_set_sehandle
|
|error occur when selinux_restorecon_default_handle return NULL in
|restorecon_init.
|
|fixes: https://github.com/SELinuxProject/selinux/issues/249
|
|Signed-off-by: Ji Qin <jiqin.ji@huawei.com>
|Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
|---
| libselinux/src/selinux_restorecon.c | 2 ++
| 1 file changed, 2 insertions(+)
|
|diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c
|index d1ce830c5..6993be6fd 100644
|--- a/libselinux/src/selinux_restorecon.c
|+++ b/libselinux/src/selinux_restorecon.c
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
Patch 0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch does not apply (enforce with -f)
DEBUG: Python function patch_do_patch finished
DEBUG: Python function do_patch finished

I’ve attached the corresponding log.

What would be the suggested fix for this?
I don’t think the leading a/b in the path is the issue here, other patch files have the same path.

Thanks.

Regards.

Maurizio Macrina
Senior Software Engineer  | Catchpoint
P:  +39 3472458541
E:  mmacrina@catchpoint.com<mailto:mmacrina@catchpoint.com>
www.catchpoint.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.catchpoint.com%2F&data=04%7C01%7Cmmacrina%40catchpoint.com%7C98c1d709680945f4f57608d97cfbfa25%7C0c927d7e38e74a3fa4f2e746ec8a0842%7C0%7C0%7C637678243963406272%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2BSEn3zXyaFsuKgWdv%2F4Z8KLoARCfg8DWsQ6LNoWh%2F%2Bk%3D&reserved=0>

[cid464070800*image001.png@01D7AF12.EF411150]<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.catchpoint.com%2Fsignature&data=04%7C01%7Cmmacrina%40catchpoint.com%7C98c1d709680945f4f57608d97cfbfa25%7C0c927d7e38e74a3fa4f2e746ec8a0842%7C0%7C0%7C637678243963416231%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=exWPtVUWOEYmXAFIm0F2uOvy2tO6wBDxRpz5cORxWpQ%3D&reserved=0>

[-- Attachment #1.1.2: Type: text/html, Size: 12574 bytes --]

[-- Attachment #1.2: image001.png --]
[-- Type: image/png, Size: 22092 bytes --]

[-- Attachment #2: log.tgz --]
[-- Type: application/x-compressed, Size: 1702 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [yocto] meta-selinux: dunfell: libselinux: 0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch fails to apply
  2021-11-08 13:13   ` [yocto] meta-selinux: dunfell: libselinux: 0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch fails to apply Maurizio Macrina
@ 2021-11-08 17:26     ` Maurizio Macrina
  0 siblings, 0 replies; 2+ messages in thread
From: Maurizio Macrina @ 2021-11-08 17:26 UTC (permalink / raw)
  To: jonas.brich, yocto


[-- Attachment #1.1: Type: text/plain, Size: 4841 bytes --]

Hi,
A possible fix for this issue during the do_patch task might be the following:


diff --git a/recipes-security/selinux/libselinux/0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch b/recipes-security/selinux/libselinux/0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch

index 8a9fb7c..66c86ee 100644

--- a/recipes-security/selinux/libselinux/0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch

+++ b/recipes-security/selinux/libselinux/0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch

@@ -17,8 +17,8 @@ Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>



 diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c

 index d1ce830c5..6993be6fd 100644

---- a/libselinux/src/selinux_restorecon.c

-+++ b/libselinux/src/selinux_restorecon.c

+--- a/src/selinux_restorecon.c

++++ b/src/selinux_restorecon.c

 @@ -1154,6 +1154,8 @@ void selinux_restorecon_set_sehandle(struct selabel_handle *hndl)

        size_t num_specfiles, fc_digest_len;


Basically in the patch file: 0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch remove “libselinux” from a/libselinux/src/selinux_restorecon.c and b/libselinux/src/selinux_restorecon.c

I tested it and works fine.

From: Maurizio Macrina <mmacrina@catchpoint.com>
Date: Monday, 8 November 2021 at 14:13
To: jonas.brich@bmw.de <jonas.brich@bmw.de>, yocto@lists.yoctoproject.org <yocto@lists.yoctoproject.org>
Subject: Re: [yocto] meta-selinux: dunfell: libselinux: 0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch fails to apply
Hello Jonas,
I’ve also recently hit an error during the do_patch task of libselinux.
001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch has been recently added to the dunfell branch but fails to apply:

ERROR: Applying patch '0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch' on target directory '/yocto/c2100-catchpoint-system-image/poky/build/tmp/work/core2-64-poky-linux/libselinux/3.0-r0/libselinux-3.0'
Command Error: 'quilt --quiltrc /yocto/c2100-catchpoint-system-image/poky/build/tmp/work/core2-64-poky-linux/libselinux/3.0-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0  Output:
Applying patch 0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch
can't find file to patch at input line 22
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 08f5e30177218fae7ce9f5c8d6856690126b2b30 Mon Sep 17 00:00:00 2001
|From: Ji Qin <jiqin.ji@huawei.com>
|Date: Sun, 14 Jun 2020 21:20:23 -0400
|Subject: [PATCH] libselinux: Fix NULL pointer use in
| selinux_restorecon_set_sehandle
|
|error occur when selinux_restorecon_default_handle return NULL in
|restorecon_init.
|
|fixes: https://github.com/SELinuxProject/selinux/issues/249
|
|Signed-off-by: Ji Qin <jiqin.ji@huawei.com>
|Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
|---
| libselinux/src/selinux_restorecon.c | 2 ++
| 1 file changed, 2 insertions(+)
|
|diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c
|index d1ce830c5..6993be6fd 100644
|--- a/libselinux/src/selinux_restorecon.c
|+++ b/libselinux/src/selinux_restorecon.c
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
Patch 0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch does not apply (enforce with -f)
DEBUG: Python function patch_do_patch finished
DEBUG: Python function do_patch finished

I’ve attached the corresponding log.

What would be the suggested fix for this?
I don’t think the leading a/b in the path is the issue here, other patch files have the same path.

Thanks.

Regards.

Maurizio Macrina
Senior Software Engineer  | Catchpoint
P:  +39 3472458541
E:  mmacrina@catchpoint.com<mailto:mmacrina@catchpoint.com>
www.catchpoint.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.catchpoint.com%2F&data=04%7C01%7Cmmacrina%40catchpoint.com%7C98c1d709680945f4f57608d97cfbfa25%7C0c927d7e38e74a3fa4f2e746ec8a0842%7C0%7C0%7C637678243963406272%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2BSEn3zXyaFsuKgWdv%2F4Z8KLoARCfg8DWsQ6LNoWh%2F%2Bk%3D&reserved=0>

[cid464070800*image001.png@01D7AF12.EF411150]<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.catchpoint.com%2Fsignature&data=04%7C01%7Cmmacrina%40catchpoint.com%7C98c1d709680945f4f57608d97cfbfa25%7C0c927d7e38e74a3fa4f2e746ec8a0842%7C0%7C0%7C637678243963416231%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=exWPtVUWOEYmXAFIm0F2uOvy2tO6wBDxRpz5cORxWpQ%3D&reserved=0>

[-- Attachment #1.2: Type: text/html, Size: 16841 bytes --]

[-- Attachment #2: image001.png --]
[-- Type: image/png, Size: 22093 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-08 17:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CO6PR04MB7779842C1CFE7614B311F0CAB2919@CO6PR04MB7779.namprd04.prod.outlook.com>
     [not found] ` <CO6PR04MB7779052FDF100E8648E231DDB2919@CO6PR04MB7779.namprd04.prod.outlook.com>
2021-11-08 13:13   ` [yocto] meta-selinux: dunfell: libselinux: 0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch fails to apply Maurizio Macrina
2021-11-08 17:26     ` Maurizio Macrina

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.