Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp36029imu; Thu, 24 Jan 2019 19:14:33 -0800 (PST) X-Google-Smtp-Source: ALg8bN73dOQtw2VkxxcwEPkihgeNaQEsGS1C4SqsZbFFK0UPPckg5yIWIqGiz7g3yYr7ViNaCWWo X-Received: by 2002:a63:d747:: with SMTP id w7mr8217582pgi.360.1548386073324; Thu, 24 Jan 2019 19:14:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548386073; cv=none; d=google.com; s=arc-20160816; b=uiARZAd91Yw+CNdTB3RgYzGuPOm2Owia5tOKmu2qkEMaHizipB6BEHKfKg7xU0bi54 Qf4VR+Tsy6YaH13/jY+ZfMUjsvH4xxoraFtSwHTmidUxMonqDxYDm3JA22xETlnKHbO1 SOMZk7f6wgHTC6MvU6OWt2cLqNo+rDNqRpa/MfHkwnNhJ4KbFcmupRk8t3KPb9szw4DE e3WluX2kV3lJ89BXT6dP7ZOm/1/yoh89hWCOF7xitCAVUvmwQkzouGwy629FeAOsA4aD SMZdI06MjFJbAsAbcbDZDZU2txsK9QHJqVxARVHq4ZgdrZ+1Ofdl4vYIXvlSwjyaAINW lsMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=w8ta0RrtTEnHTNvflMGm2gLEJJUhaEuuAVTXf9p/XFk=; b=itqOL/IL5ZFBZkxmwtx20AjQSsFxONCml7SVvu9ZtO1KrtWDoVCGpEraeu+RrkyAKb L0T046UW+s+1vSwxKB1cywGlNCtgtufZtf/UIJkCK0n1/kJnQ+NPn5MlT0PF/xy+J98d SoU4sgO/THG4LJCwAmXrnyXBe+fcA8nf91lchbkr/g6G37UnunyMQaDjMCkwcrb7RIR/ aIQoiYhbP89eKu8Jc93l1xZPdkpqIPxT/H2Wcg3y78XfXjK1mwOQ6u6lqHTGklqXShbs PxVpilyYX6g4f1t0pZCf4Q20lAPPhxPKDPq+0P0ykTeeHYeVPwk08jPimhPKasCfB4S3 9J1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=sweZFUxy; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b11si23909997pfo.240.2019.01.24.19.14.18; Thu, 24 Jan 2019 19:14:33 -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=@yahoo.com header.s=s2048 header.b=sweZFUxy; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728420AbfAYDOF (ORCPT + 99 others); Thu, 24 Jan 2019 22:14:05 -0500 Received: from sonic312-28.consmr.mail.bf2.yahoo.com ([74.6.128.90]:41050 "EHLO sonic312-28.consmr.mail.bf2.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728339AbfAYDOD (ORCPT ); Thu, 24 Jan 2019 22:14:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1548386042; bh=w8ta0RrtTEnHTNvflMGm2gLEJJUhaEuuAVTXf9p/XFk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=sweZFUxy1MilKcOQ3wr551PC40XtOk7gmb8oTOo12P5C7GN22IDJ4ucdeUbPkQYl7Zoqsm/pA96lDjSAp7s8IAPTKXvaunrwy/ps2vgNVyJGaIKDnR2oEg91u4UOH92Qmmel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zBjUacLGAfsoOrc2Q_5p9yIVbfYCqbF8yjkCA098Irp.P3.KtcSqjWCD Vy0pur54SW6PmBAHfzFX8KeZs4bbbqcBmE7PSF3iAM5pV3QvEQPY3_YarWQGcDKCP28odDmZMM3G zZeOaC3slIP.7Xqdgz0KbJsImCXQWU8f8eWdt3UdMTBopkIeClucCcXMqeaSGM1a6My53.1RwVLx xFPPBb18w4QSYOlbH9UTXmpEYplgRI10HQdQHkPQY5HLUoDMtJrzGQXC142KJsKqqgkKJeiDDsjx ZFM.W9xBEdwPDk_kt7lznbWn85tILOlc0nv.AqZYF Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.bf2.yahoo.com with HTTP; Fri, 25 Jan 2019 03:14:02 +0000 Received: from 202.36.179.100 (EHLO [10.193.2.218]) ([202.36.179.100]) by smtp417.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID fbf0cee7abaadf9895f2ada916badca5; Fri, 25 Jan 2019 03:14:01 +0000 (UTC) Subject: Re: [PATCH] security: mark expected switch fall-throughs To: "Gustavo A. R. Silva" , John Johansen , James Morris , "Serge E. Hallyn" , Mimi Zohar , Dmitry Kasatkin Cc: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org References: <20190125025639.GA13946@embeddedor> From: Casey Schaufler Message-ID: Date: Thu, 24 Jan 2019 19:13:58 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190125025639.GA13946@embeddedor> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/24/2019 6:56 PM, Gustavo A. R. Silva wrote: > In preparation to enabling -Wimplicit-fallthrough, mark switch > cases where we are expecting to fall through. > > This patch fixes the following warnings: > > security/integrity/ima/ima_appraise.c:116:26: warning: this statement may fall through [-Wimplicit-fallthrough=] > security/integrity/ima/ima_template_lib.c:85:10: warning: this statement may fall through [-Wimplicit-fallthrough=] > security/integrity/ima/ima_policy.c:940:18: warning: this statement may fall through [-Wimplicit-fallthrough=] > security/integrity/ima/ima_policy.c:943:7: warning: this statement may fall through [-Wimplicit-fallthrough=] > security/integrity/ima/ima_policy.c:972:21: warning: this statement may fall through [-Wimplicit-fallthrough=] > security/integrity/ima/ima_policy.c:974:7: warning: this statement may fall through [-Wimplicit-fallthrough=] > security/smack/smack_lsm.c:3391:9: warning: this statement may fall through [-Wimplicit-fallthrough=] > security/apparmor/domain.c:569:6: warning: this statement may fall through [-Wimplicit-fallthrough=] > > Warning level 3 was used: -Wimplicit-fallthrough=3 > > This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. > > Signed-off-by: Gustavo A. R. Silva Acked-by: Casey Schaufler Ug. It can't be part of a greater comment? Grumble. > --- > security/apparmor/domain.c | 2 +- > security/integrity/ima/ima_appraise.c | 1 + > security/integrity/ima/ima_policy.c | 4 ++++ > security/integrity/ima/ima_template_lib.c | 1 + > security/smack/smack_lsm.c | 3 +-- > 5 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c > index 726910bba84b..c7c619578095 100644 > --- a/security/apparmor/domain.c > +++ b/security/apparmor/domain.c > @@ -572,7 +572,7 @@ static struct aa_label *x_to_label(struct aa_profile *profile, > stack = NULL; > break; > } > - /* fall through to X_NAME */ > + /* fall through - to X_NAME */ > case AA_X_NAME: > if (xindex & AA_X_CHILD) > /* released by caller */ > diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c > index a2baa85ea2f5..57daf30fb7d4 100644 > --- a/security/integrity/ima/ima_appraise.c > +++ b/security/integrity/ima/ima_appraise.c > @@ -114,6 +114,7 @@ static void ima_set_cache_status(struct integrity_iint_cache *iint, > break; > case CREDS_CHECK: > iint->ima_creds_status = status; > + /* fall through */ > case FILE_CHECK: > case POST_SETATTR: > iint->ima_file_status = status; > diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c > index 8bc8a1c8cb3f..122797023bdb 100644 > --- a/security/integrity/ima/ima_policy.c > +++ b/security/integrity/ima/ima_policy.c > @@ -938,10 +938,12 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry) > case Opt_uid_gt: > case Opt_euid_gt: > entry->uid_op = &uid_gt; > + /* fall through */ > case Opt_uid_lt: > case Opt_euid_lt: > if ((token == Opt_uid_lt) || (token == Opt_euid_lt)) > entry->uid_op = &uid_lt; > + /* fall through */ > case Opt_uid_eq: > case Opt_euid_eq: > uid_token = (token == Opt_uid_eq) || > @@ -970,9 +972,11 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry) > break; > case Opt_fowner_gt: > entry->fowner_op = &uid_gt; > + /* fall through */ > case Opt_fowner_lt: > if (token == Opt_fowner_lt) > entry->fowner_op = &uid_lt; > + /* fall through */ > case Opt_fowner_eq: > ima_log_string_op(ab, "fowner", args[0].from, > entry->fowner_op); > diff --git a/security/integrity/ima/ima_template_lib.c b/security/integrity/ima/ima_template_lib.c > index 43752002c222..513b457ae900 100644 > --- a/security/integrity/ima/ima_template_lib.c > +++ b/security/integrity/ima/ima_template_lib.c > @@ -83,6 +83,7 @@ static void ima_show_template_data_ascii(struct seq_file *m, > /* skip ':' and '\0' */ > buf_ptr += 2; > buflen -= buf_ptr - field_data->data; > + /* fall through */ > case DATA_FMT_DIGEST: > case DATA_FMT_HEX: > if (!buflen) > diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c > index fa98394a40d0..127aa6c58e34 100644 > --- a/security/smack/smack_lsm.c > +++ b/security/smack/smack_lsm.c > @@ -3391,13 +3391,12 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode) > */ > final = &smack_known_star; > /* > - * Fall through. > - * > * If a smack value has been set we want to use it, > * but since tmpfs isn't giving us the opportunity > * to set mount options simulate setting the > * superblock default. > */ > + /* Fall through */ > default: > /* > * This isn't an understood special case.