linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Drewek, Wojciech" <wojciech.drewek@intel.com>
To: Edward AD <twuufnxlz@gmail.com>,
	"syzbot+9704e6f099d952508943@syzkaller.appspotmail.com" 
	<syzbot+9704e6f099d952508943@syzkaller.appspotmail.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"reibax@gmail.com" <reibax@gmail.com>,
	"richardcochran@gmail.com" <richardcochran@gmail.com>,
	"syzkaller-bugs@googlegroups.com"
	<syzkaller-bugs@googlegroups.com>
Subject: RE: [PATCH] ptp: ptp_read should not release queue
Date: Mon, 23 Oct 2023 09:01:40 +0000	[thread overview]
Message-ID: <MW4PR11MB57763BDD2770028003988D8AFDD8A@MW4PR11MB5776.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20231023024622.323905-2-twuufnxlz@gmail.com>



> -----Original Message-----
> From: Edward AD <twuufnxlz@gmail.com>
> Sent: Monday, October 23, 2023 4:46 AM
> To: syzbot+9704e6f099d952508943@syzkaller.appspotmail.com
> Cc: davem@davemloft.net; linux-kernel@vger.kernel.org; netdev@vger.kernel.org; reibax@gmail.com; richardcochran@gmail.com;
> syzkaller-bugs@googlegroups.com
> Subject: [PATCH] ptp: ptp_read should not release queue
> 
> 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+9704e6f099d952508943@syzkaller.appspotmail.com
> Fixes: 8f5de6fb2453 ("ptp: support multiple timestamp event readers")
> Signed-off-by: Edward AD <twuufnxlz@gmail.com>

Hi Edward,

Consider adding a target to the subject: [PATCH net] in this case

> ---
>  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 282cd7d24077..27c1ef493617 100644
> --- a/drivers/ptp/ptp_chardev.c
> +++ b/drivers/ptp/ptp_chardev.c
> @@ -585,7 +585,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
> 


  reply	other threads:[~2023-10-23  9:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-22 18:37 [syzbot] [net?] KASAN: slab-use-after-free Read in ptp_read syzbot
2023-10-23  2:46 ` [PATCH] ptp: ptp_read should not release queue Edward AD
2023-10-23  9:01   ` Drewek, Wojciech [this message]
2023-10-23  9:55     ` [PATCH net] " Edward AD
2023-10-23 16:33       ` Jakub Kicinski
2023-10-24  0:34         ` Edward AD
2023-10-24  1:49           ` Jakub Kicinski
2023-10-23 16:32     ` [PATCH] " Jakub Kicinski
2023-12-10 21:38 ` [syzbot] [net?] KASAN: slab-use-after-free Read in ptp_read syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW4PR11MB57763BDD2770028003988D8AFDD8A@MW4PR11MB5776.namprd11.prod.outlook.com \
    --to=wojciech.drewek@intel.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=reibax@gmail.com \
    --cc=richardcochran@gmail.com \
    --cc=syzbot+9704e6f099d952508943@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=twuufnxlz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).