netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Schmidt <mschmidt@redhat.com>
To: "Mintz, Yuval" <Yuval.Mintz@cavium.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: "Elior, Ariel" <Ariel.Elior@cavium.com>
Subject: Re: [PATCH net 1/7] bnx2x: prevent crash when accessing PTP with interface down
Date: Mon, 6 Mar 2017 15:04:22 +0100	[thread overview]
Message-ID: <1af37eff-26dd-8f3f-5f2e-ec2ab39055a3@redhat.com> (raw)
In-Reply-To: <BL2PR07MB23062D54948BD583E2B7D7318D2D0@BL2PR07MB2306.namprd07.prod.outlook.com>

Dne 5.3.2017 v 10:43 Mintz, Yuval napsal(a):
>> It is possible to crash the kernel by accessing a PTP device while its
>> associated bnx2x interface is down. Before the interface is brought up, the
>> timecounter is not initialized, so accessing it results in NULL dereference.
>>
>> Fix it by checking if the interface is up.
>>
>> Use -ENETDOWN as the error code when the interface is down.
>>  -EFAULT in bnx2x_ptp_adjfreq() did not seem right.
>>
>> Tested using phc_ctl get/set/adj/freq commands.
>>
>> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
>
> While I have no objections to the patch contents, does it even make
> sense to try adjusting frequencies on a DOWNed interface?
> Wouldn't it make more sense checking this in the calling context
> Instead?

The caller does not know. A PTP device is not necessarily associated 
with a net device.

Michal

  reply	other threads:[~2017-03-06 14:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03 16:08 [PATCH net 0/7] bnx2x: PTP crash, VF VLAN fixes Michal Schmidt
2017-03-03 16:08 ` [PATCH net 1/7] bnx2x: prevent crash when accessing PTP with interface down Michal Schmidt
2017-03-05  9:43   ` Mintz, Yuval
2017-03-06 14:04     ` Michal Schmidt [this message]
2017-03-03 16:08 ` [PATCH net 2/7] bnx2x: lower verbosity of VF stats debug messages Michal Schmidt
2017-03-03 16:08 ` [PATCH net 3/7] bnx2x: fix possible overrun of VFPF multicast addresses array Michal Schmidt
2017-03-05  9:55   ` Mintz, Yuval
2017-03-06 14:45     ` [PATCH net 3/7 v2] " Michal Schmidt
2017-03-07 15:54       ` Mintz, Yuval
2017-03-03 16:08 ` [PATCH net 4/7] bnx2x: fix detection of VLAN filtering feature for VF Michal Schmidt
2017-03-03 16:08 ` [PATCH net 5/7] bnx2x: do not rollback VF MAC/VLAN filters we did not configure Michal Schmidt
2017-03-05 10:13   ` Mintz, Yuval
2017-03-06 14:05     ` Michal Schmidt
2017-03-03 16:08 ` [PATCH net 6/7] bnx2x: fix incorrect filter count in an error message Michal Schmidt
2017-03-03 16:08 ` [PATCH net 7/7] bnx2x: add missing configuration of VF VLAN filters Michal Schmidt
2017-03-05 10:17 ` [PATCH net 0/7] bnx2x: PTP crash, VF VLAN fixes Mintz, Yuval
2017-03-07 21:53 ` David Miller

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=1af37eff-26dd-8f3f-5f2e-ec2ab39055a3@redhat.com \
    --to=mschmidt@redhat.com \
    --cc=Ariel.Elior@cavium.com \
    --cc=Yuval.Mintz@cavium.com \
    --cc=netdev@vger.kernel.org \
    /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).