Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1720045rwb; Fri, 28 Jul 2023 13:56:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlFbEIRRPewayv4FSejwrLUq9usBrkgWQBxyWyVFkBhX/j84pKdjuqjLDCDinbW2jjH6mL7d X-Received: by 2002:a17:906:8a73:b0:99b:b505:eede with SMTP id hy19-20020a1709068a7300b0099bb505eedemr342029ejc.65.1690577798744; Fri, 28 Jul 2023 13:56:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690577798; cv=none; d=google.com; s=arc-20160816; b=No1zD5SH1NIEu4vDO54Mkn8Ja3lj3yrkNhZ6853UkXq3xURJpIP+kzBIzGxr25tsEl QaXcVcwx8scstxjVbzV99HOY2t7pgXMe64q5MfaiHYEn2byIQOYgKm1UlvIfyVmw5qk2 xnkUhKmbx5PkWG6esQejve84U+dyvlN5AcsVRQPktq5/73f1GayfX3rxBf48AQ4RmK5f lZaHG70hPRsBqa7GENRRx5KpN0qE1mqTVgXxWxKwUoeZjbPIXiHleoO1xoginvgGAVp+ l/ENU68Obm4N3rEp9DJsk+GWbLcDuRps5G2V+oXqfOfoGSAekMsPbDhzcuH5omr5s8BO Y6Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=IVYlyy1phIaXLckqq8rcJcrT6tAP9YEvkh5U2YAuBjA=; fh=Lf33w2+48ylQ8hEeunBTsBAGlU4P5NgQQ+tu4JIo5ZQ=; b=k2u69gB3XOyWFHKE+SSokzFpFEr04ba2DgzeAOZ5zvJ5oqwG0IaYFiG7WagKBey9fw QlQCiBhBj7YrHB1u1dWVb/ZZFykxKMN9kWiAHJdzJVy0fgG4IEGOnofLW7fYwhdHDqFz 8FUTdTpqHdshwhmMv7jK19Q4r9qlY9ynFYAFmBxG8VQj980HY45nAwe6IfxqJZEZVjw7 dUdS9b6sPn2J8Lj6+3psfJG3d5vWhzO9oURfqe4grP6/GXtblGElhdnxBIX4t70Wn9Mw zHxvOhAe6hy5CAKnjMHb0uxiT1sPVPy7JkUDIAv23QspPpLxchHAWMbxtBZnvDeazdvm n7Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=gbxFAICk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l19-20020a170906079300b00992e2779596si3000276ejc.827.2023.07.28.13.56.14; Fri, 28 Jul 2023 13:56:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=gbxFAICk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234691AbjG1ToZ (ORCPT + 99 others); Fri, 28 Jul 2023 15:44:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234612AbjG1ToY (ORCPT ); Fri, 28 Jul 2023 15:44:24 -0400 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42AAD3C07 for ; Fri, 28 Jul 2023 12:44:23 -0700 (PDT) Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-78706966220so24602139f.1 for ; Fri, 28 Jul 2023 12:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1690573462; x=1691178262; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=IVYlyy1phIaXLckqq8rcJcrT6tAP9YEvkh5U2YAuBjA=; b=gbxFAICkUa/e7YZ60wNF06DmZ9EZ5eTjiwhQrucRQ4mWWAAWg3UGTbAC5bzenvxANC DygyMU802VySwy1Gt+ry6yeNZcqZTl0/N4m47KcwL1CB66nZfXBQCF5cwvAWSGA5lU84 I8n84qDcqRRotzCACQXhPYr4dFSs9DTZqpJaU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690573462; x=1691178262; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IVYlyy1phIaXLckqq8rcJcrT6tAP9YEvkh5U2YAuBjA=; b=FpSDT7mYqVTuuiiBtCE52zvj7BuCneauO9NNYBUcpNF2acvSjh04vixFkqntZCEt/F KT2RphdhCnoPGbu8WuiNL2Hk1XEdfYFMd8jjIBO0lNT63mYInt/FDDfKmlp+9klf+q+6 7ubJV2LGSgxMmGadF9GcNrmh3TQz/9dPUhVj9I5YhME8pe1bVx21twT4pW8X8/ske2pw nUt52Td1GrrQLgkMsv+GMwUUNU8pFE2H53mKgdgyyzVkG0OOwyzMWd6ze+ofU+CL376Q QPcjSOEYVIxeX8jrKriIMF6W9xKhSomUbMDOmL8R+178neHEsecH64j8O+Y4FoLUWvwk PnOQ== X-Gm-Message-State: ABy/qLapavG68QFcUOsT8VRZ3BjgpBzikpi55eVfCgm9GrmzjEy6d+5Z iltCzGjMb7IrWl/DvnNMsly3XA== X-Received: by 2002:a6b:c9d3:0:b0:788:2d78:813c with SMTP id z202-20020a6bc9d3000000b007882d78813cmr575240iof.0.1690573462600; Fri, 28 Jul 2023 12:44:22 -0700 (PDT) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id f19-20020a056638119300b0042b31920313sm1299632jas.9.2023.07.28.12.44.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Jul 2023 12:44:22 -0700 (PDT) Message-ID: Date: Fri, 28 Jul 2023 13:44:21 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH next 3/3] selftests:connector: Add root check and fix arg error paths to skip Content-Language: en-US To: Anjali Kulkarni Cc: Shuah Khan , Liam Howlett , "kuba@kernel.org" , "davem@davemloft.net" , "linux-kselftest@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Shuah Khan References: <2c0ac97f9c8e6bd46b60854c136099c0dd4a09f6.1690564372.git.skhan@linuxfoundation.org> <0CB227BA-69FD-447F-BE73-2482A6998F7E@oracle.com> <5b283f3b-f176-7f19-5db0-1332a94a44be@linuxfoundation.org> From: Shuah Khan In-Reply-To: <5b283f3b-f176-7f19-5db0-1332a94a44be@linuxfoundation.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/28/23 13:06, Shuah Khan wrote: > On 7/28/23 12:10, Anjali Kulkarni wrote: >> >> >>> On Jul 28, 2023, at 10:29 AM, Shuah Khan wrote: >>> >>> proc_filter test requires root privileges. Add root privilege check >>> and skip the test. Also fix argument parsing paths to skip in their >>> error legs. >>> >>> Signed-off-by: Shuah Khan >>> --- >>> tools/testing/selftests/connector/proc_filter.c | 9 +++++++-- >>> 1 file changed, 7 insertions(+), 2 deletions(-) >>> >>> diff --git a/tools/testing/selftests/connector/proc_filter.c b/tools/testing/selftests/connector/proc_filter.c >>> index 4fe8c6763fd8..7b2081b98e5c 100644 >>> --- a/tools/testing/selftests/connector/proc_filter.c >>> +++ b/tools/testing/selftests/connector/proc_filter.c >>> @@ -248,7 +248,7 @@ int main(int argc, char *argv[]) >>> >>>     if (argc > 2) { >>>         printf("Expected 0(assume no-filter) or 1 argument(-f)\n"); >>> -        exit(1); >>> +        exit(KSFT_SKIP); >>>     } >>> >>>     if (argc == 2) { >>> @@ -256,10 +256,15 @@ int main(int argc, char *argv[]) >>>             filter = 1; >>>         } else { >>>             printf("Valid option : -f (for filter feature)\n"); >>> -            exit(1); >>> +            exit(KSFT_SKIP); >>>         } >>>     } >>> >>> +    if (geteuid()) { >>> +        printf("Connector test requires root privileges.\n"); >>> +        exit(KSFT_SKIP); >>> +    } >>> + >> >> I am not sure why you have added this check? proc_filter does not need root privilege to run. >> > > It failed for me when I ran it saying it requires root privileges. > I had to run it as root. > The following is what I see when I run the test as non-root user: bind failed: Operation not permitted thanks, -- Shuah