From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752449AbbJLQNB (ORCPT ); Mon, 12 Oct 2015 12:13:01 -0400 Received: from smtprelay0199.hostedemail.com ([216.40.44.199]:39673 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751449AbbJLQM7 (ORCPT ); Mon, 12 Oct 2015 12:12:59 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:1801:2393:2551:2553:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3871:3872:3873:3874:4321:4605:5007:6261:6742:7904:10004:10400:10848:11232:11658:11914:12043:12050:12296:12517:12519:12740:13069:13311:13357:21067:21080:21088:21212,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: noise43_36a9ebaab3717 X-Filterd-Recvd-Size: 2044 Message-ID: <1444666374.9184.1.camel@perches.com> Subject: Re: [PATCH net-next v2 1/2] hisilicon net: removes the once HANDEL_TX_MSG macro From: Joe Perches To: Arnd Bergmann Cc: huangdaode , davem@davemloft.net, liguozhu@hisilicon.com, Yisen.Zhuang@huawei.com, netdev@vger.kernel.org, linuxarm@huawei.com, salil.mehta@huawei.com, kenneth-lee-2012@foxmail.com, xuwei5@hisilicon.com, lisheng011@huawei.com, linux-kernel@vger.kernel.org Date: Mon, 12 Oct 2015 09:12:54 -0700 In-Reply-To: <6398202.hrOAl1xuJE@wuerfel> References: <1444620225-2339-1-git-send-email-huangdaode@hisilicon.com> <1444620225-2339-2-git-send-email-huangdaode@hisilicon.com> <6398202.hrOAl1xuJE@wuerfel> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2015-10-12 at 13:59 +0200, Arnd Bergmann wrote: > On Monday 12 October 2015 11:23:44 huangdaode wrote: > > + s += sprintf(s, > > + "\t\ttx_ring on %p:%u,%u,%u,%u,%u,%llu,%llu\n", > > + h->qs[i]->tx_ring.io_base, [] > There is actually a more significant problem with this code, which I > failed to notice when doing the original bugfix: > > You have a sysfs interface here that exports internal data of the > device that should not be visible like this. One problem is that > the io_base is a kernel pointer that must not be visible to non-root > users (so we don't easily create an attack surface for exploits). Using %pK might have been appropriate. > It would probably be better to completely remove that sysfs interface, and > to use the ethtool netlink interface to export them. But this would be better.