FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 04-20-2010, 07:16 AM
Nikanth Karthikesan
 
Default Just inform and dont warn when DM_DEV_REMOVE is tried on a open device

Dont warn when DM_DEV_REMOVE ioctl is tried on a open device.

On openSUSE when cryptsetup and udev interact, cryptsetup sometimes tries to
remove a dm device currently opened by blkid, which is not a serious issue to
print a kernel warning. The application should retry if -EBUSY is returned. So
let us make it an informational message instead.

Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>

---

diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index d7500e1..dcfa48a 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -729,7 +729,7 @@ static int dev_remove(struct dm_ioctl *param, size_t param_size)
*/
r = dm_lock_for_deletion(md);
if (r) {
- DMWARN("unable to remove open device %s", hc->name);
+ DMINFO("unable to remove open device %s", hc->name);
up_write(&_hash_lock);
dm_put(md);
return r;

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 04-20-2010, 08:00 AM
Milan Broz
 
Default Just inform and dont warn when DM_DEV_REMOVE is tried on a open device

On 04/20/2010 09:16 AM, Nikanth Karthikesan wrote:
> Dont warn when DM_DEV_REMOVE ioctl is tried on a open device.
>
> On openSUSE when cryptsetup and udev interact, cryptsetup sometimes tries to
> remove a dm device currently opened by blkid, which is not a serious issue to
> print a kernel warning. The application should retry if -EBUSY is returned. So
> let us make it an informational message instead.

> - DMWARN("unable to remove open device %s", hc->name);
> + DMINFO("unable to remove open device %s", hc->name);

NAK.

Firstly, it is security problem if someone from udev rules tries to open
temporary-cryptsetup device, it contains only private key material.

Secondly, it must be solved on application level and not paper kernel using
patches which hides errors.

FYI there is already patch in upstream cryptsetup which uses udev cookie mechanism.
It still cannot solve artificial change events (which causes scan from rules randomly),
but should help here. (will be in cryptsetup 1.1.1)

Milan

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 04-20-2010, 08:43 AM
Nikanth Karthikesan
 
Default Just inform and dont warn when DM_DEV_REMOVE is tried on a open device

On Tuesday 20 April 2010 13:30:18 Milan Broz wrote:
> On 04/20/2010 09:16 AM, Nikanth Karthikesan wrote:
> > Dont warn when DM_DEV_REMOVE ioctl is tried on a open device.
> >
> > On openSUSE when cryptsetup and udev interact, cryptsetup sometimes tries
> > to remove a dm device currently opened by blkid, which is not a serious
> > issue to print a kernel warning. The application should retry if -EBUSY
> > is returned. So let us make it an informational message instead.
> >
> > - DMWARN("unable to remove open device %s", hc->name);
> > + DMINFO("unable to remove open device %s", hc->name);
>
> NAK.
>
> Firstly, it is security problem if someone from udev rules tries to open
> temporary-cryptsetup device, it contains only private key material.
>

Okay.

> Secondly, it must be solved on application level and not paper kernel using
> patches which hides errors.
>

Agreed, it must be solved in the application level.

/me wonders whether this is an error worth a warning from kernel? Returning
-EBUSY seems enough. May be a KERN_INFO message... But yes rest of DM prints
warnings for these kind of events.

> FYI there is already patch in upstream cryptsetup which uses udev cookie
> mechanism. It still cannot solve artificial change events (which causes
> scan from rules randomly), but should help here. (will be in cryptsetup
> 1.1.1)
>

Oh, ok. Thanks for the pointer.

Thanks
Nikanth

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 01:28 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org