commit a3acc696085e112733d191a77b106e67a4fa110b upstream.
The specification says that the Reserved1 field in OS_DESC_EXT_COMPAT
must have the value "1", but when this feature was first implemented we
rejected any non-zero values.
This was adjusted to accept all non-zero values (while now rejecting
zero) in commit 53642399aa71 ("usb: gadget: f_fs: Fix wrong check on
reserved1 of OS_DESC_EXT_COMPAT"), but that breaks any userspace
programs that worked previously by returning EINVAL when Reserved1 == 0
which was previously the only value that succeeded!
If we just set the field to "1" ourselves, both old and new userspace
programs continue to work correctly and, as a bonus, old programs are
now compliant with the specification without having to fix anything
themselves.
Fixes: 53642399aa71 ("usb: gadget: f_fs: Fix wrong check on reserved1 of OS_DESC_EXT_COMPAT")
Cc: <stable(a)vger.kernel.org>
Signed-off-by: John Keeping <john(a)metanate.com>
Signed-off-by: Felipe Balbi <felipe.balbi(a)linux.intel.com>
---
drivers/usb/gadget/function/f_fs.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index 4fce83266926..346a630cebd5 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -2262,9 +2262,18 @@ static int __ffs_data_do_os_desc(enum ffs_os_desc_type type,
int i;
if (len < sizeof(*d) ||
- d->bFirstInterfaceNumber >= ffs->interfaces_count ||
- d->Reserved1)
+ d->bFirstInterfaceNumber >= ffs->interfaces_count)
return -EINVAL;
+ if (d->Reserved1 != 1) {
+ /*
+ * According to the spec, Reserved1 must be set to 1
+ * but older kernels incorrectly rejected non-zero
+ * values. We fix it here to avoid returning EINVAL
+ * in response to values we used to accept.
+ */
+ pr_debug("usb_ext_compat_desc::Reserved1 forced to 1\n");
+ d->Reserved1 = 1;
+ }
for (i = 0; i < ARRAY_SIZE(d->Reserved2); ++i)
if (d->Reserved2[i])
return -EINVAL;
--
2.15.1
This is the start of the stable review cycle for the 4.4.105 release.
There are 49 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sat Dec 9 12:46:41 UTC 2017.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.105-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.4.105-rc1
Colin Ian King <colin.king(a)canonical.com>
usb: host: fix incorrect updating of offset
Oliver Neukum <oneukum(a)suse.com>
USB: usbfs: Filter flags passed in from user space
Dan Carpenter <dan.carpenter(a)oracle.com>
USB: devio: Prevent integer overflow in proc_do_submiturb()
Mateusz Berezecki <mateuszb(a)fastmail.fm>
USB: Increase usbfs transfer limit
Masakazu Mokuno <masakazu.mokuno(a)gmail.com>
USB: core: Add type-specific length check of BOS descriptors
John Youn <John.Youn(a)synopsys.com>
usb: ch9: Add size macro for SSP dev cap descriptor
Mathias Nyman <mathias.nyman(a)linux.intel.com>
usb: Add USB 3.1 Precision time measurement capability descriptor support
Yu Chen <chenyu56(a)huawei.com>
usb: xhci: fix panic in xhci_free_virt_devices_depth_first
Mike Looijmans <mike.looijmans(a)topic.nl>
usb: hub: Cycle HUB power when initialization fails
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "ocfs2: should wait dio before inode lock in ocfs2_setattr()"
Rui Sousa <rui.sousa(a)nxp.com>
net: fec: fix multicast filtering hardware setup
Ross Lagerwall <ross.lagerwall(a)citrix.com>
xen-netfront: Improve error handling during initialization
Jan Kara <jack(a)suse.cz>
mm: avoid returning VM_FAULT_RETRY from ->page_mkwrite handlers
Jason Baron <jbaron(a)akamai.com>
tcp: correct memory barrier usage in tcp_check_space()
Iago Abal <mail(a)iagoabal.eu>
dmaengine: pl330: fix double lock
Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan(a)ericsson.com>
tipc: fix cleanup at module unload
Colin Ian King <colin.king(a)canonical.com>
net: sctp: fix array overrun read on sctp_timer_tbl
Andrzej Hajda <a.hajda(a)samsung.com>
drm/exynos/decon5433: set STANDALONE_UPDATE_F on output enablement
Trond Myklebust <trond.myklebust(a)primarydata.com>
NFSv4: Fix client recovery when server reboots multiple times
Christoffer Dall <christoffer.dall(a)linaro.org>
KVM: arm/arm64: Fix occasional warning from the timer work function
Benjamin Coddington <bcodding(a)redhat.com>
nfs: Don't take a reference on fl->fl_file for LOCK operation
Kazuya Mizuguchi <kazuya.mizuguchi.ks(a)renesas.com>
ravb: Remove Rx overflow log messages
Vlad Tsyrklevich <vlad(a)tsyrklevich.net>
net/appletalk: Fix kernel memory disclosure
David Forster <dforster(a)brocade.com>
vti6: fix device register to report IFLA_INFO_KIND
Peter Ujfalusi <peter.ujfalusi(a)ti.com>
ARM: OMAP1: DMA: Correct the number of logical channels
Florian Fainelli <f.fainelli(a)gmail.com>
net: systemport: Pad packet before inserting TSB
Florian Fainelli <f.fainelli(a)gmail.com>
net: systemport: Utilize skb_put_padto()
Masami Hiramatsu <mhiramat(a)kernel.org>
kprobes/x86: Disable preemption in ftrace-based jprobes
Thomas Richter <tmricht(a)linux.vnet.ibm.com>
perf test attr: Fix ignored test case result
Ben Hutchings <ben(a)decadent.org.uk>
usbip: tools: Install all headers needed for libusbip development
Jibin Xu <jibin.xu(a)windriver.com>
sysrq : fix Show Regs call trace on ARM
Gustavo A. R. Silva <garsilva(a)embeddedor.com>
EDAC, sb_edac: Fix missing break in switch
Dave Hansen <dave.hansen(a)linux.intel.com>
x86/entry: Use SYSCALL_DEFINE() macros for sys_modify_ldt()
Aaron Sierra <asierra(a)xes-inc.com>
serial: 8250: Preserve DLD[7:4] for PORT_XR17V35X
Alexey Khoroshilov <khoroshilov(a)ispras.ru>
usb: phy: tahvo: fix error handling in tahvo_usb_probe()
John Stultz <john.stultz(a)linaro.org>
usb: dwc2: Error out of dwc2_hsotg_ep_disable() if we're in host mode
John Stultz <john.stultz(a)linaro.org>
usb: dwc2: Fix UDC state tracking
Hiromitsu Yamasaki <hiromitsu.yamasaki.ym(a)renesas.com>
spi: sh-msiof: Fix DMA transfer size check
Lukas Wunner <lukas(a)wunner.de>
serial: 8250_fintek: Fix rs485 disablement on invalid ioctl()
Andy Lutomirski <luto(a)kernel.org>
selftests/x86/ldt_get: Add a few additional tests for limits
Christian Borntraeger <borntraeger(a)de.ibm.com>
s390/pci: do not require AIS facility
Boshi Wang <wangboshi(a)huawei.com>
ima: fix hash algorithm initialization
Sebastian Sjoholm <ssjoholm(a)mac.com>
USB: serial: option: add Quectel BG96 id
Heiko Carstens <heiko.carstens(a)de.ibm.com>
s390/runtime instrumentation: simplify task exit handling
Matt Wilson <msw(a)amazon.com>
serial: 8250_pci: Add Amazon PCI serial device ID
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
usb: quirks: Add no-lpm quirk for KY-688 USB 3.1 Type-C Hub
Hans de Goede <hdegoede(a)redhat.com>
uas: Always apply US_FL_NO_ATA_1X quirk to Seagate devices
Rui Hua <huarui.dev(a)gmail.com>
bcache: recover data from backing when data is clean
Coly Li <colyli(a)suse.de>
bcache: only permit to recovery read error when cache device is clean
-------------
Diffstat:
Makefile | 4 +-
arch/arm/mach-omap1/dma.c | 16 +++----
arch/s390/include/asm/pci_insn.h | 2 +-
arch/s390/include/asm/runtime_instr.h | 4 +-
arch/s390/kernel/process.c | 2 +-
arch/s390/kernel/runtime_instr.c | 30 ++++++-------
arch/s390/pci/pci.c | 5 ++-
arch/s390/pci/pci_insn.c | 6 ++-
arch/x86/include/asm/syscalls.h | 2 +-
arch/x86/kernel/kprobes/ftrace.c | 23 ++++++----
arch/x86/kernel/ldt.c | 16 +++++--
arch/x86/um/ldt.c | 7 ++-
drivers/dma/pl330.c | 19 +++-----
drivers/edac/sb_edac.c | 1 +
drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 2 +
drivers/md/bcache/request.c | 9 +++-
drivers/net/appletalk/ipddp.c | 2 +-
drivers/net/ethernet/broadcom/bcmsysport.c | 23 +++++-----
drivers/net/ethernet/freescale/fec_main.c | 23 ++++------
drivers/net/ethernet/renesas/ravb_main.c | 8 +---
drivers/net/xen-netfront.c | 29 +++++-------
drivers/spi/spi-sh-msiof.c | 2 +-
drivers/staging/lustre/lustre/llite/llite_mmap.c | 4 +-
drivers/tty/serial/8250/8250_fintek.c | 2 +-
drivers/tty/serial/8250/8250_pci.c | 3 ++
drivers/tty/serial/8250/8250_port.c | 5 ++-
drivers/tty/sysrq.c | 9 +++-
drivers/usb/core/config.c | 31 +++++++++++--
drivers/usb/core/devio.c | 56 ++++++++++++------------
drivers/usb/core/hub.c | 9 ++++
drivers/usb/core/quirks.c | 3 ++
drivers/usb/dwc2/gadget.c | 7 +++
drivers/usb/host/ehci-dbg.c | 2 +-
drivers/usb/host/xhci-mem.c | 7 +++
drivers/usb/phy/phy-tahvo.c | 3 +-
drivers/usb/serial/option.c | 3 ++
drivers/usb/storage/uas-detect.h | 4 ++
fs/nfs/nfs4proc.c | 3 --
fs/nfs/nfs4state.c | 1 -
fs/ocfs2/file.c | 9 +---
include/linux/buffer_head.h | 4 +-
include/linux/usb.h | 1 +
include/uapi/linux/usb/ch9.h | 19 ++++++++
net/ipv4/tcp_input.c | 2 +-
net/ipv6/ip6_vti.c | 2 +-
net/sctp/debug.c | 2 +-
net/tipc/server.c | 4 +-
security/integrity/ima/ima_main.c | 4 ++
tools/perf/tests/attr.c | 2 +-
tools/testing/selftests/x86/ldt_gdt.c | 17 ++++++-
tools/usb/usbip/Makefile.am | 3 +-
virt/kvm/arm/arch_timer.c | 3 --
52 files changed, 278 insertions(+), 181 deletions(-)
commit 18f77393796848e68909e65d692c1d1436f06e06 upstream.
When fsl-imx25-tsadc is compiled as a module, loading, unloading and
reloading the module will lead to a crash.
Unable to handle kernel paging request at virtual address bf005430
[<c004df6c>] (irq_find_matching_fwspec)
from [<c028d5ec>] (of_irq_get+0x58/0x74)
[<c028d594>] (of_irq_get)
from [<c01ff970>] (platform_get_irq+0x48/0xc8)
[<c01ff928>] (platform_get_irq)
from [<bf00e33c>] (mx25_tsadc_probe+0x220/0x2f4 [fsl_imx25_tsadc])
irq_find_matching_fwspec() loops over all registered irq domains. The
irq domain is still registered from last time the module was loaded but
the pointer to its operations is invalid after the module was unloaded.
Add a removal function which clears the irq handler and removes the irq
domain. With this cleanup in place, it's possible to unload and reload
the module.
Cc: <stable(a)vger.kernel.org> # 4.14.x
Signed-off-by: Martin Kaiser <martin(a)kaiser.cx>
Reviewed-by: Lucas Stach <l.stach(a)pengutronix.de>
Signed-off-by: Lee Jones <lee.jones(a)linaro.org>
---
drivers/mfd/fsl-imx25-tsadc.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/mfd/fsl-imx25-tsadc.c b/drivers/mfd/fsl-imx25-tsadc.c
index 14189ef..dbb85ca 100644
--- a/drivers/mfd/fsl-imx25-tsadc.c
+++ b/drivers/mfd/fsl-imx25-tsadc.c
@@ -179,6 +179,19 @@ static int mx25_tsadc_probe(struct platform_device *pdev)
return devm_of_platform_populate(dev);
}
+static int mx25_tsadc_remove(struct platform_device *pdev)
+{
+ struct mx25_tsadc *tsadc = platform_get_drvdata(pdev);
+ int irq = platform_get_irq(pdev, 0);
+
+ if (irq) {
+ irq_set_chained_handler_and_data(irq, NULL, NULL);
+ irq_domain_remove(tsadc->domain);
+ }
+
+ return 0;
+}
+
static const struct of_device_id mx25_tsadc_ids[] = {
{ .compatible = "fsl,imx25-tsadc" },
{ /* Sentinel */ }
@@ -191,6 +204,7 @@ static struct platform_driver mx25_tsadc_driver = {
.of_match_table = of_match_ptr(mx25_tsadc_ids),
},
.probe = mx25_tsadc_probe,
+ .remove = mx25_tsadc_remove,
};
module_platform_driver(mx25_tsadc_driver);
--
2.1.4
This is the start of the stable review cycle for the 4.4.101 release.
There are 16 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Fri Nov 24 10:11:01 UTC 2017.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.101-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.4.101-rc1
Jan Harkes <jaharkes(a)cs.cmu.edu>
coda: fix 'kernel memory exposure attempt' in fsync
Pavel Tatashin <pasha.tatashin(a)oracle.com>
mm/page_alloc.c: broken deferred calculation
Corey Minyard <cminyard(a)mvista.com>
ipmi: fix unsigned long underflow
alex chen <alex.chen(a)huawei.com>
ocfs2: should wait dio before inode lock in ocfs2_setattr()
Keith Busch <keith.busch(a)intel.com>
nvme: Fix memory order on async queue deletion
Mark Rutland <mark.rutland(a)arm.com>
arm64: fix dump_instr when PAN and UAO are in use
Lukas Wunner <lukas(a)wunner.de>
serial: omap: Fix EFR write on RTS deassertion
Roberto Sassu <roberto.sassu(a)huawei.com>
ima: do not update security.ima if appraisal status is not INTEGRITY_PASS
Eric W. Biederman <ebiederm(a)xmission.com>
net/sctp: Always set scope_id in sctp_inet6_skb_msgname
Huacai Chen <chenhc(a)lemote.com>
fealnx: Fix building error on MIPS
Xin Long <lucien.xin(a)gmail.com>
sctp: do not peel off an assoc from one netns to another one
Jason A. Donenfeld <Jason(a)zx2c4.com>
af_netlink: ensure that NLMSG_DONE never fails in dumps
Cong Wang <xiyou.wangcong(a)gmail.com>
vlan: fix a use-after-free in vlan_device_event()
Hangbin Liu <liuhangbin(a)gmail.com>
bonding: discard lowest hash bit for 802.3ad layer3+4
Ye Yin <hustcat(a)gmail.com>
netfilter/ipvs: clear ipvs_property flag when SKB net namespace changed
Eric Dumazet <edumazet(a)google.com>
tcp: do not mangle skb->cb[] in tcp_make_synack()
-------------
Diffstat:
Makefile | 4 ++--
arch/arm64/kernel/traps.c | 26 +++++++++++++-------------
drivers/char/ipmi/ipmi_msghandler.c | 10 ++++++----
drivers/net/bonding/bond_main.c | 2 +-
drivers/net/ethernet/fealnx.c | 6 +++---
drivers/nvme/host/pci.c | 2 +-
drivers/tty/serial/omap-serial.c | 2 +-
fs/coda/upcall.c | 3 +--
fs/ocfs2/file.c | 9 +++++++--
include/linux/mmzone.h | 3 ++-
include/linux/skbuff.h | 7 +++++++
mm/page_alloc.c | 27 ++++++++++++++++++---------
net/8021q/vlan.c | 6 +++---
net/core/skbuff.c | 1 +
net/ipv4/tcp_output.c | 9 ++-------
net/netlink/af_netlink.c | 17 +++++++++++------
net/netlink/af_netlink.h | 1 +
net/sctp/ipv6.c | 2 ++
net/sctp/socket.c | 4 ++++
security/integrity/ima/ima_appraise.c | 3 +++
20 files changed, 89 insertions(+), 55 deletions(-)
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 315d160c5a4e034a576a13aa21e7235d5c9ec609 Mon Sep 17 00:00:00 2001
From: Daniel Jurgens <danielj(a)mellanox.com>
Date: Wed, 29 Nov 2017 20:10:39 +0200
Subject: [PATCH] IB/core: Only enforce security for InfiniBand
For now the only LSM security enforcement mechanism available is
specific to InfiniBand. Bypass enforcement for non-IB link types.
This fixes a regression where modify_qp fails for iWARP because
querying the PKEY returns -EINVAL.
Cc: Paul Moore <paul(a)paul-moore.com>
Cc: Don Dutile <ddutile(a)redhat.com>
Cc: stable(a)vger.kernel.org
Reported-by: Potnuri Bharat Teja <bharat(a)chelsio.com>
Fixes: d291f1a65232("IB/core: Enforce PKey security on QPs")
Fixes: 47a2b338fe63("IB/core: Enforce security on management datagrams")
Signed-off-by: Daniel Jurgens <danielj(a)mellanox.com>
Reviewed-by: Parav Pandit <parav(a)mellanox.com>
Tested-by: Potnuri Bharat Teja <bharat(a)chelsio.com>
Signed-off-by: Leon Romanovsky <leon(a)kernel.org>
Signed-off-by: Jason Gunthorpe <jgg(a)mellanox.com>
diff --git a/drivers/infiniband/core/security.c b/drivers/infiniband/core/security.c
index 23278ed5be45..a337386652b0 100644
--- a/drivers/infiniband/core/security.c
+++ b/drivers/infiniband/core/security.c
@@ -417,8 +417,17 @@ void ib_close_shared_qp_security(struct ib_qp_security *sec)
int ib_create_qp_security(struct ib_qp *qp, struct ib_device *dev)
{
+ u8 i = rdma_start_port(dev);
+ bool is_ib = false;
int ret;
+ while (i <= rdma_end_port(dev) && !is_ib)
+ is_ib = rdma_protocol_ib(dev, i++);
+
+ /* If this isn't an IB device don't create the security context */
+ if (!is_ib)
+ return 0;
+
qp->qp_sec = kzalloc(sizeof(*qp->qp_sec), GFP_KERNEL);
if (!qp->qp_sec)
return -ENOMEM;
@@ -441,6 +450,10 @@ EXPORT_SYMBOL(ib_create_qp_security);
void ib_destroy_qp_security_begin(struct ib_qp_security *sec)
{
+ /* Return if not IB */
+ if (!sec)
+ return;
+
mutex_lock(&sec->mutex);
/* Remove the QP from the lists so it won't get added to
@@ -470,6 +483,10 @@ void ib_destroy_qp_security_abort(struct ib_qp_security *sec)
int ret;
int i;
+ /* Return if not IB */
+ if (!sec)
+ return;
+
/* If a concurrent cache update is in progress this
* QP security could be marked for an error state
* transition. Wait for this to complete.
@@ -505,6 +522,10 @@ void ib_destroy_qp_security_end(struct ib_qp_security *sec)
{
int i;
+ /* Return if not IB */
+ if (!sec)
+ return;
+
/* If a concurrent cache update is occurring we must
* wait until this QP security structure is processed
* in the QP to error flow before destroying it because
@@ -557,7 +578,7 @@ int ib_security_modify_qp(struct ib_qp *qp,
{
int ret = 0;
struct ib_ports_pkeys *tmp_pps;
- struct ib_ports_pkeys *new_pps;
+ struct ib_ports_pkeys *new_pps = NULL;
struct ib_qp *real_qp = qp->real_qp;
bool special_qp = (real_qp->qp_type == IB_QPT_SMI ||
real_qp->qp_type == IB_QPT_GSI ||
@@ -565,18 +586,27 @@ int ib_security_modify_qp(struct ib_qp *qp,
bool pps_change = ((qp_attr_mask & (IB_QP_PKEY_INDEX | IB_QP_PORT)) ||
(qp_attr_mask & IB_QP_ALT_PATH));
+ WARN_ONCE((qp_attr_mask & IB_QP_PORT &&
+ rdma_protocol_ib(real_qp->device, qp_attr->port_num) &&
+ !real_qp->qp_sec),
+ "%s: QP security is not initialized for IB QP: %d\n",
+ __func__, real_qp->qp_num);
+
/* The port/pkey settings are maintained only for the real QP. Open
* handles on the real QP will be in the shared_qp_list. When
* enforcing security on the real QP all the shared QPs will be
* checked as well.
*/
- if (pps_change && !special_qp) {
+ if (pps_change && !special_qp && real_qp->qp_sec) {
mutex_lock(&real_qp->qp_sec->mutex);
new_pps = get_new_pps(real_qp,
qp_attr,
qp_attr_mask);
-
+ if (!new_pps) {
+ mutex_unlock(&real_qp->qp_sec->mutex);
+ return -ENOMEM;
+ }
/* Add this QP to the lists for the new port
* and pkey settings before checking for permission
* in case there is a concurrent cache update
@@ -600,7 +630,7 @@ int ib_security_modify_qp(struct ib_qp *qp,
qp_attr_mask,
udata);
- if (pps_change && !special_qp) {
+ if (new_pps) {
/* Clean up the lists and free the appropriate
* ports_pkeys structure.
*/
@@ -631,6 +661,9 @@ int ib_security_pkey_access(struct ib_device *dev,
u16 pkey;
int ret;
+ if (!rdma_protocol_ib(dev, port_num))
+ return 0;
+
ret = ib_get_cached_pkey(dev, port_num, pkey_index, &pkey);
if (ret)
return ret;
@@ -665,6 +698,9 @@ int ib_mad_agent_security_setup(struct ib_mad_agent *agent,
{
int ret;
+ if (!rdma_protocol_ib(agent->device, agent->port_num))
+ return 0;
+
ret = security_ib_alloc_security(&agent->security);
if (ret)
return ret;
@@ -690,6 +726,9 @@ int ib_mad_agent_security_setup(struct ib_mad_agent *agent,
void ib_mad_agent_security_cleanup(struct ib_mad_agent *agent)
{
+ if (!rdma_protocol_ib(agent->device, agent->port_num))
+ return;
+
security_ib_free_security(agent->security);
if (agent->lsm_nb_reg)
unregister_lsm_notifier(&agent->lsm_nb);
@@ -697,6 +736,9 @@ void ib_mad_agent_security_cleanup(struct ib_mad_agent *agent)
int ib_mad_enforce_security(struct ib_mad_agent_private *map, u16 pkey_index)
{
+ if (!rdma_protocol_ib(map->agent.device, map->agent.port_num))
+ return 0;
+
if (map->agent.qp->qp_type == IB_QPT_SMI && !map->agent.smp_allowed)
return -EACCES;