Skip to contentSkip to conversation

mdadm: sending ioctl 1261 to a partition!

DISCUSSION Steven Haigh 5 participants 10 messages Mar 5, 2012 – Mar 8, 2012 MD RAID

lore
Share & tools
lore
#0 lore raw

I've noticed that recently I've managed to get a ton of messages like this at boot:

mdadm: sending ioctl 1261 to a partition!
mdadm: sending ioctl 800c0910 to a partition!

Not quite sure what is causing them - but everything still seems to work ok.

# mdadm --version
mdadm - v3.2.2 - 17th June 2011

Distro is Scientific Linux 6.2 - kernel is a custom build of 2.6.32.56.

My arrays are set up as such:
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=9f19116a:d2808216:cc87af34:eae68242

ARRAY /dev/md1 level=raid1 num-devices=2 UUID=afb92c19:b9b1e3ae:07af315d:738e38be

ARRAY /dev/md2 level=raid6 num-devices=4 UUID=8a5de4d9:ea754e76:89b64059:c12cb374

md0 and md1 are using partitions, md2 is using whole disks. Anybody got any insight into what causes this and how I could go about correcting it?

Signature · 6 lines
Steven Haigh

Email: [email protected]
Web: http://www.crc.id.au
Phone: (03) 9001 6090 - 0412 935 897
Fax: (03) 8338 0299
#1 lore raw
Quoted 5 lines · Steven Haigh

I've noticed that recently I've managed to get a ton of messages like this at boot:

mdadm: sending ioctl 1261 to a partition!
mdadm: sending ioctl 800c0910 to a partition!

It's probably harmless.

http://lists.debian.org/debian-kernel/2012/01/msg01105.html says "This warning was introduced as part of the fix for CVE-2011-4127"

https://bugzilla.redhat.com/show_bug.cgi?id=783955#c4 says "Actually, the warning seems a false positive to me"

Cheers,

John.

#2 lore raw
Quoted 7 lines · John Robinson
Quoted 5 lines · Steven Haigh

I've noticed that recently I've managed to get a ton of messages like this at boot:

mdadm: sending ioctl 1261 to a partition!
mdadm: sending ioctl 800c0910 to a partition!

Quoted 7 lines

It's probably harmless.

http://lists.debian.org/debian-kernel/2012/01/msg01105.html says "This warning was introduced as part of the fix for CVE-2011-4127"

https://bugzilla.redhat.com/show_bug.cgi?id=783955#c4 says "Actually, the warning seems a false positive to me"

I did see these - and I probably should have mentioned it in the original post. Naughty me for posting at times I should really be asleep.

The general jist of it seemed to be "it always failed before, now we just know about it". What makes me wonder is that if it always failed before, why do we do it in the first place?

Signature · 6 lines
Steven Haigh

Email: [email protected]
Web: http://www.crc.id.au
Phone: (03) 9001 6090 - 0412 935 897
Fax: (03) 8338 0299
#3 lore raw
Quoted 16 lines · On Tue, 06 Mar 2012 05:53:28 +1100 Steven Haigh <[email protected]> wrote:
Quoted 7 lines · John Robinson
Quoted 5 lines · Steven Haigh

I've noticed that recently I've managed to get a ton of messages like this at boot:

mdadm: sending ioctl 1261 to a partition!
mdadm: sending ioctl 800c0910 to a partition!

Quoted 7 lines

It's probably harmless.

http://lists.debian.org/debian-kernel/2012/01/msg01105.html says "This warning was introduced as part of the fix for CVE-2011-4127"

https://bugzilla.redhat.com/show_bug.cgi?id=783955#c4 says "Actually, the warning seems a false positive to me"

Quoted 7 lines

I did see these - and I probably should have mentioned it in the original post. Naughty me for posting at times I should really be asleep.

The general jist of it seemed to be "it always failed before, now we just know about it". What makes me wonder is that if it always failed before, why do we do it in the first place?

800c0910 is 'are you an md device'. So failure is a valid response.

1261 is flush-bufs. I hope that does still work on partitions....

NeilBrown

#4 lore raw
Quoted 21 lines · NeilBrown
Quoted 19 lines · On Tue, 06 Mar 2012 05:53:28 +1100 Steven Haigh<[email protected]> wrote:
Quoted 7 lines · John Robinson
Quoted 5 lines · Steven Haigh

I've noticed that recently I've managed to get a ton of messages like this at boot:

mdadm: sending ioctl 1261 to a partition!
mdadm: sending ioctl 800c0910 to a partition!

Quoted 7 lines

It's probably harmless.

http://lists.debian.org/debian-kernel/2012/01/msg01105.html says "This warning was introduced as part of the fix for CVE-2011-4127"

https://bugzilla.redhat.com/show_bug.cgi?id=783955#c4 says "Actually, the warning seems a false positive to me"

I did see these - and I probably should have mentioned it in the original post. Naughty me for posting at times I should really be asleep.

Quoted 8 lines
Quoted 4 lines

The general jist of it seemed to be "it always failed before, now we just know about it". What makes me wonder is that if it always failed before, why do we do it in the first place?

800c0910 is 'are you an md device'. So failure is a valid response.

1261 is flush-bufs. I hope that does still work on partitions....

Thanks Neil, Any ideas how I can test this to check if flush-bufs is working? While I'm not a code junkie these days - I'm great at picking holes in thing ;)

I picked it up as it only seemed to be visible in 2.6.32.56. I don't recall seeing it in any previous 2.6.32.x kernel.

Signature · 6 lines
Steven Haigh

Email: [email protected]
Web: http://www.crc.id.au
Phone: (03) 9001 6090 - 0412 935 897
Fax: (03) 8338 0299
#5 lore raw
Quoted 27 lines · On Tue, 06 Mar 2012 13:00:01 +1100 Steven Haigh <[email protected]> wrote:
Quoted 26 lines · NeilBrown
Quoted 23 lines · On Tue, 06 Mar 2012 05:53:28 +1100 Steven Haigh<[email protected]> wrote:
Quoted 7 lines · John Robinson
Quoted 5 lines · Steven Haigh

I've noticed that recently I've managed to get a ton of messages like this at boot:

mdadm: sending ioctl 1261 to a partition!
mdadm: sending ioctl 800c0910 to a partition!

Quoted 7 lines

It's probably harmless.

http://lists.debian.org/debian-kernel/2012/01/msg01105.html says "This warning was introduced as part of the fix for CVE-2011-4127"

https://bugzilla.redhat.com/show_bug.cgi?id=783955#c4 says "Actually, the warning seems a false positive to me"

I did see these - and I probably should have mentioned it in the original post. Naughty me for posting at times I should really be asleep.

The general jist of it seemed to be "it always failed before, now we just know about it". What makes me wonder is that if it always failed before, why do we do it in the first place?

Quoted 7 lines
Quoted 3 lines

800c0910 is 'are you an md device'. So failure is a valid response.

1261 is flush-bufs. I hope that does still work on partitions....

Thanks Neil, Any ideas how I can test this to check if flush-bufs is working? While I'm not a code junkie these days - I'm great at picking holes in thing ;)

Read the code....

In block/ioctl.c

	case BLKFLSBUF:
		if (!capable(CAP_SYS_ADMIN))
			return -EACCES;

		ret = __blkdev_driver_ioctl(bdev, mode, cmd, arg);
		/* -EINVAL to handle old uncorrected drivers */
		if (ret != -EINVAL && ret != -ENOTTY)
			return ret;

		lock_kernel();
		fsync_bdev(bdev);
		invalidate_bdev(bdev);
		unlock_kernel();
		return 0;

So it is still called fsync_bdev and invalidate_bdev as long as the ioctl function for the underlying disk returns -EINVAL or -ENOTTY.

The function that shows that warning is scsi_verify_blk_ioctl in block/scsi_ioctl.c
The worst it can do is return -ENOTTY, and that is safe.

So the warning is bogus, the code still works.

NeilBrown

Quoted 4 lines

I picked it up as it only seemed to be visible in 2.6.32.56. I don't recall seeing it in any previous 2.6.32.x kernel.

#6 lore raw
Quoted 31 lines · NeilBrown
Quoted 29 lines · On Tue, 06 Mar 2012 13:00:01 +1100 Steven Haigh<[email protected]> wrote:
Quoted 28 lines · NeilBrown
Quoted 16 lines · On Tue, 06 Mar 2012 05:53:28 +1100 Steven Haigh<[email protected]> wrote:
Quoted 7 lines · John Robinson
Quoted 5 lines · Steven Haigh

I've noticed that recently I've managed to get a ton of messages like this at boot:

mdadm: sending ioctl 1261 to a partition!
mdadm: sending ioctl 800c0910 to a partition!

Quoted 7 lines

It's probably harmless.

http://lists.debian.org/debian-kernel/2012/01/msg01105.html says "This warning was introduced as part of the fix for CVE-2011-4127"

https://bugzilla.redhat.com/show_bug.cgi?id=783955#c4 says "Actually, the warning seems a false positive to me"

Quoted 7 lines

I did see these - and I probably should have mentioned it in the original post. Naughty me for posting at times I should really be asleep.

The general jist of it seemed to be "it always failed before, now we just know about it". What makes me wonder is that if it always failed before, why do we do it in the first place?

800c0910 is 'are you an md device'. So failure is a valid response.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

1261 is flush-bufs. I hope that does still work on partitions....

Thanks Neil, Any ideas how I can test this to check if flush-bufs is working? While I'm not a code junkie these days - I'm great at picking holes in thing ;)

Read the code....

Easier said than done.

Quoted 15 lines

In block/ioctl.c

	case BLKFLSBUF:
		if (!capable(CAP_SYS_ADMIN))
			return -EACCES;

		ret = __blkdev_driver_ioctl(bdev, mode, cmd, arg);
		/* -EINVAL to handle old uncorrected drivers */
		if (ret != -EINVAL&&  ret != -ENOTTY)
			return ret;

		lock_kernel();
		fsync_bdev(bdev);
		invalidate_bdev(bdev);
		unlock_kernel();
		return 0;

You know that look when peoples eyes glaze over - commonly referred to in the BOFH stories as *IDIOT MODE ON*. Thats what I get when I look at that code ;)

Quoted 7 lines

So it is still called fsync_bdev and invalidate_bdev as long as the ioctl function for the underlying disk returns -EINVAL or -ENOTTY.

The function that shows that warning is scsi_verify_blk_ioctl in block/scsi_ioctl.c
The worst it can do is return -ENOTTY, and that is safe.

I recognise a lot of those words, but I have no idea what they mean in that sequence. This proves that this list is great for people understanding that code. It also means that I can trust exactly what is going on :) I don't want to burden you with trying to explain it to someone like me, but its comforting to know all is right :)

Quoted 1 line

So the warning is bogus, the code still works.

Awesome! Means I can safely ignore it, and this gets archived for proper reference on the archive lists and should probably appear in googles searches on the subject soon to stop it from being asked here again :)

Signature · 6 lines
Steven Haigh

Email: [email protected]
Web: http://www.crc.id.au
Phone: (03) 9001 6090 - 0412 935 897
Fax: (03) 8338 0299
#7 lore raw
In reply to NeilBrown
Quoted 10 lines · NeilBrown

So it is still called fsync_bdev and invalidate_bdev as long as the ioctl function for the underlying disk returns -EINVAL or -ENOTTY.

The function that shows that warning is scsi_verify_blk_ioctl in block/scsi_ioctl.c The worst it can do is return -ENOTTY, and that is safe.

So the warning is bogus, the code still works.

We should whitelist ioctls if they are legitimately used and harmless.
Do we have a specific list?

-hpa

Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.
#8 lore raw
Quoted 9 lines · On Mon, 05 Mar 2012 21:29:59 -0800 "H. Peter Anvin" <[email protected]> wrote:
Quoted 8 lines · NeilBrown

So it is still called fsync_bdev and invalidate_bdev as long as the ioctl function for the underlying disk returns -EINVAL or -ENOTTY.

The function that shows that warning is scsi_verify_blk_ioctl in block/scsi_ioctl.c The worst it can do is return -ENOTTY, and that is safe.

Quoted 9 lines
Quoted 2 lines

So the warning is bogus, the code still works.

We should whitelist ioctls if they are legitimately used and harmless.
Do we have a specific list?

-hpa

We had the following in our SLES kernel for a while, though it seems it disappeared when we pulled in 3.0.18.
Jan: should we put this stuff back?

NeilBrown

@@ -78,11 +83,19 @@ Index: linux-3.0-SLE11-SP2/block/scsi_ioctl.c

 +      case SG_GET_RESERVED_SIZE:
 +      case SG_SET_RESERVED_SIZE:
 +      case SG_EMULATED_HOST:
++      case BLKFLSBUF:
++      case BLKROSET:

+ return 0;
+ case CDROM_GET_CAPABILITY:
-+ /* Keep this until we remove the printk below. udev sends it
-+ * and we do not want to spam dmesg about it. CD-ROMs do
-+ * not have partitions, so we get here only for disks.

++      case CDROM_DRIVE_STATUS:
++      case FDGETPRM:
++      case RAID_VERSION:
++      case MTIOCGET:

++#ifdef CONFIG_COMPAT
++ case 0x801c6d02: /* MTIOCGET32 */
++#endif
++ /* Keep this until we remove the printk below. udev/dd sends

++               * these and we do not want to spam dmesg about it. CD-ROMs
++               * & tapes do not have partitions, so we get here only for
++               * disks.
 +               */

+ return -ENOTTY;
+ default:

#9 lore raw
Quoted 17 lines · NeilBrown
Quoted 15 lines · On Mon, 05 Mar 2012 21:29:59 -0800 "H. Peter Anvin" <[email protected]> wrote:
Quoted 10 lines · NeilBrown

So it is still called fsync_bdev and invalidate_bdev as long as the ioctl function for the underlying disk returns -EINVAL or -ENOTTY.

The function that shows that warning is scsi_verify_blk_ioctl in block/scsi_ioctl.c The worst it can do is return -ENOTTY, and that is safe.

So the warning is bogus, the code still works.

We should whitelist ioctls if they are legitimately used and harmless.
Do we have a specific list?

Quoted 7 lines
Quoted 3 lines

-hpa

We had the following in our SLES kernel for a while, though it seems it disappeared when we pulled in 3.0.18.
Jan: should we put this stuff back?

Yeah, we should. I think it was removed by accident - partly because the
patch doing the change was tagged as in mainline but it actually differed from mainline slightly.

Honza

Quoted 26 lines
(quoted diff) +13 -3
@@ -78,11 +83,19 @@ Index: linux-3.0-SLE11-SP2/block/scsi_ioctl.c
 +      case SG_GET_RESERVED_SIZE:
 +      case SG_SET_RESERVED_SIZE:
 +      case SG_EMULATED_HOST:
++      case BLKFLSBUF:
++      case BLKROSET:
 +              return 0;
 +      case CDROM_GET_CAPABILITY:
-+              /* Keep this until we remove the printk below.  udev sends it
-+               * and we do not want to spam dmesg about it.   CD-ROMs do
-+               * not have partitions, so we get here only for disks.
++      case CDROM_DRIVE_STATUS:
++      case FDGETPRM:
++      case RAID_VERSION:
++      case MTIOCGET:
++#ifdef CONFIG_COMPAT
++      case 0x801c6d02:        /* MTIOCGET32 */
++#endif
++              /* Keep this until we remove the printk below. udev/dd sends
++               * these and we do not want to spam dmesg about it. CD-ROMs
++               * & tapes do not have partitions, so we get here only for
++               * disks.
 +               */
 +              return -ENOTTY;
 +      default:
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR