lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aEmF5PYpgtsuTu9R@e129823.arm.com>
Date: Wed, 11 Jun 2025 14:34:28 +0100
From: Yeoreum Yun <yeoreum.yun@....com>
To: Mark Brown <broonie@...nel.org>
Cc: catalin.marinas@....com, pcc@...gle.com, will@...nel.org,
	anshuman.khandual@....com, joey.gouly@....com,
	yury.khrustalev@....com, maz@...nel.org, oliver.upton@...ux.dev,
	frederic@...nel.org, akpm@...ux-foundation.org, surenb@...gle.com,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	linux-doc@...r.kernel.org
Subject: Re: [PATCH v6 9/9] kselftest/arm64/mte: add mtefar tests on
 check_mmap_options

Hi Mark,
> On Wed, Jun 11, 2025 at 10:41:07AM +0100, Yeoreum Yun wrote:
>
> > +static int check_anonymous_memory_mapping(int mem_type, int mode, int mapping, int tag_check, int atag_check)
> >  {
> >  	char *ptr, *map_ptr;
> >  	int run, result, map_size;
> > @@ -97,16 +106,16 @@ static int check_anonymous_memory_mapping(int mem_type, int mode, int mapping, i
> >  			munmap((void *)map_ptr, map_size);
> >  			return KSFT_FAIL;
> >  		}
> > -		result = check_mte_memory(ptr, sizes[run], mode, tag_check);
> > +		result = check_mte_memory(ptr, sizes[run], mode, tag_check, atag_check);
> >  		mte_clear_tags((void *)ptr, sizes[run]);
> >  		mte_free_memory((void *)map_ptr, map_size, mem_type, false);
> > -		if (result == KSFT_FAIL)
> > -			return KSFT_FAIL;
> > +		if (result != KSFT_SKIP)
> > +			return result;
> >  	}
>
> This changes the logic to exit the loop immediately if the check passes
> which doesn't seem like what we want, should we instead change the test
> to be:
>
> 	if (result != KSFT_PASS)
>
> which I think is more the intent?

Well, at the time of write, when the check_mte_memory return the "SKIP"
intent is to iterating the next item. But, yes this is meandingless.
I'll change with your suggestion.

>
> > +		result = check_mte_memory(ptr, sizes[run], mode, TAG_CHECK_ON, atag_check);
> >  		mte_free_memory_tag_range((void *)ptr, sizes[run], mem_type, UNDERFLOW, OVERFLOW);
> >  		if (result != KSFT_PASS)
> >  			return KSFT_FAIL;
> > @@ -192,7 +201,7 @@ static int check_clear_prot_mte_flag(int mem_type, int mode, int mapping)
> >  			close(fd);
> >  			return KSFT_FAIL;
> >  		}
>
> Won't this upgrade any skips to fails?

Right. I'll change this.

Thanks!


--
Sincerely,
Yeoreum Yun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ