From patchwork Thu Jul 16 03:08:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11666561 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F56D6C1 for ; Thu, 16 Jul 2020 03:09:18 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 7DC1920775 for ; Thu, 16 Jul 2020 03:09:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="FG/kfdhr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7DC1920775 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-19336-patchwork-kernel-hardening=patchwork.kernel.org@lists.openwall.com Received: (qmail 10153 invoked by uid 550); 16 Jul 2020 03:09:06 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 10084 invoked from network); 16 Jul 2020 03:09:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PQ3rS81iCqlQj563UE75aUsx51oFdKIvno+SEEG/FG4=; b=FG/kfdhrrvpgKNO8XoFAw8rMldsyko1xxMQvI4cYzTokOwgJ4VoV67Xp7ZSUwQyuB1 pUGFqZBMP6lpP24GnUWphnxjAPTHxBvHDhawoWy2aIc23UsRgkac0gYVUKAPjXZwMzVH C32IKdA7MiHJNt49J80WqSESe08lPvA2ln4BQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PQ3rS81iCqlQj563UE75aUsx51oFdKIvno+SEEG/FG4=; b=O0TqahgLqS1MVwPRf/A5MZNeuIqFbw7H9SP2C2JXuKnvOwv0Ur6ZJNutRMHrl7SyoZ KBWyuR4os0JXhd3w7Y3O9SfmzfNyC6EWBWoD7HoJfbM3nceaEUIbO4O3KeZ4toW+xE6D Cu2L5CRuhp61fGVPmijBim2u6+Kqcmf3pVGJ0wuEgBvF6PWAuxzBleKwjH4OtTkKUJDQ y0jFLepKne2hxRQo3yBoGiPJk0yWZK2KgZWRBMINzogxM1n6xKj3E6Z5n39OQiJGfF9L 2IVTaI4osbqVmtzC4hOvu/ncJP7RmgGWNGtMPk/xO5PyFsJkD6cLzMaR2EluebwPyxBx mVSw== X-Gm-Message-State: AOAM532gLVezmt74pCY3nU2jDLZom+NRLhPcI53+bgPG1ZLu++dobf1l XVLzCYfRemr6l/CsWYc+pZUKow== X-Google-Smtp-Source: ABdhPJyQqOXVFa0AWxv/APlQyrdA+w7DqHfNJLE5LIIILIY1tjbP6/hW3QXi5M1V5H9nUHof0O9/lw== X-Received: by 2002:a17:902:6181:: with SMTP id u1mr1929724plj.205.1594868933459; Wed, 15 Jul 2020 20:08:53 -0700 (PDT) From: Kees Cook To: Greg Kroah-Hartman Cc: Kees Cook , Thomas Gleixner , Allen Pais , Oscar Carter , Romain Perier , Dmitry Torokhov , Kevin Curtis , "David S. Miller" , Jakub Kicinski , Harald Freudenberger , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Jiri Slaby , Felipe Balbi , Jason Wessel , Daniel Thompson , Douglas Anderson , Mitchell Blank Jr , Julian Wiedmann , Karsten Graul , Ursula Braun , Jaroslav Kysela , Takashi Iwai , Christian Gromm , Nishka Dasgupta , Masahiro Yamada , Stephen Boyd , "Matthew Wilcox (Oracle)" , Wambui Karuga , Guenter Roeck , Chris Packham , Kyungtae Kim , Kuppuswamy Sathyanarayanan , Sebastian Andrzej Siewior , "Rafael J. Wysocki" , Jonathan Corbet , Peter Zijlstra , Will Deacon , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-s390@vger.kernel.org, devel@driverdev.osuosl.org, linux-usb@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net, alsa-devel@alsa-project.org, kernel-hardening@lists.openwall.com Subject: [PATCH 1/3] usb: gadget: udc: Avoid tasklet passing a global Date: Wed, 15 Jul 2020 20:08:45 -0700 Message-Id: <20200716030847.1564131-2-keescook@chromium.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716030847.1564131-1-keescook@chromium.org> References: <20200716030847.1564131-1-keescook@chromium.org> MIME-Version: 1.0 There's no reason for the tasklet callback to set an argument since it always uses a global. Instead, use the global directly, in preparation for converting the tasklet subsystem to modern callback conventions. Signed-off-by: Kees Cook Reviewed-by: Greg Kroah-Hartman Acked-by: Felipe Balbi --- drivers/usb/gadget/udc/snps_udc_core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/snps_udc_core.c b/drivers/usb/gadget/udc/snps_udc_core.c index 3fcded31405a..afdd28f332ce 100644 --- a/drivers/usb/gadget/udc/snps_udc_core.c +++ b/drivers/usb/gadget/udc/snps_udc_core.c @@ -96,9 +96,7 @@ static int stop_pollstall_timer; static DECLARE_COMPLETION(on_pollstall_exit); /* tasklet for usb disconnect */ -static DECLARE_TASKLET(disconnect_tasklet, udc_tasklet_disconnect, - (unsigned long) &udc); - +static DECLARE_TASKLET(disconnect_tasklet, udc_tasklet_disconnect, 0); /* endpoint names used for print */ static const char ep0_string[] = "ep0in"; @@ -1661,7 +1659,7 @@ static void usb_disconnect(struct udc *dev) /* Tasklet for disconnect to be outside of interrupt context */ static void udc_tasklet_disconnect(unsigned long par) { - struct udc *dev = (struct udc *)(*((struct udc **) par)); + struct udc *dev = udc; u32 tmp; DBG(dev, "Tasklet disconnect\n");