All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Starke, Daniel" <daniel.starke@siemens.com>
To: Mazin Al Haddad <mazinalhaddad05@gmail.com>
Cc: "jirislaby@kernel.org" <jirislaby@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-kernel-mentees@lists.linuxfoundation.org" 
	<linux-kernel-mentees@lists.linuxfoundation.org>,
	"skhan@linuxfoundation.org" <skhan@linuxfoundation.org>,
	"paskripkin@gmail.com" <paskripkin@gmail.com>,
	"syzbot+e3563f0c94e188366dbb@syzkaller.appspotmail.com" 
	<syzbot+e3563f0c94e188366dbb@syzkaller.appspotmail.com>,
	Greg KH <gregkh@linuxfoundation.org>
Subject: RE: [PATCH] tty: n_gsm: fix missing assignment of gsm->receive() in gsmld_attach_gsm()
Date: Wed, 10 Aug 2022 09:08:13 +0000	[thread overview]
Message-ID: <DB9PR10MB58813E33D3516BAB526156B1E0659@DB9PR10MB5881.EURPRD10.PROD.OUTLOOK.COM> (raw)

> Fix this by setting the gsm->receive() function when the line 
> discipline is being attached to the terminal device, inside 
> gsmld_attach_gsm(). This will guarantee that the function is assigned 
> and a call to TIOCSTI, which calls gsmld_receive_buf(), will not
> reference a null pointer.

In my opinion there are only two possible ways to fix this:
a) Move the gsm->receive initialization from gsm_activate_mux() to
gsmld_attach_gsm().
b) Avoid calling gsm->receive in gsmld_receive_buf() if not initialized.

The current code might assume that gsm->receive is only called after MUX
activation. Therefore, variant a) may break the code in other places.
I see no need to initialize gsm->receive in gsm_activate_mux() and
gsmld_attach_gsm().

Best regards,
Daniel Starke

WARNING: multiple messages have this Message-ID (diff)
From: "Starke, Daniel" <daniel.starke@siemens.com>
To: Mazin Al Haddad <mazinalhaddad05@gmail.com>
Cc: "jirislaby@kernel.org" <jirislaby@kernel.org>,
	"paskripkin@gmail.com" <paskripkin@gmail.com>,
	"syzbot+e3563f0c94e188366dbb@syzkaller.appspotmail.com"
	<syzbot+e3563f0c94e188366dbb@syzkaller.appspotmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-kernel-mentees@lists.linuxfoundation.org"
	<linux-kernel-mentees@lists.linuxfoundation.org>
Subject: RE: [PATCH] tty: n_gsm: fix missing assignment of gsm->receive() in gsmld_attach_gsm()
Date: Wed, 10 Aug 2022 09:08:13 +0000	[thread overview]
Message-ID: <DB9PR10MB58813E33D3516BAB526156B1E0659@DB9PR10MB5881.EURPRD10.PROD.OUTLOOK.COM> (raw)

> Fix this by setting the gsm->receive() function when the line 
> discipline is being attached to the terminal device, inside 
> gsmld_attach_gsm(). This will guarantee that the function is assigned 
> and a call to TIOCSTI, which calls gsmld_receive_buf(), will not
> reference a null pointer.

In my opinion there are only two possible ways to fix this:
a) Move the gsm->receive initialization from gsm_activate_mux() to
gsmld_attach_gsm().
b) Avoid calling gsm->receive in gsmld_receive_buf() if not initialized.

The current code might assume that gsm->receive is only called after MUX
activation. Therefore, variant a) may break the code in other places.
I see no need to initialize gsm->receive in gsm_activate_mux() and
gsmld_attach_gsm().

Best regards,
Daniel Starke
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

             reply	other threads:[~2022-08-10  9:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10  9:08 Starke, Daniel [this message]
2022-08-10  9:08 ` [PATCH] tty: n_gsm: fix missing assignment of gsm->receive() in gsmld_attach_gsm() Starke, Daniel
2022-08-12 19:41 ` Mazin Al Haddad
2022-08-12 19:41   ` Mazin Al Haddad
  -- strict thread matches above, loose matches on Subject: below --
2022-08-10  3:12 Mazin Al Haddad
2022-08-10  3:12 ` Mazin Al Haddad
2022-08-10  5:18 ` Greg KH
2022-08-10  5:18   ` Greg KH

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=DB9PR10MB58813E33D3516BAB526156B1E0659@DB9PR10MB5881.EURPRD10.PROD.OUTLOOK.COM \
    --to=daniel.starke@siemens.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mazinalhaddad05@gmail.com \
    --cc=paskripkin@gmail.com \
    --cc=skhan@linuxfoundation.org \
    --cc=syzbot+e3563f0c94e188366dbb@syzkaller.appspotmail.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 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.