[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZUWoyxIgl6vDFsjp@hoboy.vegasvil.org>
Date:   Fri, 3 Nov 2023 19:13:31 -0700
From:   Richard Cochran <richardcochran@...il.com>
To:     Jeremy Cline <jeremy@...ine.org>
Cc:     Edward Adam Davis <eadavis@...com>, habetsm.xilinx@...il.com,
        davem@...emloft.net, linux-kernel@...r.kernel.org,
        netdev@...r.kernel.org, reibax@...il.com,
        syzbot+df3f3ef31f60781fa911@...kaller.appspotmail.com,
        syzkaller-bugs@...glegroups.com
Subject: Re: [PATCH net-next V2] ptp: fix corrupted list in ptp_open
On Thu, Nov 02, 2023 at 02:16:54PM -0400, Jeremy Cline wrote:
> While this patch looks to cover adding and removing items from the list,
> the code that iterates over the list isn't covered which can be
> problematic. If the list is modified while it is being iterated, the
> iterating code could chase an invalid pointer.
Indeed.
See ptp_clock.c:
 416         case PTP_CLOCK_EXTTS:
 417                 /* Enqueue timestamp on selected queues */
 418                 list_for_each_entry(tsevq, &ptp->tsevqs, qlist) {
 419                         if (test_bit((unsigned int)event->index, tsevq->mask))
 420                                 enqueue_external_timestamp(tsevq, event);
 421                 }
 422                 wake_up_interruptible(&ptp->tsev_wq);
 423                 break;
Thanks,
Richard
Powered by blists - more mailing lists