From patchwork Mon Jul 28 11:31:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rusty Russell X-Patchwork-Id: 4633541 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A51C4C0338 for ; Mon, 28 Jul 2014 11:55:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 415BF20035 for ; Mon, 28 Jul 2014 11:55:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 08B8820172 for ; Mon, 28 Jul 2014 11:55:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752644AbaG1LzX (ORCPT ); Mon, 28 Jul 2014 07:55:23 -0400 Received: from ozlabs.org ([103.22.144.67]:39085 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752583AbaG1LzW (ORCPT ); Mon, 28 Jul 2014 07:55:22 -0400 Received: by ozlabs.org (Postfix, from userid 1011) id C6E8214013F; Mon, 28 Jul 2014 21:55:20 +1000 (EST) From: Rusty Russell To: kbuild test robot Cc: Arnaud Patard , Ben Dooks , linux-fbdev@vger.kernel.org Subject: Re: [rusty:modules-next 4/7] include/linux/sysfs.h:75:12: note: in expansion of macro 'VERIFY_OCTAL_PERMISSIONS' In-Reply-To: <53d500f5.nEHcF1Z0S/MA1ieN%fengguang.wu@intel.com> References: <53d500f5.nEHcF1Z0S/MA1ieN%fengguang.wu@intel.com> User-Agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Mon, 28 Jul 2014 21:01:27 +0930 Message-ID: <87k36xwwhc.fsf@rustcorp.com.au> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Thanks robot! Looks like drivers/video/fbdev/s3c2410fb.c has a world-writable debug file. If you really want this I'll have to make an exception, otherwise, please ack this patch: drivers/video/fbdev/s3c2410fb.c: don't make debug world-writable. We don't want random users to be able to spam the logs, and commit 37549e94c77a94a9c32b5ae3313a3801cb66adf9 (sysfs: disallow world-writable files.) finally makes this a build error. Signed-off-by: Rusty Russell . Cheers, Rusty. kbuild test robot writes: > tree: git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux.git modules-next > head: 2e3a10a1551d6ceea005e6a62ca58183b8976217 > commit: 37549e94c77a94a9c32b5ae3313a3801cb66adf9 [4/7] sysfs: disallow world-writable files. > config: make ARCH=arm s3c2410_defconfig > > All warnings: > > In file included from include/linux/thread_info.h:11:0, > from include/asm-generic/preempt.h:4, > from arch/arm/include/generated/asm/preempt.h:1, > from include/linux/preempt.h:18, > from include/linux/spinlock.h:50, > from include/linux/seqlock.h:35, > from include/linux/time.h:5, > from include/linux/stat.h:18, > from include/linux/module.h:10, > from drivers/video/fbdev/s3c2410fb.c:16: > include/linux/bug.h:33:45: error: negative width in bit-field '' > #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) > ^ > include/linux/kernel.h:853:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO' > BUILD_BUG_ON_ZERO((perms) & 2) + \ > ^ >>> include/linux/sysfs.h:75:12: note: in expansion of macro 'VERIFY_OCTAL_PERMISSIONS' > .mode = VERIFY_OCTAL_PERMISSIONS(_mode) }, \ > ^ >>> include/linux/device.h:539:45: note: in expansion of macro '__ATTR' > struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) > ^ >>> drivers/video/fbdev/s3c2410fb.c:619:8: note: in expansion of macro 'DEVICE_ATTR' > static DEVICE_ATTR(debug, 0666, s3c2410fb_debug_show, s3c2410fb_debug_store); > ^ > > vim +/VERIFY_OCTAL_PERMISSIONS +75 include/linux/sysfs.h > > 6992f533 Eric W. Biederman 2010-02-11 59 > ^1da177e Linus Torvalds 2005-04-16 60 struct attribute_group { > 59f69015 Tejun Heo 2007-09-20 61 const char *name; > 587a1f16 Al Viro 2011-07-23 62 umode_t (*is_visible)(struct kobject *, > d4acd722 James Bottomley 2007-10-31 63 struct attribute *, int); > 59f69015 Tejun Heo 2007-09-20 64 struct attribute **attrs; > 6ab9cea1 Greg Kroah-Hartman 2013-07-14 65 struct bin_attribute **bin_attrs; > ^1da177e Linus Torvalds 2005-04-16 66 }; > ^1da177e Linus Torvalds 2005-04-16 67 > ^1da177e Linus Torvalds 2005-04-16 68 /** > ^1da177e Linus Torvalds 2005-04-16 69 * Use these macros to make defining attributes easier. See include/linux/device.h > ^1da177e Linus Torvalds 2005-04-16 70 * for examples.. > ^1da177e Linus Torvalds 2005-04-16 71 */ > ^1da177e Linus Torvalds 2005-04-16 72 > 5da5c9c8 Greg Kroah-Hartman 2013-08-21 73 #define __ATTR(_name, _mode, _show, _store) { \ > 58f86cc8 Rusty Russell 2014-03-24 74 .attr = {.name = __stringify(_name), \ > 58f86cc8 Rusty Russell 2014-03-24 @75 .mode = VERIFY_OCTAL_PERMISSIONS(_mode) }, \ > aa01aa3c Oliver Schinagl 2013-07-14 76 .show = _show, \ > aa01aa3c Oliver Schinagl 2013-07-14 77 .store = _store, \ > ^1da177e Linus Torvalds 2005-04-16 78 } > ^1da177e Linus Torvalds 2005-04-16 79 > aa01aa3c Oliver Schinagl 2013-07-14 80 #define __ATTR_RO(_name) { \ > aa01aa3c Oliver Schinagl 2013-07-14 81 .attr = { .name = __stringify(_name), .mode = S_IRUGO }, \ > aa01aa3c Oliver Schinagl 2013-07-14 82 .show = _name##_show, \ > ^1da177e Linus Torvalds 2005-04-16 83 } > > :::::: The code at line 75 was first introduced by commit > :::::: 58f86cc89c3372d3e61d5b71e5513ec5a0b02848 VERIFY_OCTAL_PERMISSIONS: stricter checking for sysfs perms. > > :::::: TO: Rusty Russell > :::::: CC: Rusty Russell > > --- > 0-DAY kernel build testing backend Open Source Technology Center > http://lists.01.org/mailman/listinfo/kbuild Intel Corporation --- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/fbdev/s3c2410fb.c b/drivers/video/fbdev/s3c2410fb.c index 81af5a63e9e1..6796d9d6c871 100644 --- a/drivers/video/fbdev/s3c2410fb.c +++ b/drivers/video/fbdev/s3c2410fb.c @@ -616,7 +616,7 @@ static int s3c2410fb_debug_store(struct device *dev, return len; } -static DEVICE_ATTR(debug, 0666, s3c2410fb_debug_show, s3c2410fb_debug_store); +static DEVICE_ATTR(debug, 0664, s3c2410fb_debug_show, s3c2410fb_debug_store); static struct fb_ops s3c2410fb_ops = { .owner = THIS_MODULE,