Skip to content

Commit 380ef2c

Browse files
committed
Merge tag 'for-linus-20181214' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: "Three small fixes for this week. contains: - spectre indexing fix for aio (Jeff) - fix for the previous zeroing bio fix, we don't need it for user mapped pages, and in fact it breaks some applications if we do (Keith) - allocation failure fix for null_blk with zoned (Shin'ichiro)" * tag 'for-linus-20181214' of git://git.kernel.dk/linux-block: block: Fix null_blk_zoned creation failure with small number of zones aio: fix spectre gadget in lookup_ioctx block/bio: Do not zero user pages
2 parents 743e3c8 + 927b6b2 commit 380ef2c

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

block/bio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,8 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
12611261
if (ret)
12621262
goto cleanup;
12631263
} else {
1264-
zero_fill_bio(bio);
1264+
if (bmd->is_our_pages)
1265+
zero_fill_bio(bio);
12651266
iov_iter_advance(iter, bio->bi_iter.bi_size);
12661267
}
12671268

block/blk-zoned.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ static struct blk_zone *blk_alloc_zones(int node, unsigned int *nr_zones)
378378
struct page *page;
379379
int order;
380380

381-
for (order = get_order(size); order > 0; order--) {
381+
for (order = get_order(size); order >= 0; order--) {
382382
page = alloc_pages_node(node, GFP_NOIO | __GFP_ZERO, order);
383383
if (page) {
384384
*nr_zones = min_t(unsigned int, *nr_zones,

fs/aio.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
#include <asm/kmap_types.h>
4747
#include <linux/uaccess.h>
48+
#include <linux/nospec.h>
4849

4950
#include "internal.h"
5051

@@ -1038,6 +1039,7 @@ static struct kioctx *lookup_ioctx(unsigned long ctx_id)
10381039
if (!table || id >= table->nr)
10391040
goto out;
10401041

1042+
id = array_index_nospec(id, table->nr);
10411043
ctx = rcu_dereference(table->table[id]);
10421044
if (ctx && ctx->user_id == ctx_id) {
10431045
if (percpu_ref_tryget_live(&ctx->users))

0 commit comments

Comments
 (0)