Commit 71f9bc6f authored by Harald Freudenberger's avatar Harald Freudenberger Committed by Heiko Carstens
Browse files

s390/ap/zcrypt: Revisit module param permissions



Revisit and rework module parameter permissions for AP bus and zcrypt
device drivers.

In general all sysfs permissions for AP bus and zcrypt parameters should be
0444 so that user space tools like lszcrypt can read the current value of
module parameters.

Some exceptions are only for some internal tweak parameters like
ap_msg_pool_min_items and zcrypt_mempool_threshold which should only be
readable by an administrator.

Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
Reviewed-by: default avatarHolger Dengler <dengler@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent afa8fa52
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -52,24 +52,24 @@ MODULE_LICENSE("GPL");

int ap_domain_index = -1;	/* Adjunct Processor Domain Index */
static DEFINE_SPINLOCK(ap_domain_lock);
module_param_named(domain, ap_domain_index, int, 0440);
module_param_named(domain, ap_domain_index, int, 0444);
MODULE_PARM_DESC(domain, "domain index for ap devices");
EXPORT_SYMBOL(ap_domain_index);

static int ap_thread_flag;
module_param_named(poll_thread, ap_thread_flag, int, 0440);
module_param_named(poll_thread, ap_thread_flag, int, 0444);
MODULE_PARM_DESC(poll_thread, "Turn on/off poll thread, default is 0 (off).");

static char *apm_str;
module_param_named(apmask, apm_str, charp, 0440);
module_param_named(apmask, apm_str, charp, 0444);
MODULE_PARM_DESC(apmask, "AP bus adapter mask.");

static char *aqm_str;
module_param_named(aqmask, aqm_str, charp, 0440);
module_param_named(aqmask, aqm_str, charp, 0444);
MODULE_PARM_DESC(aqmask, "AP bus domain mask.");

static int ap_useirq = 1;
module_param_named(useirq, ap_useirq, int, 0440);
module_param_named(useirq, ap_useirq, int, 0444);
MODULE_PARM_DESC(useirq, "Use interrupt if available, default is 1 (on).");

atomic_t ap_max_msg_size = ATOMIC_INIT(AP_DEFAULT_MAX_MSG_SIZE);
@@ -130,7 +130,7 @@ debug_info_t *ap_dbf_info;
 */
static mempool_t *ap_msg_pool;
static unsigned int ap_msg_pool_min_items = 8;
module_param_named(msgpool_min_items, ap_msg_pool_min_items, uint, 0440);
module_param_named(msgpool_min_items, ap_msg_pool_min_items, uint, 0400);
MODULE_PARM_DESC(msgpool_min_items, "AP message pool minimal items");

/*
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ MODULE_DESCRIPTION("Cryptographic Coprocessor interface, " \
MODULE_LICENSE("GPL");

unsigned int zcrypt_mempool_threshold = 5;
module_param_named(mempool_threshold, zcrypt_mempool_threshold, uint, 0440);
module_param_named(mempool_threshold, zcrypt_mempool_threshold, uint, 0400);
MODULE_PARM_DESC(mempool_threshold, "CCA and EP11 request/reply mempool minimal items (min: 1)");

/*