From patchwork Tue Sep 19 13:53:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9959125 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 383C5601E9 for ; Tue, 19 Sep 2017 13:53:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0882928429 for ; Tue, 19 Sep 2017 13:53:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0C7D285BA; Tue, 19 Sep 2017 13:53:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA6F828429 for ; Tue, 19 Sep 2017 13:53:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751034AbdISNxx (ORCPT ); Tue, 19 Sep 2017 09:53:53 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:35377 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972AbdISNxw (ORCPT ); Tue, 19 Sep 2017 09:53:52 -0400 Received: by mail-pg0-f67.google.com with SMTP id j16so2087174pga.2; Tue, 19 Sep 2017 06:53:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=dxrkRXf/VWqGFvDs+s89xhf4N8DlSzSX3MckWTuka+g=; b=q5/d8fiJ8mv9wXJymFM4XoftdZk7TbE3GXNSgMschRG4iVcR86EJ2KMqG5I59gkhpF M6txR1BhWIdWv8qSSheUgJwvKtq8hFHpf1zvhaY16913//ikm/it6HQGpio6VctlMOXo FyWnCfqhkKAFJiEcJm0CG64bzSbNwEfQacgjU/AATEWNVqABeLFK7uI/D6+UJISW6vxR FiDEuvoVGyWSBUkufE8UO5qr5I9q3rofUx/tHRNmBy5ijhQXz6IHb1R1PNVZ1SVmvTlb Kir9svodHNOhqNagOW1FupmRDD1pJ/cBgvTXrWbYOkZ5nFi/QhXaBAhDXjjk/w9yhktJ elaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dxrkRXf/VWqGFvDs+s89xhf4N8DlSzSX3MckWTuka+g=; b=D/YADJkfQvwh53S0SdFAv6oRGSWLTteYC7vsTIerYqfbxkkX1cifCW5MJ6PN+gxQFI jTVM5laDw4VAenRokJ3MhdiJ6kvsT2i4DCFgIQOzvA5jqXjTq+kDVj+gJLB9OhJM+NV1 XlDKgD6JyxgHHLNhKZ8UxWI4hlCLHVXhR5xF6LFkyahafgq5GwJNRgz2solAoviKQWgj 50TIzKFoRfUSv6n3m/HAG9P7njX90+ii6VZxPFDqEb1f+k4pNqeVwHPt6O7XErnBWGTq mgwIOjQBMjwG3jY03qbVPBx5wD/iBSaC/YAZA9Vhw8qji0Nttis+rYOX4/H6xBMhjG4R V6NQ== X-Gm-Message-State: AHPjjUjHLCFECgXbjPxxl59KYbCyH1rYCsXiQDLtzZBJSgzbnY6bxafx fVZjAhtblL0+AAzJ1OYLjlc= X-Google-Smtp-Source: AOwi7QB9VyqFxzsSy6jfbyk4RRKUUN3IBotQVsR1B3shHyfDl8hlhd1hvzrDYKNsgEYx4ddjxBjjFA== X-Received: by 10.101.78.7 with SMTP id r7mr1458251pgt.64.1505829231411; Tue, 19 Sep 2017 06:53:51 -0700 (PDT) Received: from gmail.com ([117.196.114.162]) by smtp.gmail.com with ESMTPSA id 207sm3768412pfu.0.2017.09.19.06.53.46 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 19 Sep 2017 06:53:50 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Tue, 19 Sep 2017 19:23:43 +0530 From: Bhumika Goyal To: julia.lawall@lip6.fr, john.johansen@canonical.com, james.l.morris@oracle.com, serge@hallyn.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH] apparmor: make allperms structure const Date: Tue, 19 Sep 2017 19:23:19 +0530 Message-Id: <1505829199-6657-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Make this structure const as it is only used as a copy operations in the files referencing it. Add const to the declaration in the header too. Structure found using a Coccinelle script and changes done by hand. Signed-off-by: Bhumika Goyal --- security/apparmor/include/perms.h | 2 +- security/apparmor/lib.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/security/apparmor/include/perms.h b/security/apparmor/include/perms.h index af04d5a..95ac9b6 100644 --- a/security/apparmor/include/perms.h +++ b/security/apparmor/include/perms.h @@ -90,7 +90,7 @@ struct aa_perms { #define ALL_PERMS_MASK 0xffffffff extern struct aa_perms nullperms; -extern struct aa_perms allperms; +extern const struct aa_perms allperms; #define xcheck(FN1, FN2) \ diff --git a/security/apparmor/lib.c b/security/apparmor/lib.c index 8818621..5b2c245 100644 --- a/security/apparmor/lib.c +++ b/security/apparmor/lib.c @@ -25,7 +25,7 @@ #include "include/policy.h" struct aa_perms nullperms; -struct aa_perms allperms = { .allow = ALL_PERMS_MASK, +const struct aa_perms allperms = { .allow = ALL_PERMS_MASK, .quiet = ALL_PERMS_MASK, .hide = ALL_PERMS_MASK };