All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Haigh <netwiz@crc.id.au>
To: NeilBrown <neilb@suse.de>
Cc: John Robinson <john.robinson@anonymous.org.uk>,
	linux-raid@vger.kernel.org
Subject: Re: mdadm: sending ioctl 1261 to a partition!
Date: Tue, 06 Mar 2012 13:38:18 +1100	[thread overview]
Message-ID: <4F55789A.1070505@crc.id.au> (raw)
In-Reply-To: <20120306132701.1b9600f4@notabene.brown>

[-- Attachment #1: Type: text/plain, Size: 3227 bytes --]

On 6/03/2012 1:27 PM, NeilBrown wrote:
> On Tue, 06 Mar 2012 13:00:01 +1100 Steven Haigh<netwiz@crc.id.au>  wrote:
>
>> On 6/03/2012 7:01 AM, NeilBrown wrote:
>>> On Tue, 06 Mar 2012 05:53:28 +1100 Steven Haigh<netwiz@crc.id.au>   wrote:
>>>
>>>> On 6/03/2012 1:52 AM, John Robinson wrote:
>>>>> On 05/03/2012 13:03, Steven Haigh wrote:
>>>>>> 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"
>>>>
>>>> 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....
>>
>> 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.

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

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

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

-- 
Steven Haigh

Email: netwiz@crc.id.au
Web: http://www.crc.id.au
Phone: (03) 9001 6090 - 0412 935 897
Fax: (03) 8338 0299


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4952 bytes --]

  reply	other threads:[~2012-03-06  2:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 13:03 mdadm: sending ioctl 1261 to a partition! Steven Haigh
2012-03-05 14:52 ` John Robinson
2012-03-05 18:53   ` Steven Haigh
2012-03-05 20:01     ` NeilBrown
2012-03-06  2:00       ` Steven Haigh
2012-03-06  2:27         ` NeilBrown
2012-03-06  2:38           ` Steven Haigh [this message]
2012-03-06  5:29           ` H. Peter Anvin
2012-03-08  0:04             ` NeilBrown
2012-03-08 10:54               ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F55789A.1070505@crc.id.au \
    --to=netwiz@crc.id.au \
    --cc=john.robinson@anonymous.org.uk \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.