Skip to content

Commit

Permalink
Merge tag 'for-linus-20181214' of git://git.kernel.dk/linux-block
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Linus Torvalds committed Dec 14, 2018
2 parents 743e3c8 + 927b6b2 commit 380ef2c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion block/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,8 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
if (ret)
goto cleanup;
} else {
zero_fill_bio(bio);
if (bmd->is_our_pages)
zero_fill_bio(bio);
iov_iter_advance(iter, bio->bi_iter.bi_size);
}

Expand Down
2 changes: 1 addition & 1 deletion block/blk-zoned.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ static struct blk_zone *blk_alloc_zones(int node, unsigned int *nr_zones)
struct page *page;
int order;

for (order = get_order(size); order > 0; order--) {
for (order = get_order(size); order >= 0; order--) {
page = alloc_pages_node(node, GFP_NOIO | __GFP_ZERO, order);
if (page) {
*nr_zones = min_t(unsigned int, *nr_zones,
Expand Down
2 changes: 2 additions & 0 deletions fs/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

#include <asm/kmap_types.h>
#include <linux/uaccess.h>
#include <linux/nospec.h>

#include "internal.h"

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

id = array_index_nospec(id, table->nr);
ctx = rcu_dereference(table->table[id]);
if (ctx && ctx->user_id == ctx_id) {
if (percpu_ref_tryget_live(&ctx->users))
Expand Down

0 comments on commit 380ef2c

Please sign in to comment.