Re: [PATCH target-pending] iscsi-target: make sure to wake up sleeping login worker

2018-01-19 Thread Eric Dumazet
On Fri, 2018-01-19 at 14:36 +0100, Florian Westphal wrote:
> Mike Christie reports:
>   Starting in 4.14 iscsi logins will fail around 50% of the time.
> 
> Problem appears to be that iscsi_target_sk_data_ready() callback may
> return without doing anything in case it finds the login work queue
> is still blocked in sock_recvmsg().
> 
> Nicholas Bellinger says:
>   It would indicate users providing their own ->sk_data_ready() callback
>   must be responsible for waking up a kthread context blocked on
>   sock_recvmsg(..., MSG_WAITALL), when a second ->sk_data_ready() is
>   received before the first sock_recvmsg(..., MSG_WAITALL) completes.
> 
> So, do this and invoke the original data_ready() callback -- in
> case of tcp sockets this takes care of waking the thread.
> 
> Disclaimer: I do not understand why this problem did not show up before
> tcp prequeue removal.
> 
> Reported-by: Mike Christie 
> Bisected-by: Mike Christie 
> Tested-by: Mike Christie 
> Diagnosed-by: Nicholas Bellinger 
> Fixes: e7942d0633c4 ("tcp: remove prequeue support")
> Signed-off-by: Florian Westphal 
> ---
>  drivers/target/iscsi/iscsi_target_nego.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/target/iscsi/iscsi_target_nego.c 
> b/drivers/target/iscsi/iscsi_target_nego.c
> index b686e2ce9c0e..3723f8f419aa 100644
> --- a/drivers/target/iscsi/iscsi_target_nego.c
> +++ b/drivers/target/iscsi/iscsi_target_nego.c
> @@ -432,6 +432,9 @@ static void iscsi_target_sk_data_ready(struct sock *sk)
>   if (test_and_set_bit(LOGIN_FLAGS_READ_ACTIVE, >login_flags)) {
>   write_unlock_bh(>sk_callback_lock);
>   pr_debug("Got LOGIN_FLAGS_READ_ACTIVE=1, conn: %p \n", 
> conn);
> + if (WARN_ON(iscsi_target_sk_data_ready == 
> conn->orig_data_ready))
> + return;

Is this WARN_ON() belonging to this fix ?
At least make it WARN_ON_ONCE() or pr_err_once()

> + conn->orig_data_ready(sk);
>   return;
>   }
>  


Re: [PATCH 2/2] sg: fixup infoleak when using SG_GET_REQUEST_TABLE

2017-09-15 Thread Eric Dumazet
On Fri, Sep 15, 2017 at 5:05 AM, Hannes Reinecke <h...@suse.de> wrote:
> When calling SG_GET_REQUEST_TABLE ioctl that only a half-filled
> table is returned; the remaining part will then contain stale
> kernel memory information.
> This patch zeroes out the entire table to avoid this issue.
>
> Signed-off-by: Hannes Reinecke <h...@suse.com>
> ---
>  drivers/scsi/sg.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Reviewed-by: Eric Dumazet <eduma...@google.com>

Thanks !


Re: [PATCH] scsi: qla2xxx: Fix an integer overflow in sysfs code

2017-08-30 Thread Eric Dumazet
On Wed, Aug 30, 2017 at 6:12 AM, Greg KH  wrote:
> On Wed, Aug 30, 2017 at 03:21:07PM +0300, Dan Carpenter wrote:
>> The value of "size" comes from the user.  When we add "start + size"
>> it could lead to an integer overflow bug.
>>
>> It means we vmalloc() a lot more memory than we had intended.  I believe
>> that on 64 bit systems vmalloc() can succeed even if we ask it to
>> allocate huge 4GB buffers.  So we would get memory corruption and likely
>> a crash when we call ha->isp_ops->write_optrom() and ->read_optrom().
>>
>> Only root can trigger this bug.
>>
>> Fixes: b7cc176c9eb3 ("[SCSI] qla2xxx: Allow region-based flash-part 
>> accesses.")
>> Reported-by: shqking 
>> Signed-off-by: Dan Carpenter 
>
>
> Cc: stable 
>
> perhaps?
>
> thanks,
>
> greg k-h

Also a link to https://bugzilla.kernel.org/show_bug.cgi?id=194061
since shqking did a fair bit of analysis, not only report the bug.

Thanks.


Re: [PATCH] net: return value of skb_linearize should be handled in Linux kernel

2016-12-06 Thread Eric Dumazet
On Tue, 2016-12-06 at 15:10 +0800, Zhouyi Zhou wrote:
> kmalloc_reserve may fail to allocate memory inside skb_linearize, 
> which means skb_linearize's return value should not be ignored. 
> Following patch correct the uses of skb_linearize.
> 
> Compiled in x86_64
> 
> Signed-off-by: Zhouyi Zhou 
> ---
>  drivers/infiniband/hw/nes/nes_nic.c   | 5 +++--
>  drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 6 +-
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 3 +--
>  drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 7 +--
>  drivers/scsi/fcoe/fcoe.c  | 5 -
>  net/tipc/link.c   | 3 ++-
>  net/tipc/name_distr.c | 5 -
>  7 files changed, 24 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/nes/nes_nic.c 
> b/drivers/infiniband/hw/nes/nes_nic.c
> index 2b27d13..69372ea 100644
> --- a/drivers/infiniband/hw/nes/nes_nic.c
> +++ b/drivers/infiniband/hw/nes/nes_nic.c
> @@ -662,10 +662,11 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, 
> struct net_device *netdev)
>   nesnic->sq_head &= nesnic->sq_size-1;
>   }
>   } else {
> - nesvnic->linearized_skbs++;
>   hoffset = skb_transport_header(skb) - skb->data;
>   nhoffset = skb_network_header(skb) - skb->data;
> - skb_linearize(skb);
> + if (skb_linearize(skb))
> + return NETDEV_TX_BUSY;

This would live lock.

Please drop the packet.

You probably should send one patch per driver, to ease code review and
acceptance.



--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] qla4xxx: add a missing include

2015-05-27 Thread Eric Dumazet
On Wed, 2015-05-27 at 11:33 -0700, James Bottomley wrote:
 On Wed, 2015-05-27 at 14:21 -0400, David Miller wrote:

  Yeah it's easiest if I just apply this to net-next, which I've just done,
  thanks Eric.
 
 Fine with me.  There's no point creating cross tree hassle for a simple
 include problem.

Note there are other drivers to fix, I'll try to submit patches for
them.


--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next] qla4xxx: add a missing include

2015-05-26 Thread Eric Dumazet
From: Eric Dumazet edum...@google.com

vmalloc.h used to be included from include/net/inet_hashtables.h
but it is no longer the case.

Fixes: 095dc8e0c368 (tcp: fix/cleanup inet_ehash_locks_alloc())
Reported-by: kbuild test robot fengguang...@intel.com
Signed-off-by: Eric Dumazet edum...@google.com
---
Given its broken in David net-next tree, its probably simpler
that David merges this fix directly ? Thanks !

 drivers/scsi/qla4xxx/ql4_def.h |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index 
8f6d0fb2cd807255a66e962c3cb7c4c8633d4d77..a7cfc270bd08a1f01867affc2dee0fc6b7611472
 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -26,6 +26,7 @@
 #include linux/mutex.h
 #include linux/aer.h
 #include linux/bsg-lib.h
+#include linux/vmalloc.h
 
 #include net/tcp.h
 #include scsi/scsi.h


--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html