Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb0d10d9 authored by Blagovest Kolenichev's avatar Blagovest Kolenichev
Browse files

Merge android-4.14 (48a0bb1a) into msm-4.14



* refs/heads/tmp-48a0bb1a:
  Revert "tcp: free batches of packets in tcp_prune_ofo_queue()"
  Revert "f2fs: give message and set need_fsck given broken node id"
  ANDROID: sdcardfs: Check stacked filesystem depth
  ANDROID: keychord: Check for write data size
  ANDROID: verity: really fix android-verity Kconfig
  tcp: add tcp_ooo_try_coalesce() helper
  tcp: call tcp_drop() from tcp_data_queue_ofo()
  tcp: detect malicious patterns in tcp_collapse_ofo_queue()
  tcp: avoid collapses in tcp_prune_queue() if possible
  tcp: free batches of packets in tcp_prune_ofo_queue()

Change-Id: I4bb3069ba090f18bd109d7e27b424bca6609182c
Signed-off-by: default avatarBlagovest Kolenichev <bkolenichev@codeaurora.org>
parents 57c2bb95 2b1b38e5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -276,7 +276,7 @@ static ssize_t keychord_write(struct file *file, const char __user *buffer,
	size_t resid = count;
	size_t key_bytes;

	if (count < sizeof(struct input_keychord))
	if (count < sizeof(struct input_keychord) || count > PAGE_SIZE)
		return -EINVAL;
	keychords = kzalloc(count, GFP_KERNEL);
	if (!keychords)
+12 −1
Original line number Diff line number Diff line
@@ -1594,6 +1594,18 @@ static inline bool __exist_node_summaries(struct f2fs_sb_info *sbi)
			is_set_ckpt_flags(sbi, CP_FASTBOOT_FLAG));
}

/*
 * Check whether the given nid is within node id range.
 */
static inline int check_nid_range(struct f2fs_sb_info *sbi, nid_t nid)
{
	if (unlikely(nid < F2FS_ROOT_INO(sbi)))
		return -EINVAL;
	if (unlikely(nid >= NM_I(sbi)->max_nid))
		return -EINVAL;
	return 0;
}

/*
 * Check whether the inode has blocks or not
 */
@@ -2763,7 +2775,6 @@ f2fs_hash_t f2fs_dentry_hash(const struct qstr *name_info,
struct dnode_of_data;
struct node_info;

int check_nid_range(struct f2fs_sb_info *sbi, nid_t nid);
bool available_free_memory(struct f2fs_sb_info *sbi, int type);
int need_dentry_mark(struct f2fs_sb_info *sbi, nid_t nid);
bool is_checkpointed_node(struct f2fs_sb_info *sbi, nid_t nid);
+7 −6
Original line number Diff line number Diff line
@@ -264,8 +264,12 @@ static int do_read_inode(struct inode *inode)
	int err;

	/* Check if ino is within scope */
	if (check_nid_range(sbi, inode->i_ino))
	if (check_nid_range(sbi, inode->i_ino)) {
		f2fs_msg(inode->i_sb, KERN_ERR, "bad inode number: %lu",
			 (unsigned long) inode->i_ino);
		WARN_ON(1);
		return -EINVAL;
	}

	node_page = get_node_page(sbi, inode->i_ino);
	if (IS_ERR(node_page))
@@ -668,11 +672,8 @@ void f2fs_evict_inode(struct inode *inode)
		alloc_nid_failed(sbi, inode->i_ino);
		clear_inode_flag(inode, FI_FREE_NID);
	} else {
		/*
		 * If xattr nid is corrupted, we can reach out error condition,
		 * err & !exist_written_data(sbi, inode->i_ino, ORPHAN_INO)).
		 * In that case, check_nid_range() is enough to give a clue.
		 */
		f2fs_bug_on(sbi, err &&
			!exist_written_data(sbi, inode->i_ino, ORPHAN_INO));
	}
out_clear:
	fscrypt_put_encryption_info(inode);
+2 −19
Original line number Diff line number Diff line
@@ -29,21 +29,6 @@ static struct kmem_cache *nat_entry_slab;
static struct kmem_cache *free_nid_slab;
static struct kmem_cache *nat_entry_set_slab;

/*
 * Check whether the given nid is within node id range.
 */
int check_nid_range(struct f2fs_sb_info *sbi, nid_t nid)
{
	if (unlikely(nid < F2FS_ROOT_INO(sbi) || nid >= NM_I(sbi)->max_nid)) {
		set_sbi_flag(sbi, SBI_NEED_FSCK);
		f2fs_msg(sbi->sb, KERN_WARNING,
				"%s: out-of-range nid=%x, run fsck to fix.",
				__func__, nid);
		return -EINVAL;
	}
	return 0;
}

bool available_free_memory(struct f2fs_sb_info *sbi, int type)
{
	struct f2fs_nm_info *nm_i = NM_I(sbi);
@@ -1208,8 +1193,7 @@ void ra_node_page(struct f2fs_sb_info *sbi, nid_t nid)

	if (!nid)
		return;
	if (check_nid_range(sbi, nid))
		return;
	f2fs_bug_on(sbi, check_nid_range(sbi, nid));

	rcu_read_lock();
	apage = radix_tree_lookup(&NODE_MAPPING(sbi)->page_tree, nid);
@@ -1233,8 +1217,7 @@ static struct page *__get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid,

	if (!nid)
		return ERR_PTR(-ENOENT);
	if (check_nid_range(sbi, nid))
		return ERR_PTR(-EINVAL);
	f2fs_bug_on(sbi, check_nid_range(sbi, nid));
repeat:
	page = f2fs_grab_cache_page(NODE_MAPPING(sbi), nid, false);
	if (!page)