Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2919720ybc; Thu, 14 Nov 2019 00:55:35 -0800 (PST) X-Google-Smtp-Source: APXvYqxRHdWTwno0hK8N5hJom3i//OjwRHOGnQs1z26JfIbnNCV7I3TP3uNcBUXyZuDYvHULZrA6 X-Received: by 2002:a17:906:66d2:: with SMTP id k18mr7233762ejp.278.1573721734922; Thu, 14 Nov 2019 00:55:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573721734; cv=none; d=google.com; s=arc-20160816; b=LmaZqBzW/5lyCgqRA1thdWyLey4yK8/JT9057yL6uOLqSssdZPV1RsCBnL5HrHocy8 bUXFngBQRz8C4+dMAM6LBqIdjO9xycLLFiuze10ZcIvuNzu/gEL6o27vlora4l0AqkSE P6K11IUpGfCWg6h0qWUyoQZn0J3bjnh+G74K4RyRydAvmMUJPKx+N9+9wLD7CLbkekBX 6NKw6tFWvhYc4KkRbgXegXCvCfwEsW1jFopiEXAsbzQ6bgpVMTtLDIaJAYHo0xoUSKwj m7bfAa0kwF92JQFCFbB9HJalianpaQ2QwLghrlfomgp1r6XNz5orHrOI1qoYuReraJ5V FLGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=BFTDXu5KLCx/NgGlQEs4Px8yUQfHFzlFH/OlFo2n0ok=; b=rWqQB1zBaBiR8VWqFhwwHgAnmncxGjZYoIV5hG5uEMAAjXO2pK+uUnGyNMel/kxAj7 nX3wy3DOv4Idy25nA153C6u1/gaJphn8wdXoc5mZaltZXXOT/FZXeUXR3KyjR84JEWov hSoIP0/GrY3yu0iC3Y72Mgr2aQknPq1KGDucaDgV6t9hQkbPiXiPIDRVAti7P27zl2Eh MRl8pvhWlIFqfaiRFCo5bh8Hit5Jo70tpnMb/Iow1nV2670raGIMUSa6qfyVS4FlZlfa v5HyuLllyVYG+jgfcqkkjcphMccnEKXMu9DZkFzZAN/G8MkPteZy+0cgqjDRbt3CgvyQ Cjag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QNUlRia8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v20si4048006edc.69.2019.11.14.00.55.10; Thu, 14 Nov 2019 00:55:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QNUlRia8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726505AbfKNIwH (ORCPT + 99 others); Thu, 14 Nov 2019 03:52:07 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:28933 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725976AbfKNIwG (ORCPT ); Thu, 14 Nov 2019 03:52:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573721526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BFTDXu5KLCx/NgGlQEs4Px8yUQfHFzlFH/OlFo2n0ok=; b=QNUlRia8af3RuBF49reGaCHPrQyGuFiTqVqoJ9xc8EfFn14OAOBySPOXbe3frQKpNSJYba 0q9xyqgkVAOZxWa0q28QHoZ6L6Imm3u+jhO/85/zf5dhP+pkpAja3rBHn3ecN+VUENlggy Kt8DfOi1pUnj/3d6r6t0BIfZ84vkuAw= Received: from mail-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-39-gu9VLXS5PGeQUGhCjnDcNg-1; Thu, 14 Nov 2019 03:52:04 -0500 Received: by mail-oi1-f200.google.com with SMTP id q82so2701470oih.14 for ; Thu, 14 Nov 2019 00:52:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XEwBZHA4L5rrNOG3OYpSp+PIcgka4zs8smBH6QqTobU=; b=YSgRlKjhOvg3syA3fkQaN7cUICpI0Wc2x92n2D+AHsDUKYxmSsLEEa5hRTqPgfOily AKM4FkMaKHIOnduBuAT37jW0qSpqcQAkiI2dqySiKqumYCwZXlHRAaw6t/3jEEGQ0Fnj LSPV0yxuRXz7Qykmo4JvsUsRBaGPfSKLNCvAfO9qWMxeKQr5pPFtvOmvkgaNqFasxR0b EtGxqcMvpEsFVM+z2HaKD72ECtjPuj/bhVQzIIs3FMgaJyDEBftUT+dCv/AOY74Ra7i/ lUlEymqegjUiM6R9hR6gcGXEKXqqN7heeRqMSEoK55WgwflnFzq6aemvWRrtXdZNaF6o kXTw== X-Gm-Message-State: APjAAAW3FtQqReEIWV3LOyEJl3oRcgHx340D6HZq7eo/QOJ0Sed/xkea D6d/mlrTJh840sq4DL+SOgoH66+LsVYuNHKEFReuUihmUUdy4yRqQEfof0x4MZyrMkOdkMX+TUS NmSTmglbGjx0qgJgeC3BpZXkhHBW95zkywsSqQTf5 X-Received: by 2002:a05:6808:2d8:: with SMTP id a24mr2573370oid.127.1573721524143; Thu, 14 Nov 2019 00:52:04 -0800 (PST) X-Received: by 2002:a05:6808:2d8:: with SMTP id a24mr2573349oid.127.1573721523827; Thu, 14 Nov 2019 00:52:03 -0800 (PST) MIME-Version: 1.0 References: <20191108210236.1296047-1-arnd@arndb.de> <20191108211323.1806194-11-arnd@arndb.de> In-Reply-To: From: Ondrej Mosnacek Date: Thu, 14 Nov 2019 09:51:52 +0100 Message-ID: Subject: Re: [PATCH 20/23] y2038: move itimer reset into itimer.c To: Arnd Bergmann Cc: y2038 Mailman List , John Stultz , Thomas Gleixner , Paul Moore , Stephen Smalley , Eric Paris , Linux kernel mailing list , Stephen Boyd , Sebastian Andrzej Siewior , Ingo Molnar , Anna-Maria Gleixner , Al Viro , SElinux list X-MC-Unique: gu9VLXS5PGeQUGhCjnDcNg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 11, 2019 at 11:58 AM Arnd Bergmann wrote: > > On Sun, Nov 10, 2019 at 12:07 AM Ondrej Mosnacek wr= ote: > > > > On Sat, Nov 9, 2019 at 10:03 PM Arnd Bergmann wrote: > > > > > > On Sat, Nov 9, 2019 at 2:43 PM Ondrej Mosnacek = wrote: > > > > > > > > -struct itimerval; > > > > > -extern int do_setitimer(int which, struct itimerval *value, > > > > > - struct itimerval *ovalue); > > > > > -extern int do_getitimer(int which, struct itimerval *value); > > > > > +#ifdef CONFIG_POSIX_TIMERS > > > > > +extern void clear_itimer(void); > > > > > +#else > > > > > +static inline void clear_itimer(void) {} > > > > > +#endif > > > > > > > > > > > > > @@ -249,6 +249,17 @@ int do_setitimer(int which, struct itimerval= *value, struct itimerval *ovalue) > > > > > return 0; > > > > > } > > > > > > > > > > +#ifdef CONFIG_SECURITY_SELINUX > > > > > > > > Did you mean "#ifdef CONFIG_POSIX_TIMERS" here to match the header? > > > > > > No, this part is intentional, CONFIG_POSIX_TIMERS already controls > > > whether itimer.c is > > > compiled in the first place, but this function is only needed when ca= lled from > > > the selinux driver. > > > > All right, but you declare the function in time.h even if > > CONFIG_SECURITY_SELINUX is not enabled... it is kind of awkward when > > it can happen that the function is declared but not defined anywhere > > (even if it shouldn't be used by new users). Maybe you could at least > > put the header declaration/definition inside #ifdef > > CONFIG_SECURITY_SELINUX as well so it is clear that this function is > > intended for SELinux only? > > I don't see that as a problem, we rarely put declarations inside of an #i= fdef. > The main effect that would have is forcing any file that includes linux/t= ime.h > to be rebuilt when selinux is turned on or off in the .config. OK, but with this patch if someone tries to use the function elsewhere, the build will succeed if SELinux is enabled in the config, but fail if it isn't. Is that intended? I would suggest at least clearly documenting it above the declaration that the function isn't supposed to be used by new users and doing so will cause build to fail under CONFIG_SECURITY_SELINUX=3Dn. -- Ondrej Mosnacek Software Engineer, Security Technologies Red Hat, Inc.