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=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 D25C3C43381 for ; Thu, 21 Jan 2021 11:28:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8ABF8238E2 for ; Thu, 21 Jan 2021 11:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730516AbhAUL21 (ORCPT ); Thu, 21 Jan 2021 06:28:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726603AbhAUL0j (ORCPT ); Thu, 21 Jan 2021 06:26:39 -0500 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7F21C0613D3; Thu, 21 Jan 2021 03:25:58 -0800 (PST) Received: by mail-yb1-xb29.google.com with SMTP id y4so1717140ybn.3; Thu, 21 Jan 2021 03:25:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=k9t1av7olujuCjiWRao1+foelfX8Dllx4K3zuzbAp08=; b=taU/XiBsk52yDFqqDgjQA0bad/3BoAoLe3P8app055QZ9J2qP/yY+2mlnkTfVU3Tl8 cqGIRyt1YNUB2iaaKijOP6S978PG7uQm1Yh/2fP0AdgDBdMpn1LMqgk0/5vvf6pCe+zp lqPjzFjgPfH72xqoRJAZUC1I/OUYGnL7KerFnT3avyxGGVYcmC5D55YgILJnMxaKLv6Y qtlLXlY1bop0hAX+le5xO8b1VoQTfd+OwpnTfb88r+dgQJK7s5xa65+oWBtVgGIo+X/i 7ygIWTDk9GTKTzUgNdqkd5wpR/oDY2yg4pgbvvKqrHVMMxfB/Ltucgbt2nW0CJ7/I/zz 1yDw== 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:content-transfer-encoding; bh=k9t1av7olujuCjiWRao1+foelfX8Dllx4K3zuzbAp08=; b=rc5TQfKi5Mz6SgrGqbdNMg0vzCOl/tURmL5pFPnpsOqbVfjfEhBhqb+WMNEB1eYMLr DuT3iKCQ4HJHclG7sUPp6gvePcgu5/HhqnpzxAToI/DkJ1TpIEGn07F+km5X7O4st573 gqvptJlZwAdbWljkRzjBdVpnK72cAdxns6nqFybzoCxyLRgT11+0cWtHoHZyXiyAt3oy W+io2vg8KkKgdcQizt/cCTxlfAKHnSAcFx14o+rc+iMZQznrmEeRDShGpJZPgJqa0ubm yF5/KX4hMhflImPOToxlzFq8usx4judPhh0eOdIvZiZH+u64DmNqai0AtzDB9AvVjT+D PZwg== X-Gm-Message-State: AOAM531h9C/o3orfOyBWY+ZZUw6jahjRvuh+bMj7yf7Z8Z4LU/6Cre+W 5Uh0/PPPGtfU+CSbZ2OZLUGMH5b8bI0ZvvUKjps= X-Google-Smtp-Source: ABdhPJyh67EExgFHy7v3gQDCtpSciDMQOcV5rIe3/RzF7i5efyrcTPlNOZ5Mb8YhiDN1XyLAnvP7KrY+FuXfZuTud18= X-Received: by 2002:a25:538a:: with SMTP id h132mr19654496ybb.247.1611228358033; Thu, 21 Jan 2021 03:25:58 -0800 (PST) MIME-Version: 1.0 References: <20210121092026.3261412-1-mudongliangabcd@gmail.com> In-Reply-To: From: =?UTF-8?B?5oWV5Yas5Lqu?= Date: Thu, 21 Jan 2021 19:25:31 +0800 Message-ID: Subject: Re: [PATCH] rt2x00: reset reg earlier in rt2500usb_register_read To: Greg KH Cc: davem@davemloft.net, helmut.schaa@googlemail.com, kvalo@codeaurora.org, linux-kernel , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, sgruszka@redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 21, 2021 at 7:21 PM Greg KH wrote: > > On Thu, Jan 21, 2021 at 06:59:08PM +0800, =E6=85=95=E5=86=AC=E4=BA=AE wro= te: > > > > rt2x00usb_vendor_request_buff(rt2x00dev, USB_MULTI_READ, > > > > USB_VENDOR_REQUEST_IN, offset, > > > > ®, sizeof(reg)); > > > > > > Are you sure this is valid to call this function with a variable on t= he > > > stack like this? How did you test this change? > > > > First, I did not do any changes to this call. Second, the programming > > style to pass the pointer of stack variable as arguments is not really > > good. Third, I check this same code file, there are many code snippets > > with such programming style. :( > > I know you did not change it, what I am asking is how did you test this > change works? I think the kernel will warn you in huge ways that using > this pointer on the stack is incorrect, which implies you did not test > this change :( > I tested this patch only with PoC. The patched kernel version did not crash when executing the PoC. BTW, I did not take notice of the warning information as there are many many warnings in building KMSAN. > thanks, > > greg k-h