Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions drivers/infiniband/sw/rxe/rxe_srq.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ int rxe_srq_from_init(struct rxe_dev *rxe, struct rxe_srq *srq,
return -ENOMEM;
}

srq->rq.queue = q;

err = do_mmap_info(rxe, uresp ? &uresp->mi : NULL, udata, q->buf,
q->buf_size, &q->ip);
if (err) {
Expand All @@ -119,6 +117,8 @@ int rxe_srq_from_init(struct rxe_dev *rxe, struct rxe_srq *srq,
}
}

srq->rq.queue = q;

return 0;
}

Expand Down
2 changes: 2 additions & 0 deletions net/ceph/messenger_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2191,7 +2191,9 @@ static int process_auth_done(struct ceph_connection *con, void *p, void *end)

ceph_decode_64_safe(&p, end, global_id, bad);
ceph_decode_32_safe(&p, end, con->v2.con_mode, bad);

ceph_decode_32_safe(&p, end, payload_len, bad);
ceph_decode_need(&p, end, payload_len, bad);

dout("%s con %p global_id %llu con_mode %d payload_len %d\n",
__func__, con, global_id, con->v2.con_mode, payload_len);
Expand Down
120 changes: 55 additions & 65 deletions net/ceph/osdmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,138 +790,126 @@ static int decode_pool(void **p, void *end, struct ceph_pg_pool_info *pi)
ceph_decode_need(p, end, len, bad);
pool_end = *p + len;

ceph_decode_need(p, end, 4 + 4 + 4, bad);
pi->type = ceph_decode_8(p);
pi->size = ceph_decode_8(p);
pi->crush_ruleset = ceph_decode_8(p);
pi->object_hash = ceph_decode_8(p);

pi->pg_num = ceph_decode_32(p);
pi->pgp_num = ceph_decode_32(p);

*p += 4 + 4; /* skip lpg* */
*p += 4; /* skip last_change */
*p += 8 + 4; /* skip snap_seq, snap_epoch */
/* lpg*, last_change, snap_seq, snap_epoch */
ceph_decode_skip_n(p, end, 8 + 4 + 8 + 4, bad);

/* skip snaps */
num = ceph_decode_32(p);
ceph_decode_32_safe(p, end, num, bad);
while (num--) {
*p += 8; /* snapid key */
*p += 1 + 1; /* versions */
len = ceph_decode_32(p);
*p += len;
/* snapid key, pool snap (with versions) */
ceph_decode_skip_n(p, end, 8 + 2, bad);
ceph_decode_skip_string(p, end, bad);
}

/* skip removed_snaps */
num = ceph_decode_32(p);
*p += num * (8 + 8);
/* removed_snaps */
ceph_decode_skip_map(p, end, 64, 64, bad);

ceph_decode_need(p, end, 8 + 8 + 4, bad);
*p += 8; /* skip auid */
pi->flags = ceph_decode_64(p);
*p += 4; /* skip crash_replay_interval */

if (ev >= 7)
pi->min_size = ceph_decode_8(p);
ceph_decode_8_safe(p, end, pi->min_size, bad);
else
pi->min_size = pi->size - pi->size / 2;

if (ev >= 8)
*p += 8 + 8; /* skip quota_max_* */
/* quota_max_* */
ceph_decode_skip_n(p, end, 8 + 8, bad);

if (ev >= 9) {
/* skip tiers */
num = ceph_decode_32(p);
*p += num * 8;
/* tiers */
ceph_decode_skip_set(p, end, 64, bad);

ceph_decode_need(p, end, 8 + 1 + 8 + 8, bad);
*p += 8; /* skip tier_of */
*p += 1; /* skip cache_mode */

pi->read_tier = ceph_decode_64(p);
pi->write_tier = ceph_decode_64(p);
} else {
pi->read_tier = -1;
pi->write_tier = -1;
}

if (ev >= 10) {
/* skip properties */
num = ceph_decode_32(p);
while (num--) {
len = ceph_decode_32(p);
*p += len; /* key */
len = ceph_decode_32(p);
*p += len; /* val */
}
}
if (ev >= 10)
/* properties */
ceph_decode_skip_map(p, end, string, string, bad);

if (ev >= 11) {
/* skip hit_set_params */
*p += 1 + 1; /* versions */
len = ceph_decode_32(p);
*p += len;
/* hit_set_params (with versions) */
ceph_decode_skip_n(p, end, 2, bad);
ceph_decode_skip_string(p, end, bad);

*p += 4; /* skip hit_set_period */
*p += 4; /* skip hit_set_count */
/* hit_set_period, hit_set_count */
ceph_decode_skip_n(p, end, 4 + 4, bad);
}

if (ev >= 12)
*p += 4; /* skip stripe_width */
/* stripe_width */
ceph_decode_skip_32(p, end, bad);

if (ev >= 13) {
*p += 8; /* skip target_max_bytes */
*p += 8; /* skip target_max_objects */
*p += 4; /* skip cache_target_dirty_ratio_micro */
*p += 4; /* skip cache_target_full_ratio_micro */
*p += 4; /* skip cache_min_flush_age */
*p += 4; /* skip cache_min_evict_age */
}
if (ev >= 13)
/* target_max_*, cache_target_*, cache_min_* */
ceph_decode_skip_n(p, end, 16 + 8 + 8, bad);

if (ev >= 14) {
/* skip erasure_code_profile */
len = ceph_decode_32(p);
*p += len;
}
if (ev >= 14)
/* erasure_code_profile */
ceph_decode_skip_string(p, end, bad);

/*
* last_force_op_resend_preluminous, will be overridden if the
* map was encoded with RESEND_ON_SPLIT
*/
if (ev >= 15)
pi->last_force_request_resend = ceph_decode_32(p);
ceph_decode_32_safe(p, end, pi->last_force_request_resend, bad);
else
pi->last_force_request_resend = 0;

if (ev >= 16)
*p += 4; /* skip min_read_recency_for_promote */
/* min_read_recency_for_promote */
ceph_decode_skip_32(p, end, bad);

if (ev >= 17)
*p += 8; /* skip expected_num_objects */
/* expected_num_objects */
ceph_decode_skip_64(p, end, bad);

if (ev >= 19)
*p += 4; /* skip cache_target_dirty_high_ratio_micro */
/* cache_target_dirty_high_ratio_micro */
ceph_decode_skip_32(p, end, bad);

if (ev >= 20)
*p += 4; /* skip min_write_recency_for_promote */
/* min_write_recency_for_promote */
ceph_decode_skip_32(p, end, bad);

if (ev >= 21)
*p += 1; /* skip use_gmt_hitset */
/* use_gmt_hitset */
ceph_decode_skip_8(p, end, bad);

if (ev >= 22)
*p += 1; /* skip fast_read */
/* fast_read */
ceph_decode_skip_8(p, end, bad);

if (ev >= 23) {
*p += 4; /* skip hit_set_grade_decay_rate */
*p += 4; /* skip hit_set_search_last_n */
}
if (ev >= 23)
/* hit_set_grade_decay_rate, hit_set_search_last_n */
ceph_decode_skip_n(p, end, 4 + 4, bad);

if (ev >= 24) {
/* skip opts */
*p += 1 + 1; /* versions */
len = ceph_decode_32(p);
*p += len;
/* opts (with versions) */
ceph_decode_skip_n(p, end, 2, bad);
ceph_decode_skip_string(p, end, bad);
}

if (ev >= 25)
pi->last_force_request_resend = ceph_decode_32(p);
ceph_decode_32_safe(p, end, pi->last_force_request_resend, bad);

/* ignore the rest */

Expand Down Expand Up @@ -1971,11 +1959,13 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end, bool msgr2,
sizeof(u64) + sizeof(u32), e_inval);
ceph_decode_copy(p, &fsid, sizeof(fsid));
epoch = ceph_decode_32(p);
BUG_ON(epoch != map->epoch+1);
ceph_decode_copy(p, &modified, sizeof(modified));
new_pool_max = ceph_decode_64(p);
new_flags = ceph_decode_32(p);

if (epoch != map->epoch + 1)
goto e_inval;

/* full map? */
ceph_decode_32_safe(p, end, len, e_inval);
if (len > 0) {
Expand Down
2 changes: 2 additions & 0 deletions net/netfilter/nf_conntrack_h323_asn1.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,8 @@ int DecodeQ931(unsigned char *buf, size_t sz, Q931 *q931)
break;
p++;
len--;
if (len <= 0)
break;
return DecodeH323_UserInformation(buf, p, len,
&q931->UUIE);
}
Expand Down
10 changes: 7 additions & 3 deletions net/sched/sch_hfsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ eltree_insert(struct hfsc_class *cl)
static inline void
eltree_remove(struct hfsc_class *cl)
{
rb_erase(&cl->el_node, &cl->sched->eligible);
if (!RB_EMPTY_NODE(&cl->el_node)) {
rb_erase(&cl->el_node, &cl->sched->eligible);
RB_CLEAR_NODE(&cl->el_node);
}
}

static inline void
Expand Down Expand Up @@ -751,7 +754,7 @@ update_vf(struct hfsc_class *cl, unsigned int len, u64 cur_time)
u64 f; /* , myf_bound, delta; */
int go_passive = 0;

if (cl->qdisc->q.qlen == 0 && cl->cl_flags & HFSC_FSC)
if (cl->qdisc->q.qlen == 0 && cl->cl_flags & HFSC_FSC && cl->cl_nactive)
go_passive = 1;

for (; cl->cl_parent != NULL; cl = cl->cl_parent) {
Expand Down Expand Up @@ -1231,7 +1234,8 @@ hfsc_qlen_notify(struct Qdisc *sch, unsigned long arg)
/* vttree is now handled in update_vf() so that update_vf(cl, 0, 0)
* needs to be called explicitly to remove a class from vttree.
*/
update_vf(cl, 0, 0);
if (cl->cl_nactive)
update_vf(cl, 0, 0);
if (cl->cl_flags & HFSC_RSC)
eltree_remove(cl);
}
Expand Down
9 changes: 9 additions & 0 deletions net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -2017,6 +2017,15 @@ static int sctp_sendmsg(struct sock *sk, struct msghdr *msg, size_t msg_len)
goto out_unlock;

iov_iter_revert(&msg->msg_iter, err);

/* sctp_sendmsg_to_asoc() may have released the socket
* lock (sctp_wait_for_sndbuf), during which other
* associations on ep->asocs could have been peeled
* off or freed. @asoc itself is revalidated by the
* base.dead and base.sk checks in sctp_wait_for_sndbuf,
* so re-derive the cached cursor from it.
*/
tmp = list_next_entry(asoc, asocs);
}

goto out_unlock;
Expand Down
Loading