ionice rootwrap config doesn't cover every option pattern

Bug #1334422 reported by Tomoki Sekiyama
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Tomoki Sekiyama

Bug Description

Cinder may execute dd with iflag=direct OR oflag=direct (or both) options under ionice.
https://github.com/openstack/cinder/blob/master/cinder/volume/utils.py#L183

However, currently rootwrap only covers ionice+dd with both iflag AND oflag options.
https://github.com/openstack/cinder/blob/master/etc/cinder/rootwrap.d/volume.filters#L46

Since ChainingRegExpFilter is merged to oslo.rootwrap, now we can use this to allow ionice to be combined with the other allowed commands including 'dd'.
https://github.com/openstack/oslo.rootwrap/blob/master/README.rst#chainingregexpfilter

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/102667

Changed in cinder:
assignee: nobody → Tomoki Sekiyama (tsekiyama)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/102667
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=bb1579090b56b4de33bb3873b34ca6601f95dd56
Submitter: Jenkins
Branch: master

commit bb1579090b56b4de33bb3873b34ca6601f95dd56
Author: Tomoki Sekiyama <email address hidden>
Date: Wed Jun 25 16:50:18 2014 -0400

    Rewrite ionice command filter using ChainingRegExpFilter

    Currently, the ionice command prepended to a dd command is allowed by three
    rootwrap RegExpFilter's that cover 3 arguments patterns. However, this
    doesn't support if either 'iflag=direct' or 'oflag=direct' is omitted.
    Because of this problem, deletion of volumes may fail if volume_clear_ionice
    is set, as 'iflag=direct' is omitted.

    This commit fixes this problem by replacing the filters with
    ChainingRegExpFilter's, which allow to execute ionice to be combined with the
    other allowed commands, including 'dd'.

    Originally '-c[0-3]( -n[0-7])?' was allowed as an ionice option, but it is
    invalid to specify -n[0-7] in a single option (for example, when '-c2 -n7'
    is specified, ionice causes an error "invalid class argument: '2 -n7'").
    In this patch, 2 filters are provided to cover the case only with -c option
    and the case with both -c and -n options.

    Change-Id: Ia074bf3244b7f010bd9e3b5e46c3152c1848f3d3
    Signed-off-by: Tomoki Sekiyama <email address hidden>
    Closes-Bug: 1334422

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → juno-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: juno-3 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.