[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 2/4] flask: fix error propagation from flask_security_set_bool()
On 07/02/14 13:04, Jan Beulich wrote: >>>> On 07.02.14 at 13:56, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote: >> On 07/02/14 09:47, Jan Beulich wrote: >>> The function should return an error when flask_security_make_bools() as >> when flask_security_make_bools() fails ? > Oops, yes of course. Corrected. > >>> --- a/xen/xsm/flask/flask_op.c >>> +++ b/xen/xsm/flask/flask_op.c >>> @@ -364,9 +364,10 @@ static int flask_security_set_bool(struc >>> else >>> { >>> if ( !bool_pending_values ) >>> - flask_security_make_bools(); >>> - >>> - if ( arg->bool_id >= bool_num ) >>> + rv = flask_security_make_bools(); >>> + if ( !rv && arg->bool_id >= bool_num ) >> Surely you want "rv || arg->" if you want to catch both >> flask_security_make_bools() failing as well as the input ID being out of >> range? > Yes, which is what the code does - it just cares to not clobber "rv" > if that got already set non-zero from the function call. See the > context below. > > Jan Ah yes. Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> > >>> + rv = -ENOENT; >>> + if ( rv ) >>> goto out; >>> >>> bool_pending_values[arg->bool_id] = !!(arg->new_value); >>> >>> >>> >>> >>> >>> _______________________________________________ >>> Xen-devel mailing list >>> Xen-devel@xxxxxxxxxxxxx >>> http://lists.xen.org/xen-devel > > _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |