All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next V8 1/2] ptp: ptp_read should not release queue
@ 2023-11-06 14:31 Edward Adam Davis
  2023-11-07  6:13 ` Richard Cochran
  0 siblings, 1 reply; 2+ messages in thread
From: Edward Adam Davis @ 2023-11-06 14:31 UTC (permalink / raw)
  To: richardcochran
  Cc: davem, eadavis, habetsm.xilinx, jeremy, linux-kernel, netdev,
	reibax, syzbot+df3f3ef31f60781fa911

Firstly, queue is not the memory allocated in ptp_read;
Secondly, other processes may block at ptp_read and wait for conditions to be
met to perform read operations.

Reported-and-tested-by: syzbot+df3f3ef31f60781fa911@syzkaller.appspotmail.com
Fixes: 8f5de6fb2453 ("ptp: support multiple timestamp event readers")
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
---
 drivers/ptp/ptp_chardev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
index 473b6d992507..3f7a74788802 100644
--- a/drivers/ptp/ptp_chardev.c
+++ b/drivers/ptp/ptp_chardev.c
@@ -588,7 +588,5 @@ ssize_t ptp_read(struct posix_clock_context *pccontext, uint rdflags,
 free_event:
 	kfree(event);
 exit:
-	if (result < 0)
-		ptp_release(pccontext);
 	return result;
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next V8 1/2] ptp: ptp_read should not release queue
  2023-11-06 14:31 [PATCH net-next V8 1/2] ptp: ptp_read should not release queue Edward Adam Davis
@ 2023-11-07  6:13 ` Richard Cochran
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Cochran @ 2023-11-07  6:13 UTC (permalink / raw)
  To: Edward Adam Davis
  Cc: davem, habetsm.xilinx, jeremy, linux-kernel, netdev, reibax,
	syzbot+df3f3ef31f60781fa911

On Mon, Nov 06, 2023 at 10:31:27PM +0800, Edward Adam Davis wrote:
> Firstly, queue is not the memory allocated in ptp_read;
> Secondly, other processes may block at ptp_read and wait for conditions to be
> met to perform read operations.
> 
> Reported-and-tested-by: syzbot+df3f3ef31f60781fa911@syzkaller.appspotmail.com
> Fixes: 8f5de6fb2453 ("ptp: support multiple timestamp event readers")
> Signed-off-by: Edward Adam Davis <eadavis@qq.com>

(This should go to net and not net-next.)

Acked-by: Richard Cochran <richardcochran@gmail.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-07  6:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-06 14:31 [PATCH net-next V8 1/2] ptp: ptp_read should not release queue Edward Adam Davis
2023-11-07  6:13 ` Richard Cochran

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.