summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* isdn: hisax: Fix pnp_irq's error checking for setup_teles3Arvind Yadav2017-11-161-1/+1
| | | | | | | | The pnp_irq() function returns -1 if an error occurs. pnp_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* isdn: hisax: Fix pnp_irq's error checking for setup_sedlbauer_isapnpArvind Yadav2017-11-161-1/+1
| | | | | | | | The pnp_irq() function returns -1 if an error occurs. pnp_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* isdn: hisax: Fix pnp_irq's error checking for setup_niccyArvind Yadav2017-11-161-1/+1
| | | | | | | | The pnp_irq() function returns -1 if an error occurs. pnp_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* isdn: hisax: Fix pnp_irq's error checking for setup_ix1microArvind Yadav2017-11-161-1/+1
| | | | | | | | The pnp_irq() function returns -1 if an error occurs. pnp_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* isdn: hisax: Fix pnp_irq's error checking for setup_isurfArvind Yadav2017-11-161-1/+1
| | | | | | | | The pnp_irq() function returns -1 if an error occurs. pnp_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* isdn: hisax: Handle return value of pnp_irq and pnp_port_startArvind Yadav2017-11-161-0/+2
| | | | | | | | pnp_irq() and pnp_port_start() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* isdn: hisax: Fix pnp_irq's error checking for setup_hfcsArvind Yadav2017-11-161-1/+1
| | | | | | | | The pnp_irq() function returns -1 if an error occurs. pnp_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* isdn: hisax: Fix pnp_irq's error checking for setup_hfcsxArvind Yadav2017-11-161-1/+1
| | | | | | | | The pnp_irq() function returns -1 if an error occurs. pnp_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* isdn: hisax: Fix pnp_irq's error checking for setup_elsa_isapnpArvind Yadav2017-11-161-1/+1
| | | | | | | | The pnp_irq() function returns -1 if an error occurs. pnp_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* isdn: hisax: Fix pnp_irq's error checking for setup_diva_isapnpArvind Yadav2017-11-161-1/+1
| | | | | | | | The pnp_irq() function returns -1 if an error occurs. pnp_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* isdn: hisax: Fix pnp_irq's error checking for avm_pnp_setupArvind Yadav2017-11-161-1/+1
| | | | | | | | The pnp_irq() function returns -1 if an error occurs. pnp_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* isdn: hisax: Fix pnp_irq's error checking for setup_asuscomArvind Yadav2017-11-161-1/+1
| | | | | | | | The pnp_irq() function returns -1 if an error occurs. pnp_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: enforce valid ratio between skb truesize and contentsJon Maloy2017-11-163-9/+24
| | | | | | | | | | | | | | | | | | The socket level flow control is based on the assumption that incoming buffers meet the condition (skb->truesize / roundup(skb->len) <= 4), where the latter value is rounded off upwards to the nearest 1k number. This does empirically hold true for the device drivers we know, but we cannot trust that it will always be so, e.g., in a system with jumbo frames and very small packets. We now introduce a check for this condition at packet arrival, and if we find it to be false, we copy the packet to a new, smaller buffer, where the condition will be true. We expect this to affect only a small fraction of all incoming packets, if at all. Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netfilter: add ifdef around ctnetlink_proto_sizeArnd Bergmann2017-11-161-0/+2
| | | | | | | | | | | | | | | | This function is no longer marked 'inline', so we now get a warning when it is unused: net/netfilter/nf_conntrack_netlink.c:536:15: error: 'ctnetlink_proto_size' defined but not used [-Werror=unused-function] We could mark it inline again, mark it __maybe_unused, or add an #ifdef around the definition. I'm picking the third approach here since that seems to be what the rest of the file has. Fixes: 5caaed151a68 ("netfilter: conntrack: don't cache nlattr_tuple_size result in nla_size") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: ti: cpsw: fix min eth packet sizeGrygorii Strashko2017-11-161-2/+2
| | | | | | | | | | | | | | | | Now CPSW driver configures min eth packet size to 60 octets (ETH_ZLEN) which works in most of cases, but when port VLAN is configured on some switch port, it also can be configured to force all egress packets to be VLAN untagged. And in this case, CPSW driver will pad small packets to 60 octets, but final packet size on port egress can became less than 60 octets due to VLAN tag removal and packet will be dropped. Hence, fix it by accounting VLAN header in CPSW min eth packet size. While here, use proper defines for CPSW_MAX_PACKET_SIZE also, instead of open coding. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* ipv6: sr: update the struct ipv6_sr_hdrAhmed Abdelsalam2017-11-161-2/+2
| | | | | | | | | | | | | | | | | | | | The IPv6 Segment Routing Header (SRH) format has been updated (revision 6 of the SRH ietf draft). The update includes the following SRH fields: (1) The "First Segment" field changed to be "Last Entry" which contains the index, in the Segment List, of the last element of the Segment List. (2) The 16 bit "reserved" field now is used as a "tag" which tags a packet as part of a class or group of packets, e.g.,packets sharing the same set of properties. This patch updates the struct ipv6_sr_hdr, so it complies with the updated SRH draft. The 16 bit "reserved" field is changed to be "tag", In addition a comment is added to the "first_segment" field, showing that it represents the "Last Entry" field of the SRH. Signed-off-by: Ahmed Abdelsalam <amsalam20@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hv_netvsc: preserve hw_features on mtu/channels/ringparam changesVitaly Kuznetsov2017-11-163-59/+83
| | | | | | | | | | | | | | | | | | | | | | | | | rndis_filter_device_add() is called both from netvsc_probe() when we initially create the device and from set channels/mtu/ringparam routines where we basically remove the device and add it back. hw_features is reset in rndis_filter_device_add() and filled with host data. However, we lose all additional flags which are set outside of the driver, e.g. register_netdevice() adds NETIF_F_SOFT_FEATURES and many others. Unfortunately, calls to rndis_{query_hwcaps(), _set_offload_params()} calls cannot be avoided on every RNDIS reset: host expects us to set required features explicitly. Moreover, in theory hardware capabilities can change and we need to reflect the change in hw_features. Reset net->hw_features bits according to host data in rndis_netdev_set_hwcaps(), clear corresponding feature bits from net->features in case some features went missing (will never happen in real life I guess but let's be consistent). Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* qed: use kzalloc instead of kmalloc and memsetColin Ian King2017-11-161-2/+1Star
| | | | | | | | Replace kmalloc followed by a memset with kzalloc Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Ariel Elior <aelior@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* genetlink: fix genlmsg_nlhdr()Michal Kubecek2017-11-165-15/+10Star
| | | | | | | | | | | | | | | | | | According to the description, first argument of genlmsg_nlhdr() points to what genlmsg_put() returns, i.e. beginning of user header. Therefore we should only subtract size of genetlink header and netlink message header, not user header. This also means we don't need to pass the pointer to genetlink family and the same is true for genl_dump_check_consistent() which is the only caller of genlmsg_nlhdr(). (Note that at the moment, these functions are only used for families which do not have user header so that they are not affected.) Fixes: 670dc2833d14 ("netlink: advertise incomplete dumps") Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* sctp: check stream reset info len before making reconf chunkXin Long2017-11-162-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | Now when resetting stream, if both in and out flags are set, the info len can reach: sizeof(struct sctp_strreset_outreq) + SCTP_MAX_STREAM(65535) + sizeof(struct sctp_strreset_inreq) + SCTP_MAX_STREAM(65535) even without duplicated stream no, this value is far greater than the chunk's max size. _sctp_make_chunk doesn't do any check for this, which would cause the skb it allocs is huge, syzbot even reported a crash due to this. This patch is to check stream reset info len before making reconf chunk and return EINVAL if the len exceeds chunk's capacity. Thanks Marcelo and Neil for making this clear. v1->v2: - move the check into sctp_send_reset_streams instead. Fixes: cc16f00f6529 ("sctp: add support for generating stream reconf ssn reset request chunk") Reported-by: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sctp: use the right sk after waking up from wait_buf sleepXin Long2017-11-161-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit dfcb9f4f99f1 ("sctp: deny peeloff operation on asocs with threads sleeping on it") fixed the race between peeloff and wait sndbuf by checking waitqueue_active(&asoc->wait) in sctp_do_peeloff(). But it actually doesn't work, as even if waitqueue_active returns false the waiting sndbuf thread may still not yet hold sk lock. After asoc is peeled off, sk is not asoc->base.sk any more, then to hold the old sk lock couldn't make assoc safe to access. This patch is to fix this by changing to hold the new sk lock if sk is not asoc->base.sk, meanwhile, also set the sk in sctp_sendmsg with the new sk. With this fix, there is no more race between peeloff and waitbuf, the check 'waitqueue_active' in sctp_do_peeloff can be removed. Thanks Marcelo and Neil for making this clear. v1->v2: fix it by changing to lock the new sock instead of adding a flag in asoc. Suggested-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sctp: do not free asoc when it is already dead in sctp_sendmsgXin Long2017-11-161-3/+14
| | | | | | | | | | | | | | | | | | | | | | | Now in sctp_sendmsg sctp_wait_for_sndbuf could schedule out without holding sock sk. It means the current asoc can be freed elsewhere, like when receiving an abort packet. If the asoc is just created in sctp_sendmsg and sctp_wait_for_sndbuf returns err, the asoc will be freed again due to new_asoc is not nil. An use-after-free issue would be triggered by this. This patch is to fix it by setting new_asoc with nil if the asoc is already dead when cpu schedules back, so that it will not be freed again in sctp_sendmsg. v1->v2: set new_asoc as nil in sctp_sendmsg instead of sctp_wait_for_sndbuf. Suggested-by: Neil Horman <nhorman@tuxdriver.com> Reported-by: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge tag 'ipmi-for-4.15' of git://github.com/cminyard/linux-ipmiLinus Torvalds2017-11-1622-2219/+3008
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull IPMI updates from Corey Minyard: "This is a fairly large rework of the IPMI code, along with a bunch of smaller fixes. The major changes have been in the next tree for a couple of months, so they should be good to do in. - Some users had IPMI systems where the GUID of the IPMI controller could change. So rescanning of the GUID was added. The naming of some sysfs things was dependent on the GUID, however, so this resulted in the sysfs interface code in IPMI changing to remove that dependency and name the IPMI BMCs like other sysfs devices. - The ipmi_si_intf.c code was fairly bloated with all the different discovery methods (PCI, ACPI, SMBIOS, OF, platform, module parameters, hot add). The structure of how the interfaces were added was redone to make them more modular, then the individual methods were pulled out into their own files" * tag 'ipmi-for-4.15' of git://github.com/cminyard/linux-ipmi: (48 commits) ipmi_si: Delete an error message for a failed memory allocation in try_smi_init() ipmi_si: fix memory leak on new_smi ipmi: remove redundant initialization of bmc ipmi: pr_err() strings should end with newlines ipmi: Clean up some print operations ipmi: Make the DMI probe into a generic platform probe ipmi: Make the IPMI proc interface configurable ipmi_ssif: Add device attrs for the things in proc ipmi_si: Add device attrs for the things in proc ipmi_si: remove ipmi_smi_alloc() function ipmi_si: Move port and mem I/O handling to their own files ipmi_si: Get rid of unused spacing and port fields ipmi_si: Move PARISC handling to another file ipmi_si: Move PCI setup to another file ipmi_si: Move platform device handling to another file ipmi_si: Move hardcode handling to a separate file. ipmi_si: Move the hotmod handling to another file. ipmi_si: Change ipmi_si_add_smi() to take just I/O info ipmi_si: Move io setup into io structure ipmi_si: Move irq setup handling into the io struct ...
| * Merge branch 'modules-next' of ↵Corey Minyard2017-11-02824-4858/+7995
| |\ | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux into for-next The IPMI SI driver was split into different pieces, merge the module tree to accountfor that. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Delete an error message for a failed memory allocation in ↵Markus Elfring2017-10-171-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | try_smi_init() Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: fix memory leak on new_smiColin Ian King2017-10-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error exit path omits kfree'ing the allocated new_smi, causing a memory leak. Fix this by kfree'ing new_smi. Detected by CoverityScan, CID#14582571 ("Resource Leak") Fixes: 7e030d6dff71 ("ipmi: Prefer ACPI system interfaces over SMBIOS ones") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: remove redundant initialization of bmcColin Ian King2017-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pointer bmc is being initialized and this initialized value is never being read, so this is assignment redundant and can be removed. Cleans up clang warning: warning: Value stored to 'bmc' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: pr_err() strings should end with newlinesArvind Yadav2017-09-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | pr_err() messages should terminated with a new-line to avoid other messages being concatenated onto the end. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Clean up some print operationsCorey Minyard2017-09-281-56/+45Star
| | | | | | | | | | | | | | | | | | | | | Get rid of all printfs, using dev_xxx() if a device is available, pr_xxx() otherwise, and format long strings properly. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Make the DMI probe into a generic platform probeCorey Minyard2017-09-288-95/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rework the DMI probe function to be a generic platform probe, and then rework the DMI code (and a few other things) to use the more generic information. This is so other things can declare platform IPMI devices. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Make the IPMI proc interface configurableCorey Minyard2017-09-285-21/+42
| | | | | | | | | | | | | | | | | | So we can remove it later. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_ssif: Add device attrs for the things in procCorey Minyard2017-09-281-2/+74
| | | | | | | | | | | | | | | | | | | | | Create a device attribute for everything we show in proc, getting ready for removing the proc stuff. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Add device attrs for the things in procCorey Minyard2017-09-281-1/+103
| | | | | | | | | | | | | | | | | | | | | Create a device attribute for everything we show in proc, getting ready for removing the proc stuff. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: remove ipmi_smi_alloc() functionCorey Minyard2017-09-281-10/+2Star
| | | | | | | | | | | | | | | | | | It's only used in one place now, so it's overkill. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Move port and mem I/O handling to their own filesCorey Minyard2017-09-285-255/+263
| | | | | | | | | | | | Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Get rid of unused spacing and port fieldsCorey Minyard2017-09-281-10/+0Star
| | | | | | | | | | | | Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Move PARISC handling to another fileCorey Minyard2017-09-284-57/+71
| | | | | | | | | | | | Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Move PCI setup to another fileCorey Minyard2017-09-284-161/+179
| | | | | | | | | | | | | | | | | | | | | Signed-off-by: Corey Minyard <cminyard@mvista.com> Stephen Rothwell <sfr@canb.auug.org.au> fixed an issue with the include files
| * | ipmi_si: Move platform device handling to another fileCorey Minyard2017-09-284-589/+613
| | | | | | | | | | | | | | | | | | | | | Signed-off-by: Corey Minyard <cminyard@mvista.com> Stephen Rothwell <sfr@canb.auug.org.au> fixed an issue with the include files
| * | ipmi_si: Move hardcode handling to a separate file.Corey Minyard2017-09-274-147/+154
| | | | | | | | | | | | Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Move the hotmod handling to another file.Corey Minyard2017-09-274-244/+264
| | | | | | | | | | | | Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Change ipmi_si_add_smi() to take just I/O infoCorey Minyard2017-09-273-309/+229Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of allocating the smi_info structure, filling in the I/O info, and passing it to ipmi_si_add_smi(), just pass the I/O info in the io structure and let ipmi_si_add_smi() allocate the smi_info structure. This required redoing the way the remove functions for some device interfaces worked, a new function named ipmi_si_remove_by_dev() allows the device to be passed in and detected instead of using driver data, which couldn't be filled out easily othersize. After this the platform handling should be decoupled from the smi_info structure and that handling can be pulled out to its own files. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Move io setup into io structureCorey Minyard2017-09-272-92/+85Star
| | | | | | | | | | | | | | | | | | | | | Where it belongs, and getting ready for pulling the platform handling into its own file. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Move irq setup handling into the io structCorey Minyard2017-09-273-81/+82
| | | | | | | | | | | | | | | | | | | | | | | | So the platform code can do it without having to access the smi info, getting ready for pulling the platform handling section to their own files. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Move some platform data into the io structureCorey Minyard2017-09-272-216/+213Star
| | | | | | | | | | | | | | | | | | | | | That's where it belongs, and we are getting ready for moving the platform handling out of the main ipmi_si_intf.c file. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Rename function to add smi, make it globalCorey Minyard2017-09-272-16/+28
| | | | | | | | | | | | | | | | | | | | | Getting ready for moving the platform-specific stuff into their own files. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Convert IPMI GUID over to Linux guid_tCorey Minyard2017-09-271-27/+23Star
| | | | | | | | | | | | Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Rescan channel list on BMC changesCorey Minyard2017-09-271-58/+111
| | | | | | | | | | | | | | | | | | | | | If the BMC changes versions or a change is otherwise detected, rescan the channels on the BMC. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Move lun and address out of channel structCorey Minyard2017-09-271-22/+25
| | | | | | | | | | | | | | | | | | | | | Put it in it's own struct, getting ready for channel information being dynamically changed. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Retry BMC registration on a failureCorey Minyard2017-09-271-1/+23
| | | | | | | | | | | | | | | | | | If the BMC fails to register, just set up to retry periodically. Signed-off-by: Corey Minyard <cminyard@mvista.com>