From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A97FFC43217 for ; Sun, 15 May 2022 19:42:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-662-YWiPkq2aM2eKrTfouuF1AA-1; Sun, 15 May 2022 15:42:38 -0400 X-MC-Unique: YWiPkq2aM2eKrTfouuF1AA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 268F91C05B04; Sun, 15 May 2022 19:42:37 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 145BD9E75; Sun, 15 May 2022 19:42:37 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AC6A41947B89; Sun, 15 May 2022 19:42:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D35E1194704E for ; Sat, 14 May 2022 21:15:41 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C5AF440CF8FB; Sat, 14 May 2022 21:15:41 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C1DF540CF8F7 for ; Sat, 14 May 2022 21:15:41 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AB81B85A5A8 for ; Sat, 14 May 2022 21:15:41 +0000 (UTC) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-185-AGDrOlhtOViAvCc_caHUSw-1; Sat, 14 May 2022 17:15:30 -0400 X-MC-Unique: AGDrOlhtOViAvCc_caHUSw-1 Received: by mail-pg1-f178.google.com with SMTP id v10so10616567pgl.11; Sat, 14 May 2022 14:15:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LJelr6XDvO4AfkGbdbA8Y7Zx3lre1EHsyNEOn4pLeLU=; b=EtRivad7xpGk5u4uuLzi9e6n/bs7O4o7wJI/iS9HPCw7YtVHUG1gcdGH6HZzeYd+sH D/FdSIHT0D/iIN4gXzv6IShaDdodrgsoUwYF6QVfd+z1IAp0OWGud7LOIhgAQ3QpG6VC XFXzbCUVPJk6J0wOmqJg3CZehkYZ/vSWNuCAS9n65A3Ulf2C7ERbuGSFC2bVZfETjKCB HjjedR7x8m7iSw5/FyBI/wn3rIT0pVMnZmhsw1KECbkCP7TNJVioSRq7cNFT6MgQ7FiN rGw8lnp7WNXvx36rNQFRD39ppkQ6iva69vlGo3+g17GcVqgCOMQlAwhh56t+UVldD5Xx Ncqg== X-Gm-Message-State: AOAM533nYPHrTd1Vcig2gt8jMVpuWPDq8jvqmqmvSu9MfO9742gfAWRL J7GU4tCbb26mLvm+OAlkixc= X-Google-Smtp-Source: ABdhPJzBCRSbfTahTJctvLOdUPn+sjf+y+xgMS/nNJHGd5ElaeH1wFlzitlLHOMl7bwoRBwJzao7kQ== X-Received: by 2002:a05:6a00:1582:b0:510:4e67:31d7 with SMTP id u2-20020a056a00158200b005104e6731d7mr10806792pfk.80.1652562929330; Sat, 14 May 2022 14:15:29 -0700 (PDT) Received: from f34-buildvm.eng.vmware.com ([66.170.99.2]) by smtp.googlemail.com with ESMTPSA id e35-20020a635023000000b003db141a5f26sm3826825pgb.1.2022.05.14.14.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 May 2022 14:15:29 -0700 (PDT) From: Shreenidhi Shedi X-Google-Original-From: Shreenidhi Shedi To: arnd@arndb.de, gregkh@linuxfoundation.org, paul@paul-moore.com, eparis@redhat.com Subject: [PATCH 4/5] audit: remove redundant data_len check Date: Sun, 15 May 2022 02:44:54 +0530 Message-Id: <20220514211455.284782-4-sshedi@vmware.com> In-Reply-To: <20220514211455.284782-1-sshedi@vmware.com> References: <20220514211455.284782-1-sshedi@vmware.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mailman-Approved-At: Sun, 15 May 2022 19:42:31 +0000 X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-audit@redhat.com, linux-kernel@vger.kernel.org, Shreenidhi Shedi , yesshedi@gmail.com Errors-To: linux-audit-bounces@redhat.com Sender: "Linux-audit" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=linux-audit-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Signed-off-by: Shreenidhi Shedi --- kernel/audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/audit.c b/kernel/audit.c index 7690c29d4ee4..0749211d5552 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -1390,7 +1390,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) str); } else { audit_log_format(ab, " data="); - if (data_len > 0 && str[data_len - 1] == '\0') + if (str[data_len - 1] == '\0') data_len--; audit_log_n_untrustedstring(ab, str, data_len); } -- 2.36.1 -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46DF1C433EF for ; Sat, 14 May 2022 21:15:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235209AbiENVPl (ORCPT ); Sat, 14 May 2022 17:15:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230064AbiENVPb (ORCPT ); Sat, 14 May 2022 17:15:31 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2D382558D for ; Sat, 14 May 2022 14:15:29 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id x8so7215674pgr.4 for ; Sat, 14 May 2022 14:15:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LJelr6XDvO4AfkGbdbA8Y7Zx3lre1EHsyNEOn4pLeLU=; b=OGUdMpgjlBgy7v6jB35voX+Z4PH9UheaSl/oL8e6co97wmxzZKUofJtexjXamGiOpr i2+X3QOdWHWZaxlsOoWHS7CUnEgna/03I/WJa14mwjTy5Qo42TyBk6RK2h1os/KJqtGp Aiir1H43xL+RxWgOxze88ANgsr2i8Q49ls3ylxpKCc1sgRC6Pn8JSb/Bfy1rGd3sfNIX r9Qr1CG2ExyFULcq4xyE0PbQYKQB6Py65bqTgEYgiw56vtYuWSWblJKEmczPetbL/lA6 Ai1jlOS9wOpY/VzW1H40M2ELBZ4y5ZBbe4GbLiFqRUvo0SJv18ANN0s7pFw6DWQmxGM4 suQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LJelr6XDvO4AfkGbdbA8Y7Zx3lre1EHsyNEOn4pLeLU=; b=BTsWtYnnOVBaejQQnpWEJ/l2iPMDXIUwhr/34a2qIlF9aRBDJPwYySdi7QuA9al8vr IySUWaSax0HfYS04VYe7l9oTpCgSoIFLlOQsqxHJSzmmoJrHIHEXcJUDYzS1nmiFlXLW J/gnZoia0LUcuyeEPEJgS3k3uBkGYCLXBeeamtYwHFRRsYMWy4yyEmSy3p9HkEQ54SF3 sMaJo37jhVlj7R2NXzvastZd0/og4fR2+OZ3WMfVjpTfX8ABM6e+8KQdGeXhH5EtgMBi jaFo8rbPsVkpM7/0AnmVwbvvfouNK6g8011pvX44a9B9JuQ+cNezmBnwuDDoWN8zeKvt ywZg== X-Gm-Message-State: AOAM532mMJkNMh1cGO7V8SSyACM29UQWMk9Qy82YAb077+aGXh7vvL7x KRQ3hw6cOANJAK/x8c3mobo= X-Google-Smtp-Source: ABdhPJzBCRSbfTahTJctvLOdUPn+sjf+y+xgMS/nNJHGd5ElaeH1wFlzitlLHOMl7bwoRBwJzao7kQ== X-Received: by 2002:a05:6a00:1582:b0:510:4e67:31d7 with SMTP id u2-20020a056a00158200b005104e6731d7mr10806792pfk.80.1652562929330; Sat, 14 May 2022 14:15:29 -0700 (PDT) Received: from f34-buildvm.eng.vmware.com ([66.170.99.2]) by smtp.googlemail.com with ESMTPSA id e35-20020a635023000000b003db141a5f26sm3826825pgb.1.2022.05.14.14.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 May 2022 14:15:29 -0700 (PDT) From: Shreenidhi Shedi X-Google-Original-From: Shreenidhi Shedi To: arnd@arndb.de, gregkh@linuxfoundation.org, paul@paul-moore.com, eparis@redhat.com Cc: linux-kernel@vger.kernel.org, linux-audit@redhat.com, yesshedi@gmail.com, Shreenidhi Shedi Subject: [PATCH 4/5] audit: remove redundant data_len check Date: Sun, 15 May 2022 02:44:54 +0530 Message-Id: <20220514211455.284782-4-sshedi@vmware.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220514211455.284782-1-sshedi@vmware.com> References: <20220514211455.284782-1-sshedi@vmware.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Shreenidhi Shedi --- kernel/audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/audit.c b/kernel/audit.c index 7690c29d4ee4..0749211d5552 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -1390,7 +1390,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) str); } else { audit_log_format(ab, " data="); - if (data_len > 0 && str[data_len - 1] == '\0') + if (str[data_len - 1] == '\0') data_len--; audit_log_n_untrustedstring(ab, str, data_len); } -- 2.36.1