From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9335C47423 for ; Fri, 2 Oct 2020 11:55:01 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6F2CA206B7 for ; Fri, 2 Oct 2020 11:55:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="mpYT5qPr"; dkim=temperror (0-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Ns6oCo38" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F2CA206B7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2A6D286AEF; Fri, 2 Oct 2020 11:55:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bjWfwxnuQJrC; Fri, 2 Oct 2020 11:55:00 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 20EA586AF3; Fri, 2 Oct 2020 11:55:00 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0C7B0C0889; Fri, 2 Oct 2020 11:55:00 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 030FCC0051 for ; Fri, 2 Oct 2020 11:54:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id DABB7872E5 for ; Fri, 2 Oct 2020 11:54:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5BO4Y3nuGTHo for ; Fri, 2 Oct 2020 11:54:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by hemlock.osuosl.org (Postfix) with ESMTPS id A5442872DF for ; Fri, 2 Oct 2020 11:54:56 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 3E0EAA5C; Fri, 2 Oct 2020 07:54:55 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 02 Oct 2020 07:54:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=xtRK2xXZ/v/QUkP9zj3e/x8jRHl U4UVCaVvPb2DgxG4=; b=mpYT5qPrblB6kHeE4d72vu8RAsUDsA3t5Mk27Yf5XzJ f4oUugKCSduLv109iXqKbeF2uT8CM9lwtNXg3vf0AIpQqhcPZxsfNjIOoOK2M/JE Zz6/MSA3XbDhjuY05UgrW5fBIcCbYwdYiLp7bVsAXsk3C9XbuIM4v0K/X/9T0cWE pyRi7acAGE1Sqarj9wIObjuLWTQRD26v/VFgWhIpWU/GsU5clmp7j2VINCyTlUwF rQiKkyoeQgrVog2bz3PiG52qdEH9Ch/3DMOqRN3jz4tKLNjLFh+1DZO2mJQrjKYz 0Yf3lGumjWm8FCYnKdIpyab5Pa4fiA6BAQgn7J8sy4A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=xtRK2x XZ/v/QUkP9zj3e/x8jRHlU4UVCaVvPb2DgxG4=; b=Ns6oCo38v3htoZZ46HHJp+ 0ndfOAdzg+SfkYWsjVmmnZ3LYYIIib4EMqXDGdPewMe2vgCEF8Cs+FI5IkFHNRfr 3CXiw2JqrNd52Klzpf6Jyktd1J1vyFDsSG76wg93NO78QsgNzplwDhM5VrUUuK40 rifXvUvIhA2lRMe8gRVrkj3xorETFOZXCika8iXQtONmW85H027myEkzCXxdFZ50 bhO23rgvy27LRQi5p0bM1pu0GwZ9ctZqlGHfoy4xk8GffvH4VT2yOUVo5Ak5AP29 SsGDsYSdDxEa7ZXBlshob9NrlsRJoL/v3MvFHAuqPTUOfIMnU3ZURIVzHKonYsUA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrfeeigdegfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepifhrvghgucfm jfcuoehgrhgvgheskhhrohgrhhdrtghomheqnecuggftrfgrthhtvghrnhepveeuheejgf ffgfeivddukedvkedtleelleeghfeljeeiueeggeevueduudekvdetnecukfhppeekfedr keeirdejgedrieegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepghhrvghgsehkrhhorghhrdgtohhm X-ME-Proxy: Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) by mail.messagingengine.com (Postfix) with ESMTPA id C14CE3064683; Fri, 2 Oct 2020 07:54:53 -0400 (EDT) Date: Fri, 2 Oct 2020 13:54:53 +0200 From: Greg KH To: Anant Thazhemadam Message-ID: <20201002115453.GA3338729@kroah.com> References: <20201001073221.239618-1-anant.thazhemadam@gmail.com> <20201001.191522.1749084221364678705.davem@davemloft.net> <83804e93-8f59-4d35-ec61-e9b5e6f00323@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <83804e93-8f59-4d35-ec61-e9b5e6f00323@gmail.com> Cc: petkan@nucleusys.com, syzbot+abbc768b560c84d92fd3@syzkaller.appspotmail.com, netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, David Miller Subject: Re: [Linux-kernel-mentees] [PATCH v2] net: usb: rtl8150: prevent set_ethernet_addr from setting uninit address X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" On Fri, Oct 02, 2020 at 05:04:13PM +0530, Anant Thazhemadam wrote: > > On 02/10/20 7:45 am, David Miller wrote: > > From: Anant Thazhemadam > > Date: Thu, 1 Oct 2020 13:02:20 +0530 > > > >> When get_registers() fails (which happens when usb_control_msg() fails) > >> in set_ethernet_addr(), the uninitialized value of node_id gets copied > >> as the address. > >> > >> Checking for the return values appropriately, and handling the case > >> wherein set_ethernet_addr() fails like this, helps in avoiding the > >> mac address being incorrectly set in this manner. > >> > >> Reported-by: syzbot+abbc768b560c84d92fd3@syzkaller.appspotmail.com > >> Tested-by: syzbot+abbc768b560c84d92fd3@syzkaller.appspotmail.com > >> Signed-off-by: Anant Thazhemadam > >> Acked-by: Petko Manolov > > First, please remove "Linux-kernel-mentees" from the Subject line. > > > > All patch submitters should have their work judged equally, whoever > > they are. So this Subject text gives no extra information, and it > > simply makes scanning Subject lines in one's mailer more difficult. > I will keep that in mind for all future submissions. Thank you. > > > Second, when a MAC address fails to probe a random MAC address should > > be selected. We have helpers for this. This way an interface still > > comes up and is usable, even in the event of a failed MAC address > > probe. > > Okay... I see. > But this patch is about ensuring that an uninitialized variable's > value (whatever that may be) is not set as the ethernet address > blindly (without any form of checking if get_registers() worked > as expected, or not). And I didn't think uninitialized values being > set as MAC address was considered a good outcome (after all, it > seemed to have triggered a bug), especially when it could have > been avoided by introducing a simple check that doesn't break > anything. If the read from the device for the MAC address fails, don't abort the whole probe process and make the device not work at all, call the networking core to assign a random MAC address. > However, if I was mistaken, and if that is something that we can live > with after all, then I don't really see the understand the purpose of > similar checks being made (in all the many places that the return > value of get_registers() (or a similar function gets checked) in the first > place at all. Different values and registers determine what should be done with an error. It's all relative. For this type of error, we should gracefully recover and keep on going. For others, maybe we just ignore the issue, or log it, or something else, it all depends. hope this helps, greg k-h _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees