From d99618755c1cc4072a9ae228d1f98ca0d276dfc4 Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Sun, 24 Nov 2024 00:23:02 +0100 Subject: [PATCH] Revert "aoe: fix the potential use-after-free problem in more places" This reverts commit f90b29e234649c45e9192e97e7c5212a314a8596. --- drivers/block/aoe/aoecmd.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index 833ccf2cd..c805909c8 100755 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -362,7 +362,6 @@ ata_rw_frameinit(struct frame *f) } ah->cmdstat = ATA_CMD_PIO_READ | writebit | extbit; - dev_hold(t->ifp->nd); skb->dev = t->ifp->nd; } @@ -403,8 +402,6 @@ aoecmd_ata_rw(struct aoedev *d) __skb_queue_head_init(&queue); __skb_queue_tail(&queue, skb); aoenet_xmit(&queue); - } else { - dev_put(f->t->ifp->nd); } return 1; } @@ -487,13 +484,10 @@ resend(struct aoedev *d, struct frame *f) memcpy(h->dst, t->addr, sizeof h->dst); memcpy(h->src, t->ifp->nd->dev_addr, sizeof h->src); - dev_hold(t->ifp->nd); skb->dev = t->ifp->nd; skb = skb_clone(skb, GFP_ATOMIC); - if (skb == NULL) { - dev_put(t->ifp->nd); + if (skb == NULL) return; - } f->sent = ktime_get(); __skb_queue_head_init(&queue); __skb_queue_tail(&queue, skb); @@ -624,8 +618,6 @@ probe(struct aoetgt *t) __skb_queue_head_init(&queue); __skb_queue_tail(&queue, skb); aoenet_xmit(&queue); - } else { - dev_put(f->t->ifp->nd); } } @@ -1411,7 +1403,6 @@ aoecmd_ata_id(struct aoedev *d) ah->cmdstat = ATA_CMD_ID_ATA; ah->lba3 = 0xa0; - dev_hold(t->ifp->nd); skb->dev = t->ifp->nd; d->rttavg = RTTAVG_INIT; @@ -1421,8 +1412,6 @@ aoecmd_ata_id(struct aoedev *d) skb = skb_clone(skb, GFP_ATOMIC); if (skb) f->sent = ktime_get(); - else - dev_put(t->ifp->nd); return skb; }