linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] [PATCH 0/3] Make udev rules more robust
@ 2022-04-04 21:51 Demi Marie Obenour
  2022-04-04 21:56 ` [linux-lvm] [PATCH 3/3] Disable udev rules if udev flags can't be obtained Demi Marie Obenour
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Demi Marie Obenour @ 2022-04-04 21:51 UTC (permalink / raw)
  To: LVM general discussion and development; +Cc: Marek Marczykowski-Górecki


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

This makes the udev rules more robust against various unsafe error
conditions.

Demi Marie Obenour (3):
  dmsetup: return non-zero on stdio I/O error
  Disable lvm2 udev rules if `dmsetup splitname` fails
  Disable udev rules if udev flags can't be obtained

 libdm/dm-tools/dmsetup.c | 2 ++
 udev/10-dm.rules.in      | 2 +-
 udev/11-dm-lvm.rules.in  | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

-- 
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [linux-lvm] [PATCH 1/3] dmsetup: return non-zero on stdio I/O error
@ 2022-04-04 21:54 Demi Marie Obenour
  0 siblings, 0 replies; 5+ messages in thread
From: Demi Marie Obenour @ 2022-04-04 21:54 UTC (permalink / raw)
  To: LVM general discussion and development; +Cc: Marek Marczykowski-Górecki


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

If there is an I/O error on stdout, return a non-zero status so that
udev can avoid trusting the values printed.  Deeper changes to the
log code are out of scope for this patch.
---
 libdm/dm-tools/dmsetup.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libdm/dm-tools/dmsetup.c b/libdm/dm-tools/dmsetup.c
index d01b8f2..0449e40 100644
--- a/libdm/dm-tools/dmsetup.c
+++ b/libdm/dm-tools/dmsetup.c
@@ -7491,5 +7491,7 @@ out:
 	if (_initial_timestamp)
 		dm_timestamp_destroy(_initial_timestamp);
 
+        if (fflush(stdout) || ferror(stdout))
+            return 1;
 	return (_switches[HELP_ARG] || _switches[VERSION_ARG]) ? 0 : ret;
 }
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

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

end of thread, other threads:[~2022-04-04 22:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-04 21:51 [linux-lvm] [PATCH 0/3] Make udev rules more robust Demi Marie Obenour
2022-04-04 21:56 ` [linux-lvm] [PATCH 3/3] Disable udev rules if udev flags can't be obtained Demi Marie Obenour
2022-04-04 21:58 ` [linux-lvm] [PATCH 1/3] dmsetup: return non-zero on stdio I/O error Demi Marie Obenour
2022-04-04 22:02 ` [linux-lvm] [PATCH 2/3] Disable lvm2 udev rules if `dmsetup splitname` fails Demi Marie Obenour
2022-04-04 21:54 [linux-lvm] [PATCH 1/3] dmsetup: return non-zero on stdio I/O error Demi Marie Obenour

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).