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 05331C4332F for ; Sun, 15 May 2022 19:42:40 +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-516-Yh4MvhP9MAupGbURkzX5_g-1; Sun, 15 May 2022 15:42:36 -0400 X-MC-Unique: Yh4MvhP9MAupGbURkzX5_g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 746503C021A8; Sun, 15 May 2022 19:42:35 +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 237CB40E7F06; Sun, 15 May 2022 19:42:35 +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 492EB1947063; Sun, 15 May 2022 19:42:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 098191947040 for ; Sat, 14 May 2022 21:15:19 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id ECD8AC1D3AD; Sat, 14 May 2022 21:15:18 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E88FEC15E73 for ; Sat, 14 May 2022 21:15:18 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (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 CCC61811E76 for ; Sat, 14 May 2022 21:15:18 +0000 (UTC) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-552-41UxXOBPP1OZpx39CC_V2g-1; Sat, 14 May 2022 17:15:15 -0400 X-MC-Unique: 41UxXOBPP1OZpx39CC_V2g-1 Received: by mail-pj1-f42.google.com with SMTP id b12so1684360pju.3; Sat, 14 May 2022 14:15:14 -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:mime-version :content-transfer-encoding; bh=MH7QLYCQ/FCDzGPmiLPAinlWef0OZhM6Qty5FlB1d7E=; b=L/nhyru5tsaN7ik4MmJSXQ3rf6Whfre2YUwBoAl4ROasTIHKHV+xh6VvodQiX+yd6C dADB1tRQpCqLUjvWm1CPBX5YAjO7njdwhidOa3lN5YjT0MJm4oSpi+oZj9G8/Z7d7hOP Yf5KiEE2vKZXQaSAGped1TCdLB1OmrhOoGJ4MRRhkBsrOBK0Ezjn1wU/+8oWdOXCqiw9 ZCYX72JB+vQLXrcDvxXbOXko2z44t9dLO3KRtBoH9DL76+jRA8sxhBxtvdpSw34Q3XGh zhIOo4p6Q9rFQ6l+urhglZHJtaEineVvDPZSbyiuBkryiy4z2ZxPPXbzNA38uve8bN9B q9+A== X-Gm-Message-State: AOAM531xBEqR0qgbyE9sOXCfCIVTGW1rXQGgXyACrVfRt4oK0ygO8VEI kqKJFzJ0vWfg+oLrWsbjYP4= X-Google-Smtp-Source: ABdhPJzEUPdvjFTESYYA1LyDQm79XGI5ilYpxTI/ZK+T5HFLnhHIC7TiRj2gB8gY0GmdYuISsC6oNw== X-Received: by 2002:a17:90b:4f8d:b0:1dc:6cca:1d96 with SMTP id qe13-20020a17090b4f8d00b001dc6cca1d96mr22948648pjb.135.1652562913803; Sat, 14 May 2022 14:15:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 May 2022 14:15:13 -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 1/5] char: lp: ensure that index has not exceeded LP_NO Date: Sun, 15 May 2022 02:44:51 +0530 Message-Id: <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.85 on 10.11.54.8 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.84 on 10.11.54.1 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 --- drivers/char/lp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/lp.c b/drivers/char/lp.c index 0e22e3b0a04e..d474d02b6c7f 100644 --- a/drivers/char/lp.c +++ b/drivers/char/lp.c @@ -972,7 +972,7 @@ static void lp_attach(struct parport *port) if (port_num[i] == -1) break; - if (!lp_register(i, port)) + if (i < LP_NO && !lp_register(i, port)) lp_count++; break; -- 2.36.1 -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit