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

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

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

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



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


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

  reply	other threads:[~2012-03-06  2:27 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 [this message]
2012-03-06  2:38           ` Steven Haigh
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=20120306132701.1b9600f4@notabene.brown \
    --to=neilb@suse.de \
    --cc=john.robinson@anonymous.org.uk \
    --cc=linux-raid@vger.kernel.org \
    --cc=netwiz@crc.id.au \
    /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 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).