netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: Paolo Abeni <pabeni@redhat.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Leon Romanovsky <leon@kernel.org>
Cc: <davem@davemloft.net>, <kuba@kernel.org>, <edumazet@google.com>,
	<netdev@vger.kernel.org>,
	Andrii Staikov <andrii.staikov@intel.com>,
	"Sunitha Mekala" <sunithax.d.mekala@intel.com>
Subject: Re: [PATCH net 1/1] i40e: fix PTP pins verification
Date: Fri, 28 Apr 2023 09:31:10 -0700	[thread overview]
Message-ID: <024700ef-f0a8-aa1e-c950-213767cd80cd@intel.com> (raw)
In-Reply-To: <f525d5b887888f6c00633d4187836da0fb31f2cf.camel@redhat.com>



On 4/27/2023 3:24 AM, Paolo Abeni wrote:
> On Wed, 2023-04-26 at 06:52 -0700, Richard Cochran wrote:
>> On Wed, Apr 26, 2023 at 10:18:12AM +0300, Leon Romanovsky wrote:
>>> On Tue, Apr 25, 2023 at 10:04:06AM -0700, Tony Nguyen wrote:
>>>> From: Andrii Staikov <andrii.staikov@intel.com>
>>>>
>>>> Fix PTP pins verification not to contain tainted arguments. As a new PTP
>>>> pins configuration is provided by a user, it may contain tainted
>>>> arguments that are out of bounds for the list of possible values that can
>>>> lead to a potential security threat. Change pin's state name from 'invalid'
>>>> to 'empty' for more clarification.
>>>
>>> And why isn't this handled in upper layer which responsible to get
>>> user input?
>>
>> It is.
>>
>> long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
>> {
>> 	...
>>
>> 	switch (cmd) {
>>
>> 	case PTP_PIN_SETFUNC:
>> 	case PTP_PIN_SETFUNC2:
>> 		if (copy_from_user(&pd, (void __user *)arg, sizeof(pd))) {
>> 			err = -EFAULT;
>> 			break;
>> 		}
>> 		...
>>
>> 		pin_index = pd.index;
>> 		if (pin_index >= ops->n_pins) {
>> 			err = -EINVAL;
>> 			break;
>> 		}
>>
>> 		...
>> 	}
>> 	...
>> }
> 
> Given the above, I don't see why/how this patch is necessary? @Tony,
> @Andrii: could you please give a better/longer description of the issue
> addressed here?

I'm not sure about the issue details; Andrii please chime in.

Thanks,
Tony

  reply	other threads:[~2023-04-28 16:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25 17:04 [PATCH net 1/1] i40e: fix PTP pins verification Tony Nguyen
2023-04-26  7:18 ` Leon Romanovsky
2023-04-26 13:52   ` Richard Cochran
2023-04-27 10:24     ` Paolo Abeni
2023-04-28 16:31       ` Tony Nguyen [this message]
2023-05-04 11:12       ` Staikov, Andrii
2023-05-04 20:50         ` Richard Cochran

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=024700ef-f0a8-aa1e-c950-213767cd80cd@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=andrii.staikov@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=sunithax.d.mekala@intel.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).