From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E6D13D47B2 for ; Fri, 7 Aug 2026 11:55:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786103708; cv=none; b=A+3VlpmbE6afJC56zfTPMCyreb6/a51uQQ2+ZbB9xRhkL1DEKLQj7l48JDIDXanRBFNWPBKEaHE98Q4f7zVPGqUeDqwNj3kHyALuUYeyr9fOIt8tjky55vAuVTThD9WHquKK0XctZAU06hIYqvPuaFfjzTrYHiaxWKr0obQ5Zlk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786103708; c=relaxed/simple; bh=W3KhDTimuwgisUptLxdE3P0lFgT70NS8NtJzHMxIpog=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=SmF+RrjviE5Mx2w50EbRpC5NVHpTQP/0p3Ergw4/l5xWuMwk5RxrL4PITa1x3AHBopqhN9l4cz/FYVroLVOL0jVPi6Q+Lf50xWhoVr1iqLpEvt4xuLCGoHry7kCWzcGSKftAP2FuCWYXWZMRV1V+rOWwrydafFvjUGnBkkXW7Yo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=r4veIr6R; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="r4veIr6R" Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-69c108fee7fso4785567a12.3 for ; Fri, 07 Aug 2026 04:55:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786103695; x=1786708495; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=AjCLnnMYnIXAKd2QojkF632kR9nXx4FuPCfAi4Zg5FI=; b=r4veIr6R/4v+8PsLkesemVV6U7bRiaKr5WmvAYOC79xKQ61iNfua24pbDf0KfM98In +Q4fuFRFfixYeoHPADg5YttcwPlUPnX8UZCKghIKqP+u97xpOqYuqaRDcYT0iTVuuEft XGw/iH7e12Z9XVef1fyt8eJjjWwSgtDWhRlcBN73WfFN6Fmpn5nXMec0ntjAtaloucLi BXCWCd3o+Vdca3m1GmqRgazgVUu46rtRhXYJSui7BTSQ0BhTEZISJhn2H9yJU/maqCRH /LsG+VOm+xNF2HfNtopuVT14YaZOWK/o6Pd4fuWI3gfh/x6e9dJb+H2ZfZEnNRd+9bE/ 6Acw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786103695; x=1786708495; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=AjCLnnMYnIXAKd2QojkF632kR9nXx4FuPCfAi4Zg5FI=; b=fT0rXn5nIEuE1GiypgV58T4Z4ZbisspPryPtuza1LSyWgI12DByRVGKy69oeAuFFY8 xm2b1JX3QYDwTvCZXI2j8BBCqapM3pw+as2s/dsoDzQvlVjsszF9q6CDKsL8ocav5vXy mlaXpSrmfSw+JrKR53oMPV+Atj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1qstLZ8= X-Received: by 2002:a05:6402:e93:b0:69a:928:9405 with SMTP id 4fb4d7f45d1cf-6a14f09ff2cmr11039309a12.1.1786103695297; Fri, 07 Aug 2026 04:54:55 -0700 (PDT) Received: from [192.168.100.51] (87-205-15-91.static.ip.netia.com.pl. [87.205.15.91]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6a1e7cbaf69sm471408a12.13.2026.08.07.04.54.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Aug 2026 04:54:54 -0700 (PDT) Message-ID: <8df5c003-f28f-4fce-ad4d-9c6247d06892@gmail.com> Date: Fri, 7 Aug 2026 13:54:53 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net v2] ipvlan: keep lower device alive until private destruction To: Jakub Kicinski Cc: netdev@vger.kernel.org, Andrew Lunn , "David S. Miller" , Eric Dumazet , Paolo Abeni , syzkaller-bugs@googlegroups.com, dskr99@gmail.com, Kees Cook , linux-kernel@vger.kernel.org, syzbot@lists.linux.dev, syzbot+5fe14f2ff4ccbace9a26@syzkaller.appspotmail.com References: <20260803121140.261329-1-krystianmkaniewski@gmail.com> <20260806083834.28db4cde@kernel.org> Content-Language: en-US From: Krystian Kaniewski In-Reply-To: <20260806083834.28db4cde@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit You're right. I treated the netdev reference as a guarantee that the device was still usable, while it only keeps struct net_device allocated. It does not guarantee that the device is still operational after unregister has started. Keeping the lower device referenced for longer in ipvlan is therefore not the right solution. The caller that wants to operate on the device needs to verify that it is still alive. Thank you for the review and for clarifying this. I will prepare a v3 later with the fix on the caller side. On 8/6/2026 5:38 PM, Jakub Kicinski wrote: > On Mon, 3 Aug 2026 14:11:39 +0200 Krystian Kaniewski wrote: >> Specifically, RXE acts as an asynchronous owner in this scenario. RXE >> queues RDMA device removal on NETDEV_UNREGISTER, meaning it can retain a >> reference to the ipvlan netdev after ndo_uninit has completed. > The netdev reference only guarantees that struct net_device does not > go away. Caller must check that the device is still alive if it is > trying to operate on it without a guarantee that it's still live.