Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp654330img; Fri, 22 Mar 2019 06:01:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtIs+kNKdOzaUmgFqaWwlZscnYBb7a1DhhhC7UZ3Empq8pAYRjC50ou/L/VxVLzZae8PBi X-Received: by 2002:a62:6f06:: with SMTP id k6mr8968919pfc.257.1553259700456; Fri, 22 Mar 2019 06:01:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553259700; cv=none; d=google.com; s=arc-20160816; b=yEC5IbGPbiAOHXvRbwOwJ0madyHhrlZNNeb1CTEG1j1zBvsRoNVQ8ADVRQO2UnFOdS mTv7syQPXecstfYSVa/clafixcQzNNQNXlmP6HRD24x9lqLH0id6CMGfqE21d98dYVQJ fTdMkSpuYkdIA16t5f/hlVEIIgk+Cdjy8CxdXzkO6r1eRLBuDSLiNTilif1XsUrNLoDd QDY7RGwFa1kQ2UEfKUgBZf+7CiZhTVVQZjsz9IOZqEheEWq1V8N4Egw8x6GBeuUxrgvI +Fh+2wNhuny1rTVf/X8smiiSlfqtBFEPPtiYmsF8PoHWAagJDGBqYu9bRLFI+R28/o9o du6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=dDWsIWMC8aaswT+CuIhgDJFiCCQZ9ag1tdMcqcp9kgw=; b=an5rxe4NeK7hB2BRomtl0mosb6Ha1hdiCxpyt+17i1O7acKiKqxuwfN+Opoj4eBgLm 7MdydQGzGDgoKK00zU5vtnWbM5fXcMgqDxiQ5PtUWIHZUBAQo3uEg9lNPwBH35dRzF/r GuBXatlZg6H8GVlKzfmsjO0jD+30+wRiuOl9VMsFNnm3yq9LaayNF9QRq0Oj87c0OtmA xJGQuAfI3IfkZTDMHKe8yqs+u/g2gFUNiNE66aZse5FvjX/s54n2gdO9VGxXY28Kuxp1 mfnyBUa6fl4XRkGiurqJjUn8FlT4aIAFbhCy5jAhknBFcZ0KkiTn6eWRGNK/9e057l22 YpDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Mb/ocEFb"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si6901617plq.173.2019.03.22.06.01.22; Fri, 22 Mar 2019 06:01:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Mb/ocEFb"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732227AbfCVM7R (ORCPT + 99 others); Fri, 22 Mar 2019 08:59:17 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:45190 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731485AbfCVM7Q (ORCPT ); Fri, 22 Mar 2019 08:59:16 -0400 Received: by mail-yw1-f66.google.com with SMTP id j128so1649397ywg.12 for ; Fri, 22 Mar 2019 05:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dDWsIWMC8aaswT+CuIhgDJFiCCQZ9ag1tdMcqcp9kgw=; b=Mb/ocEFboBLbCjLZx0UbGhC7AhK4yZPzG71szBBTl9Yo3tnSI3bjEREF7a3liX1zfH F8kd3tLY9UF1ZgRCXZz6VgzyZjR/Kr7AbVxkyfLu05/u97f8LTtczWRAOZZAibKzjf2S xp7AImrqUhYbFWy0HDeam7tIgAZu6JnbtblW7EISmDR75/ez4wCgX7ccTPx3vU9kvUwA hiW+b6HzXKmHcCMS5ViNbSZlP4Bj8w/Q5qdgSTSDTJuKd6sjuqGQ/1qlxjxBGg5TDU1a FhpJT2E3oKF4k0qNY1nDDYgKb1LutBHk8GnvgovwUc3nz2QJXM+dcaxJ6E64rzKNevdY dIHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dDWsIWMC8aaswT+CuIhgDJFiCCQZ9ag1tdMcqcp9kgw=; b=JPcyVlpGuka7cCbz8oKo76e8+Qu/WAFd0XZZL3Z9eEcY1ecrWQfa9FWc5Nhn8hxmST qFwl7AOGGHtauqFhghsmXCeHqBUpADhfAhJmHHZcWWSH1TnQ0wG58k0lnH8Ch/R/6s0P PQcDe/j/4qa+rP9Q6xWXlVQPBXCpYSGUFRGxGEmxxy0ETcnu02UIP4tIiH8xXnj/H49N 9i6bhzL4DeIKpe8AIxbRgFWczojGewr3nnZPJ1WmLv7OG4ogDsXpWUjTlO7VoVQH/pnl +BGoQhnEmbBsOeNlcDg1zHi+oqu3N3EMIko//RHq6Bn4DrmfxUK8u/gr+gzYB11I5vmo OtwA== X-Gm-Message-State: APjAAAV7C9hrPS44wZ4B1fSj606plvP31tYyHx4gFvA42XGRVb1fWP39 q4MZXcozR9F0EwUcN9IewCp3tFuAQ0hOSyvYm89Qzw== X-Received: by 2002:a81:2002:: with SMTP id g2mr8204919ywg.60.1553259555290; Fri, 22 Mar 2019 05:59:15 -0700 (PDT) MIME-Version: 1.0 References: <20170324164902.15226.48358.stgit@localhost.localdomain> <20170324170812.15226.97497.stgit@localhost.localdomain> <0eb092b7ca67942f52e36c672d20f130f1d54e1e.camel@redhat.com> In-Reply-To: <0eb092b7ca67942f52e36c672d20f130f1d54e1e.camel@redhat.com> From: Eric Dumazet Date: Fri, 22 Mar 2019 05:59:03 -0700 Message-ID: Subject: Re: [net-next PATCH v3 4/8] net: Change return type of sk_busy_loop from bool to void To: Paolo Abeni Cc: Christoph Paasch , Alexander Duyck , netdev , LKML , "Samudrala, Sridhar" , David Miller , Linux API Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 22, 2019 at 3:33 AM Paolo Abeni wrote: > > Hi, > > On Thu, 2019-03-21 at 23:05 -0400, Christoph Paasch wrote: > > On Thu, Mar 21, 2019 at 12:43 PM Alexander Duyck > > wrote: > > > On Thu, Mar 21, 2019 at 2:45 AM Paolo Abeni wrote: > > > > The following - completely untested - should avoid the unbounded loop, > > > > but it's not a complete fix, I *think* we should also change > > > > sk_busy_loop_end() in a similar way, but that is a little more complex > > > > due to the additional indirections. > > > > > > As far as sk_busy_loop_end we could look at just forking sk_busy_loop > > > and writing a separate implementation for datagram sockets that uses a > > > different loop_end function. It shouldn't take much to change since > > > all we would need to do is pass a structure containing the sk and last > > > pointers instead of just passing the sk directly as the loop_end > > > argument. > > > > > > > Could you please test it? > > > > > > > > Any feedback welcome! > > > > > > The change below looks good to me. > > > > I just tried it out. Worked for me! > > > > You can add my Tested-by if you do a formal patch-submission: > > > > Tested-by: Christoph Paasch > > Thanks for testing! > > I'm trying to reproduce the issue locally, but I'm unable. I think that > the current UDP implementation is not affected, as we always ensure > sk_receive_queue is empty before busy polling. But right after check is done we release the queue lock, so a packet might come right after the test has been done. > Unix sockets should not > be affected, too, as busy polling should not have any effect there > (sk_napi_id should be never >= MIN_NAPI_ID). Can you reproduce the > issue on an unpatched, recent, upstream kernel? > > Can you please provide the syzkaller repro? > > Thanks, > > Paolo > > > > >