Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 's390-7.0-7' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 fixes from Vasily Gorbik:

- Fix a memory leak in the zcrypt driver where the AP message buffer
for clear key RSA requests was allocated twice, once by the caller
and again locally, causing the first allocation to never be freed

- Fix the cpum_sf perf sampling rate overflow adjustment to clamp the
recalculated rate to the hardware maximum, preventing exceptions on
heavily loaded systems running with HZ=1000

* tag 's390-7.0-7' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390/zcrypt: Fix memory leak with CCA cards used as accelerator
s390/cpum_sf: Cap sampling rate to prevent lsctl exception

+19 -19
+5 -1
arch/s390/kernel/perf_cpum_sf.c
··· 1168 1168 static void hw_perf_event_update(struct perf_event *event, int flush_all) 1169 1169 { 1170 1170 unsigned long long event_overflow, sampl_overflow, num_sdb; 1171 + struct cpu_hw_sf *cpuhw = this_cpu_ptr(&cpu_hw_sf); 1171 1172 struct hw_perf_event *hwc = &event->hw; 1172 1173 union hws_trailer_header prev, new; 1173 1174 struct hws_trailer_entry *te; ··· 1248 1247 * are dropped. 1249 1248 * Slightly increase the interval to avoid hitting this limit. 1250 1249 */ 1251 - if (event_overflow) 1250 + if (event_overflow) { 1252 1251 SAMPL_RATE(hwc) += DIV_ROUND_UP(SAMPL_RATE(hwc), 10); 1252 + if (SAMPL_RATE(hwc) > cpuhw->qsi.max_sampl_rate) 1253 + SAMPL_RATE(hwc) = cpuhw->qsi.max_sampl_rate; 1254 + } 1253 1255 } 1254 1256 1255 1257 static inline unsigned long aux_sdb_index(struct aux_buffer *aux,
+14 -18
drivers/s390/crypto/zcrypt_msgtype6.c
··· 953 953 /* 954 954 * The request distributor calls this function if it picked the CEXxC 955 955 * device to handle a modexpo request. 956 + * This function assumes that ap_msg has been initialized with 957 + * ap_init_apmsg() and thus a valid buffer with the size of 958 + * ap_msg->bufsize is available within ap_msg. Also the caller has 959 + * to make sure ap_release_apmsg() is always called even on failure. 956 960 * @zq: pointer to zcrypt_queue structure that identifies the 957 961 * CEXxC device to the request distributor 958 962 * @mex: pointer to the modexpo request buffer ··· 968 964 struct ap_response_type *resp_type = &ap_msg->response; 969 965 int rc; 970 966 971 - ap_msg->msg = (void *)get_zeroed_page(GFP_KERNEL); 972 - if (!ap_msg->msg) 973 - return -ENOMEM; 974 - ap_msg->bufsize = PAGE_SIZE; 975 967 ap_msg->receive = zcrypt_msgtype6_receive; 976 968 ap_msg->psmid = (((unsigned long)current->pid) << 32) + 977 969 atomic_inc_return(&zcrypt_step); 978 970 rc = icamex_msg_to_type6mex_msgx(zq, ap_msg, mex); 979 971 if (rc) 980 - goto out_free; 972 + goto out; 981 973 resp_type->type = CEXXC_RESPONSE_TYPE_ICA; 982 974 init_completion(&resp_type->work); 983 975 rc = ap_queue_message(zq->queue, ap_msg); 984 976 if (rc) 985 - goto out_free; 977 + goto out; 986 978 rc = wait_for_completion_interruptible(&resp_type->work); 987 979 if (rc == 0) { 988 980 rc = ap_msg->rc; ··· 991 991 ap_cancel_message(zq->queue, ap_msg); 992 992 } 993 993 994 - out_free: 995 - free_page((unsigned long)ap_msg->msg); 996 - ap_msg->msg = NULL; 994 + out: 997 995 return rc; 998 996 } 999 997 1000 998 /* 1001 999 * The request distributor calls this function if it picked the CEXxC 1002 1000 * device to handle a modexpo_crt request. 1001 + * This function assumes that ap_msg has been initialized with 1002 + * ap_init_apmsg() and thus a valid buffer with the size of 1003 + * ap_msg->bufsize is available within ap_msg. Also the caller has 1004 + * to make sure ap_release_apmsg() is always called even on failure. 1003 1005 * @zq: pointer to zcrypt_queue structure that identifies the 1004 1006 * CEXxC device to the request distributor 1005 1007 * @crt: pointer to the modexpoc_crt request buffer ··· 1013 1011 struct ap_response_type *resp_type = &ap_msg->response; 1014 1012 int rc; 1015 1013 1016 - ap_msg->msg = (void *)get_zeroed_page(GFP_KERNEL); 1017 - if (!ap_msg->msg) 1018 - return -ENOMEM; 1019 - ap_msg->bufsize = PAGE_SIZE; 1020 1014 ap_msg->receive = zcrypt_msgtype6_receive; 1021 1015 ap_msg->psmid = (((unsigned long)current->pid) << 32) + 1022 1016 atomic_inc_return(&zcrypt_step); 1023 1017 rc = icacrt_msg_to_type6crt_msgx(zq, ap_msg, crt); 1024 1018 if (rc) 1025 - goto out_free; 1019 + goto out; 1026 1020 resp_type->type = CEXXC_RESPONSE_TYPE_ICA; 1027 1021 init_completion(&resp_type->work); 1028 1022 rc = ap_queue_message(zq->queue, ap_msg); 1029 1023 if (rc) 1030 - goto out_free; 1024 + goto out; 1031 1025 rc = wait_for_completion_interruptible(&resp_type->work); 1032 1026 if (rc == 0) { 1033 1027 rc = ap_msg->rc; ··· 1036 1038 ap_cancel_message(zq->queue, ap_msg); 1037 1039 } 1038 1040 1039 - out_free: 1040 - free_page((unsigned long)ap_msg->msg); 1041 - ap_msg->msg = NULL; 1041 + out: 1042 1042 return rc; 1043 1043 } 1044 1044