Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp948837ybz; Wed, 29 Apr 2020 12:14:59 -0700 (PDT) X-Google-Smtp-Source: APiQypJ3HlxGKoqvKtZZm4Gfl6t6SSalmAdytKNL5nn6vK4OPP/GwO7h40334XaPSx+JcFrwn+CG X-Received: by 2002:a50:bb25:: with SMTP id y34mr3796744ede.237.1588187699524; Wed, 29 Apr 2020 12:14:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588187699; cv=none; d=google.com; s=arc-20160816; b=f/RsDNPrMHq9AQ4RJH4NYvvcOHLQE0pz2xEAj/t78NC3WX+Ks0Z9QPdr10rgphscV6 5iTFtcFRS0ECjPnFFvLprgN3ZlQ1WM7cgC5pllkqRIR4u9p6T8+2l/3tRKDHM/JEvZlN MLKM6TXscRgQh4+/+cPI5hFHtk5m2I7IB49EY7muatV3pI7qHCAjOGetWdSfWRlWLpDv m7TkWWM6xptyZyjnuggMdsKE0NUg6boRk5hMkvVCR3WRAQHZkJy0yBUCpibGSpBX/aAv wOUvIymj5paJYXquZq46IAVsRm0r/1OehtaW/3Di1oOY65McfiaqMNGyovYHEzGJHJDH cJxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=EkNjuisVmO6yebm1IvzOca60JxgA1vBd6umZuxaS0+w=; b=SS8oInu5rK/21xmc8SMUVnzsbYt00Q4yNoeK3Nxn+aFmUSDOsMphAHc3KJ5MUFaboU vdaLSHb7R7T1JfC/6Z/ZigLb1L6I91Ly4TlIvZmFGfyXicMfcBDMQVktXKt0v3vIWuC2 GbkIdqmIG2Rdgr988cvWFao87NdNdGSr7bz1a5LiwrUjDMiLC//xj6aD8m2V9p4a9CDI REdv/ky3gMB40GSun8nD0VULjBb+/YEBs4i/LmwddnBq9uY+knZR+gMX6SypgPL8WQsV dxkEWqlyr9dJJ4wAOysc41EfGN33zyr6NROQwZGm5UgeeF69kZZ0payHoZWtoTjtfSxJ uY8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi18si4801337edb.109.2020.04.29.12.14.35; Wed, 29 Apr 2020 12:14:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727078AbgD2TNC (ORCPT + 99 others); Wed, 29 Apr 2020 15:13:02 -0400 Received: from Chamillionaire.breakpoint.cc ([193.142.43.52]:34722 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726456AbgD2TNC (ORCPT ); Wed, 29 Apr 2020 15:13:02 -0400 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1jTs8e-0000MC-7O; Wed, 29 Apr 2020 21:12:56 +0200 Date: Wed, 29 Apr 2020 21:12:56 +0200 From: Florian Westphal To: Arnd Bergmann Cc: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Jakub Kicinski , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] netfilter: nf_osf: avoid passing pointer to local var Message-ID: <20200429191256.GL32392@breakpoint.cc> References: <20200429190051.27993-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200429190051.27993-1-arnd@arndb.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Arnd Bergmann wrote: > gcc-10 points out that a code path exists where a pointer to a stack > variable may be passed back to the caller: > > net/netfilter/nfnetlink_osf.c: In function 'nf_osf_hdr_ctx_init': > cc1: warning: function may return address of local variable [-Wreturn-local-addr] > net/netfilter/nfnetlink_osf.c:171:16: note: declared here > 171 | struct tcphdr _tcph; > | ^~~~~ > > I am not sure whether this can happen in practice, but moving the > variable declaration into the callers avoids the problem. LGTM, thanks Arnd. Reviewed-by: Florian Westphal