diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/power/swap.c | 5 | ||||
-rw-r--r-- | kernel/printk.c | 15 | ||||
-rw-r--r-- | kernel/trace/blktrace.c | 12 |
3 files changed, 23 insertions, 9 deletions
diff --git a/kernel/power/swap.c b/kernel/power/swap.c index a0e4a86ccf94..b019609d1b45 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c | |||
@@ -223,7 +223,7 @@ static int swsusp_swap_check(void) | |||
223 | return res; | 223 | return res; |
224 | 224 | ||
225 | root_swap = res; | 225 | root_swap = res; |
226 | res = blkdev_get(hib_resume_bdev, FMODE_WRITE); | 226 | res = blkdev_get(hib_resume_bdev, FMODE_WRITE, NULL); |
227 | if (res) | 227 | if (res) |
228 | return res; | 228 | return res; |
229 | 229 | ||
@@ -907,7 +907,8 @@ int swsusp_check(void) | |||
907 | { | 907 | { |
908 | int error; | 908 | int error; |
909 | 909 | ||
910 | hib_resume_bdev = open_by_devnum(swsusp_resume_device, FMODE_READ); | 910 | hib_resume_bdev = blkdev_get_by_dev(swsusp_resume_device, |
911 | FMODE_READ, NULL); | ||
911 | if (!IS_ERR(hib_resume_bdev)) { | 912 | if (!IS_ERR(hib_resume_bdev)) { |
912 | set_blocksize(hib_resume_bdev, PAGE_SIZE); | 913 | set_blocksize(hib_resume_bdev, PAGE_SIZE); |
913 | clear_page(swsusp_header); | 914 | clear_page(swsusp_header); |
diff --git a/kernel/printk.c b/kernel/printk.c index 38e7d5868d60..9a2264fc42ca 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -274,7 +274,20 @@ int do_syslog(int type, char __user *buf, int len, bool from_file) | |||
274 | char c; | 274 | char c; |
275 | int error = 0; | 275 | int error = 0; |
276 | 276 | ||
277 | error = security_syslog(type, from_file); | 277 | /* |
278 | * If this is from /proc/kmsg we only do the capabilities checks | ||
279 | * at open time. | ||
280 | */ | ||
281 | if (type == SYSLOG_ACTION_OPEN || !from_file) { | ||
282 | if (dmesg_restrict && !capable(CAP_SYS_ADMIN)) | ||
283 | return -EPERM; | ||
284 | if ((type != SYSLOG_ACTION_READ_ALL && | ||
285 | type != SYSLOG_ACTION_SIZE_BUFFER) && | ||
286 | !capable(CAP_SYS_ADMIN)) | ||
287 | return -EPERM; | ||
288 | } | ||
289 | |||
290 | error = security_syslog(type); | ||
278 | if (error) | 291 | if (error) |
279 | return error; | 292 | return error; |
280 | 293 | ||
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 7b8ec0281548..2b8e2ee7c0ef 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c | |||
@@ -887,7 +887,7 @@ static void blk_add_trace_split(void *ignore, | |||
887 | } | 887 | } |
888 | 888 | ||
889 | /** | 889 | /** |
890 | * blk_add_trace_remap - Add a trace for a remap operation | 890 | * blk_add_trace_bio_remap - Add a trace for a bio-remap operation |
891 | * @ignore: trace callback data parameter (not used) | 891 | * @ignore: trace callback data parameter (not used) |
892 | * @q: queue the io is for | 892 | * @q: queue the io is for |
893 | * @bio: the source bio | 893 | * @bio: the source bio |
@@ -899,9 +899,9 @@ static void blk_add_trace_split(void *ignore, | |||
899 | * it spans a stripe (or similar). Add a trace for that action. | 899 | * it spans a stripe (or similar). Add a trace for that action. |
900 | * | 900 | * |
901 | **/ | 901 | **/ |
902 | static void blk_add_trace_remap(void *ignore, | 902 | static void blk_add_trace_bio_remap(void *ignore, |
903 | struct request_queue *q, struct bio *bio, | 903 | struct request_queue *q, struct bio *bio, |
904 | dev_t dev, sector_t from) | 904 | dev_t dev, sector_t from) |
905 | { | 905 | { |
906 | struct blk_trace *bt = q->blk_trace; | 906 | struct blk_trace *bt = q->blk_trace; |
907 | struct blk_io_trace_remap r; | 907 | struct blk_io_trace_remap r; |
@@ -1016,7 +1016,7 @@ static void blk_register_tracepoints(void) | |||
1016 | WARN_ON(ret); | 1016 | WARN_ON(ret); |
1017 | ret = register_trace_block_split(blk_add_trace_split, NULL); | 1017 | ret = register_trace_block_split(blk_add_trace_split, NULL); |
1018 | WARN_ON(ret); | 1018 | WARN_ON(ret); |
1019 | ret = register_trace_block_remap(blk_add_trace_remap, NULL); | 1019 | ret = register_trace_block_bio_remap(blk_add_trace_bio_remap, NULL); |
1020 | WARN_ON(ret); | 1020 | WARN_ON(ret); |
1021 | ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL); | 1021 | ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL); |
1022 | WARN_ON(ret); | 1022 | WARN_ON(ret); |
@@ -1025,7 +1025,7 @@ static void blk_register_tracepoints(void) | |||
1025 | static void blk_unregister_tracepoints(void) | 1025 | static void blk_unregister_tracepoints(void) |
1026 | { | 1026 | { |
1027 | unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL); | 1027 | unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL); |
1028 | unregister_trace_block_remap(blk_add_trace_remap, NULL); | 1028 | unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL); |
1029 | unregister_trace_block_split(blk_add_trace_split, NULL); | 1029 | unregister_trace_block_split(blk_add_trace_split, NULL); |
1030 | unregister_trace_block_unplug_io(blk_add_trace_unplug_io, NULL); | 1030 | unregister_trace_block_unplug_io(blk_add_trace_unplug_io, NULL); |
1031 | unregister_trace_block_unplug_timer(blk_add_trace_unplug_timer, NULL); | 1031 | unregister_trace_block_unplug_timer(blk_add_trace_unplug_timer, NULL); |