Bug 1988283

Summary: [covscan] gssd/krb5_util.c fix the newly introduced defects invalid_type
Product: Red Hat Enterprise Linux 8 Reporter: Yongcheng Yang <yoyang>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.5CC: xzhou
Target Milestone: betaKeywords: Patch, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nfs-utils-2.3.3-48.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1999476 2025386 (view as bug list) Environment:
Last Closed: 2022-05-10 15:20:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2025386    

Description Yongcheng Yang 2021-07-30 09:20:53 UTC
Description of problem:
Then new version nfs-utils-2.3.3-44.el8 via bz1961056 introduces 2 more defects which looks like need to be fix. Please help have a look and check them.

https://cov01.lab.eng.brq.redhat.com/covscanhub/waiving/76192/206104/#defects

The first one:
 1. nfs-utils-2.3.3/utils/gssd/krb5_util.c:651: invalid_type: Argument "outhost" to format specifier "%0lx" was expected to have type "unsigned long" but has type "char *". 
 1. nfs-utils-2.3.3/utils/gssd/krb5_util.c:650: missing_argument: No argument for format specifier "%s". 

#   648|   
#   649|   	if (get_verbosity() && strcmp(inhost, outhost))
#   650|-> 		printerr(1, "%s(0x%0lx): inhost '%s' different than outhost'%s'\n", 
#   651|->   			inhost, outhost);
#   652|   


The second one:
 1. nfs-utils-2.3.3/utils/gssd/krb5_util.c:400: incompatible_cast: Pointer "&ple->endtime" points to an object whose effective type is "int" (32 bits, signed) but is dereferenced as a wider "long" (64 bits, signed). This may lead to memory corruption. 

#   398|   	if (ple->ccname && ple->endtime > now && !nocache) {
#   399|   		printerr(3, "%s(0x%lx): Credentials in CC '%s' are good until %s",
#   400|-> 			 __func__, tid, ple->ccname, ctime((time_t *)&ple->endtime));
#   401|   		code = 0;
#   402|   		pthread_mutex_unlock(&ple_lock);


Version-Release number of selected component (if applicable):
nfs-utils-2.3.3-46.el8

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Steve Dickson 2021-11-03 19:41:22 UTC
commit cfe41d6f06af0e7744c1ca30503f93d28aca4d8b
Author: NeilBrown <neilb>
Date:   Tue Sep 21 12:47:10 2021 -0400

    gssd: fix crash in debug message.

Comment 4 Yongcheng Yang 2021-11-10 02:15:31 UTC
(In reply to Yongcheng Yang from comment #0)
> Description of problem:
> Then new version nfs-utils-2.3.3-44.el8 via bz1961056 introduces 2 more
> defects which looks like need to be fix. Please help have a look and check
> them.
> 
> https://cov01.lab.eng.brq.redhat.com/covscanhub/waiving/76192/206104/#defects
> 

Compared with the new version nfs-utils-2.3.3-48.el8:
https://cov01.lab.eng.brq.redhat.com/covscanhub/waiving/83005/225919/#defects

The (Defect type) "PRINTF_ARGS" warning have been fixed now.

But
> The second one:
>  1. nfs-utils-2.3.3/utils/gssd/krb5_util.c:400: incompatible_cast: Pointer
> "&ple->endtime" points to an object whose effective type is "int" (32 bits,
> signed) but is dereferenced as a wider "long" (64 bits, signed). This may
> lead to memory corruption. 
> 
> #   398|   	if (ple->ccname && ple->endtime > now && !nocache) {
> #   399|   		printerr(3, "%s(0x%lx): Credentials in CC '%s' are good until
> %s",
> #   400|-> 			 __func__, tid, ple->ccname, ctime((time_t *)&ple->endtime));
> #   401|   		code = 0;
> #   402|   		pthread_mutex_unlock(&ple_lock);
> 
The above "INCOMPATIBLE_CAST" one is still exist.

Maybe I can go ahead to verify this bug and track the remaining issue in another bug.

Comment 5 Yongcheng Yang 2021-11-22 03:30:05 UTC
(In reply to Yongcheng Yang from comment #4)
...
> The (Defect type) "PRINTF_ARGS" warning have been fixed now.

I'm moving this one to VERIFIED for now.

...
> The above "INCOMPATIBLE_CAST" one is still exist.

Just filed Bug 2025386 to track it.

Comment 7 errata-xmlrpc 2022-05-10 15:20:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (nfs-utils bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2025