Skip to content

Commit

Permalink
irda: fix a potential use-after-free in ircomm_param_request
Browse files Browse the repository at this point in the history
self->ctrl_skb is protected by self->spinlock, we should not
access it out of the lock. Move the debugging printk inside.

Reported-by: Dmitry Vyukov <[email protected]>
Cc: Samuel Ortiz <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
congwang authored and davem330 committed Jan 30, 2016
1 parent ae9d723 commit 3d45296
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/irda/ircomm/ircomm_param.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,10 @@ int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush)
return -1;
}
skb_put(skb, count);
pr_debug("%s(), skb->len=%d\n", __func__, skb->len);

spin_unlock_irqrestore(&self->spinlock, flags);

pr_debug("%s(), skb->len=%d\n", __func__ , skb->len);

if (flush) {
/* ircomm_tty_do_softint will take care of the rest */
schedule_work(&self->tqueue);
Expand Down

0 comments on commit 3d45296

Please sign in to comment.