Commit 805540a0 authored by Jens Axboe's avatar Jens Axboe Committed by felix
Browse files

cred: get rid of CONFIG_DEBUG_CREDENTIALS

mainline inclusion
from mainline-v6.7-rc6
commit ae1914174a63a558113e80d24ccac2773f9f7b2b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8YQ5Q

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ae1914174a63a558113e80d24ccac2773f9f7b2b



--------------------------------

This code is rarely (never?) enabled by distros, and it hasn't caught
anything in decades. Let's kill off this legacy debug code.

Suggested-by: default avatarLinus Torvalds <torvalds@linuxfoundation.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarFelix Fu <fuzhen5@huawei.com>
parent dd97283a
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -301,7 +301,6 @@ CONFIG_WQ_WATCHDOG=y
CONFIG_DEBUG_SG=y
CONFIG_DEBUG_NOTIFIERS=y
CONFIG_BUG_ON_DATA_CORRUPTION=y
CONFIG_DEBUG_CREDENTIALS=y
# CONFIG_FTRACE is not set
CONFIG_XMON=y
# CONFIG_RUNTIME_TESTING_MENU is not set
+0 −1
Original line number Diff line number Diff line
@@ -835,7 +835,6 @@ CONFIG_DEBUG_IRQFLAGS=y
CONFIG_DEBUG_LIST=y
CONFIG_DEBUG_SG=y
CONFIG_DEBUG_NOTIFIERS=y
CONFIG_DEBUG_CREDENTIALS=y
CONFIG_RCU_TORTURE_TEST=m
CONFIG_RCU_REF_SCALE_TEST=m
CONFIG_RCU_CPU_STALL_TIMEOUT=300
+0 −4
Original line number Diff line number Diff line
@@ -26,8 +26,6 @@ int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
	int i;
	int flags = nfsexp_flags(rqstp, exp);

	validate_process_creds();

	/* discard any old override before preparing the new set */
	revert_creds(get_cred(current_real_cred()));
	new = prepare_creds();
@@ -81,10 +79,8 @@ int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
	else
		new->cap_effective = cap_raise_nfsd_set(new->cap_effective,
							new->cap_permitted);
	validate_process_creds();
	put_cred(override_creds(new));
	put_cred(new);
	validate_process_creds();
	return 0;

oom:
+0 −1
Original line number Diff line number Diff line
@@ -962,7 +962,6 @@ nfsd(void *vrqstp)
		rqstp->rq_server->sv_maxconn = nn->max_connections;

		svc_recv(rqstp);
		validate_process_creds();
	}

	atomic_dec(&nfsdstats.th_cnt);
+1 −8
Original line number Diff line number Diff line
@@ -884,7 +884,6 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type,
	int host_err;
	bool retried = false;

	validate_process_creds();
	/*
	 * If we get here, then the client has already done an "open",
	 * and (hopefully) checked permission - so allow OWNER_OVERRIDE
@@ -909,7 +908,6 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type,
		}
		err = nfserrno(host_err);
	}
	validate_process_creds();
	return err;
}

@@ -926,12 +924,7 @@ int
nfsd_open_verified(struct svc_rqst *rqstp, struct svc_fh *fhp, int may_flags,
		   struct file **filp)
{
	int err;

	validate_process_creds();
	err = __nfsd_open(rqstp, fhp, S_IFREG, may_flags, filp);
	validate_process_creds();
	return err;
	return __nfsd_open(rqstp, fhp, S_IFREG, may_flags, filp);
}

/*
Loading