From patchwork Thu May 2 15:16:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 2512881 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 1DA4E3FCA5 for ; Thu, 2 May 2013 17:13:55 +0000 (UTC) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UXvNc-0002lm-OE; Thu, 02 May 2013 15:25:16 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UXvGm-0002VT-Ef; Thu, 02 May 2013 15:18:04 +0000 Received: from moutng.kundenserver.de ([212.227.17.9]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UXvFP-0002Hz-Ab for linux-arm-kernel@lists.infradead.org; Thu, 02 May 2013 15:16:47 +0000 Received: from wuerfel.lan (HSI-KBW-095-208-002-043.hsi5.kabel-badenwuerttemberg.de [95.208.2.43]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0LcaOp-1U8FOC2Qx5-00k7fQ; Thu, 02 May 2013 17:16:15 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org Subject: [PATCH, RFC 13/22] staging/logger: use kuid_t internally Date: Thu, 2 May 2013 17:16:17 +0200 Message-Id: <1367507786-505303-14-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1367507786-505303-1-git-send-email-arnd@arndb.de> References: <1367507786-505303-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:IqbPbm99fHdl6tiswpaYgtm6k8I/PgVLopF1TX9/noj T2r+ACKeaGuMQzPkTREWbMx9fBclsBD39oJKiDq2mvFOhhR0bj xnq2Si/au7UMTcTpoC1kWjYW/Hi8JG87T8y+BGaDaBF5S4Irmx b/CL8z48dCqMosL3EAVRs2P4dwBivQmXDYWE2JyF8Xg0pJSnZw vE5LYT1z2wkq/2Klh4s1jRjGiGCjnvtRQlI7+VAz4+suFM4lDS gFJkRtd1woYe3LhfeX64EXL5hvD8ux4ZPfKxEw9EbTq+o1jQHz Jk3S67omGNilSiwRsz/W2JMt+8aTfKgbVZaDYRUL+JCrkJtuK4 cnyGyhIuMrcQkZtqJRclDSFZiMe8LWmU5VxIFc95c X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130502_111640_036596_E2C5ACF0 X-CRM114-Status: GOOD ( 10.13 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.9 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Arnd Bergmann , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This is probably wrong but lets us build the driver with CONFIG_UIDGID_STRICT_TYPE_CHECKS enabled. Without it, we get these errors: drivers/staging/android/logger.c: In function 'logger_read': drivers/staging/android/logger.c:316:4: error: incompatible type for argument 3 of 'get_next_entry_by_uid' drivers/staging/android/logger.c:244:15: note: expected 'uid_t' but argument is of type 'kuid_t' drivers/staging/android/logger.c: In function 'logger_aio_write': drivers/staging/android/logger.c:483:14: error: incompatible types when assigning to type 'uid_t' from type 'kuid_t' which tells us that the driver is not compatible with user namespaces. Signed-off-by: Arnd Bergmann --- drivers/staging/android/logger.c | 4 ++-- drivers/staging/android/logger.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c index b040200..9bd8747 100644 --- a/drivers/staging/android/logger.c +++ b/drivers/staging/android/logger.c @@ -242,7 +242,7 @@ static ssize_t do_read_log_to_user(struct logger_log *log, * 'log->buffer' which contains the first entry readable by 'euid' */ static size_t get_next_entry_by_uid(struct logger_log *log, - size_t off, uid_t euid) + size_t off, kuid_t euid) { while (off != log->w_off) { struct logger_entry *entry; @@ -251,7 +251,7 @@ static size_t get_next_entry_by_uid(struct logger_log *log, entry = get_entry_header(log, off, &scratch); - if (entry->euid == euid) + if (uid_eq(entry->euid, euid)) return off; next_len = sizeof(struct logger_entry) + entry->len; diff --git a/drivers/staging/android/logger.h b/drivers/staging/android/logger.h index cc6bbd9..70af7d8 100644 --- a/drivers/staging/android/logger.h +++ b/drivers/staging/android/logger.h @@ -66,7 +66,7 @@ struct logger_entry { __s32 tid; __s32 sec; __s32 nsec; - uid_t euid; + kuid_t euid; char msg[0]; };