lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 23 Apr 2015 11:22:49 -0400
From:	Tejun Heo <tj@...nel.org>
To:	"Luis R. Rodriguez" <mcgrof@...not-panic.com>
Cc:	rusty@...tcorp.com.au, akpm@...ux-foundation.org, mingo@...nel.org,
	linux-kernel@...r.kernel.org, linux-wireless@...r.kernel.org,
	keescook@...omium.org, casey@...aufler-ca.com,
	cocci@...teme.lip6.fr, "Luis R. Rodriguez" <mcgrof@...e.com>,
	Jani Nikula <jani.nikula@...el.com>
Subject: Re: [PATCH v2 3/8] kernel/params.c: generalize bool_enable_only

Hello,

On Wed, Apr 22, 2015 at 02:55:06PM -0700, Luis R. Rodriguez wrote:
> +int param_set_bool_enable_only(const char *val, const struct kernel_param *kp)
> +{
> +	int err = 0;
> +	bool new_value;
> +	bool orig_value = *(bool *)kp->arg;
> +	struct kernel_param dummy_kp = *kp;
> +
> +	dummy_kp.arg = &new_value;
> +
> +	err = param_set_bool(val, &dummy_kp);
> +	if (err)
> +		return err;
> +
> +	/* Don't let them unset it once it's set! */
> +	if (!new_value && orig_value)
> +		return -EROFS;

I know that this was moved from another place but as we're making it
generic now I'm a bit curious about -EROFS.  Wouldn't -EINVAL be a
more conventional choice here?

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ