public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shreenidhi Shedi <yesshedi@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: arnd@arndb.de, Shreenidhi Shedi <sshedi@vmware.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] char: lp: ensure that index has not exceeded LP_NO
Date: Fri, 3 Jun 2022 18:19:24 +0530	[thread overview]
Message-ID: <a2a85252-685f-d0d7-100d-96be014879a2@gmail.com> (raw)
In-Reply-To: <YpoCIS1HVft8MbmB@kroah.com>

On 03/06/22 6:14 pm, Greg KH wrote:
> On Fri, Jun 03, 2022 at 05:32:25PM +0530, Shreenidhi Shedi wrote:
>> On 03/06/22 5:27 pm, Shreenidhi Shedi wrote:
>>> On 15/05/22 1:24 pm, Shreenidhi Shedi wrote:
>>>> After finishing the loop, index value can be equal to LP_NO and lp_table
>>>> array is of size LP_NO, so this can end up in accessing an out of bound
>>>> address in lp_register function.
>>>>
>>>> Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
>>>> ---
>>>>  drivers/char/lp.c | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/char/lp.c b/drivers/char/lp.c
>>>> index bd95aba1f..e61060f3c 100644
>>>> --- a/drivers/char/lp.c
>>>> +++ b/drivers/char/lp.c
>>>> @@ -971,7 +971,7 @@ static void lp_attach(struct parport *port)
>>>>  			if (port_num[i] == -1)
>>>>  				break;
>>>>  
>>>> -		if (!lp_register(i, port))
>>>> +		if (i < LP_NO && !lp_register(i, port))
>>>>  			lp_count++;
>>>>  		break;
>>>>  
>>>
>>> Hi Greg and Arnd Bergmann,
>>>
>>> Please review the above changes. Ignore second patch.
>>>
>>> --
>>> Shedi
>>
>> Sorry, not the second patch. Ignore the 3rd patch which fixes checkspec.pl warnings.
> 
> I have no way to do that, please fix up and resend the correct series,
> our tools can not pick and choose from a series easily.
> 
> Also remember this is the middle of the merge window and we can not do
> anything at the moment.
> 
> greg k-h

No problem, I will send a new patch series with only intended fixes.
It's okay, take the patch when the time is right. Thanks for your prompt response and your time.
 
--
Shedi

      reply	other threads:[~2022-06-03 12:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-15  7:54 [PATCH 1/3] char: lp: ensure that index has not exceeded LP_NO Shreenidhi Shedi
2022-05-15  7:54 ` [PATCH 2/3] char: lp: remove redundant initialization of err Shreenidhi Shedi
2022-05-15  8:08   ` Greg KH
2022-05-15  7:54 ` [PATCH 3/3] char: lp: fix most of checkspec.pl warnings & errors Shreenidhi Shedi
2022-05-15  8:08   ` Greg KH
2022-05-15  8:07 ` [PATCH 1/3] char: lp: ensure that index has not exceeded LP_NO Greg KH
2022-06-03 11:57 ` Shreenidhi Shedi
2022-06-03 12:02   ` Shreenidhi Shedi
2022-06-03 12:44     ` Greg KH
2022-06-03 12:49       ` Shreenidhi Shedi [this message]

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=a2a85252-685f-d0d7-100d-96be014879a2@gmail.com \
    --to=yesshedi@gmail.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sshedi@vmware.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