Hi NeilBrown, kernel test robot noticed the following build warnings: [auto build test WARNING on linus/master] [also build test WARNING on v6.10-rc6 next-20240701] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/NeilBrown/nfsd-introduce-__fh_verify-which-takes-explicit-nfsd_net-arg/20240701-122856 base: linus/master patch link: https://lore.kernel.org/r/20240701025802.22985-2-neilb%40suse.de patch subject: [PATCH 1/6] nfsd: introduce __fh_verify which takes explicit nfsd_net arg config: parisc-defconfig compiler: hppa-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202407012313.vEtlGGRL-lkp@intel.com/ All warnings (new ones prefixed by >>): >> fs/nfsd/nfsfh.c:331: warning: Function parameter or struct member 'nn' not described in '__fh_verify' >> fs/nfsd/nfsfh.c:331: warning: expecting prototype for fh_verify(). Prototype was for __fh_verify() instead vim +331 fs/nfsd/nfsfh.c 03550fac06c4f0c J. Bruce Fields 2008-03-14 300 b3d47676d474ecd J. Bruce Fields 2008-10-20 301 /** b3d47676d474ecd J. Bruce Fields 2008-10-20 302 * fh_verify - filehandle lookup and access checking b3d47676d474ecd J. Bruce Fields 2008-10-20 303 * @rqstp: pointer to current rpc request b3d47676d474ecd J. Bruce Fields 2008-10-20 304 * @fhp: filehandle to be verified b3d47676d474ecd J. Bruce Fields 2008-10-20 305 * @type: expected type of object pointed to by filehandle b3d47676d474ecd J. Bruce Fields 2008-10-20 306 * @access: type of access needed to object b3d47676d474ecd J. Bruce Fields 2008-10-20 307 * b3d47676d474ecd J. Bruce Fields 2008-10-20 308 * Look up a dentry from the on-the-wire filehandle, check the client's b3d47676d474ecd J. Bruce Fields 2008-10-20 309 * access to the export, and set the current task's credentials. b3d47676d474ecd J. Bruce Fields 2008-10-20 310 * b3d47676d474ecd J. Bruce Fields 2008-10-20 311 * Regardless of success or failure of fh_verify(), fh_put() should be b3d47676d474ecd J. Bruce Fields 2008-10-20 312 * called on @fhp when the caller is finished with the filehandle. b3d47676d474ecd J. Bruce Fields 2008-10-20 313 * b3d47676d474ecd J. Bruce Fields 2008-10-20 314 * fh_verify() may be called multiple times on a given filehandle, for b3d47676d474ecd J. Bruce Fields 2008-10-20 315 * example, when processing an NFSv4 compound. The first call will look b3d47676d474ecd J. Bruce Fields 2008-10-20 316 * up a dentry using the on-the-wire filehandle. Subsequent calls will b3d47676d474ecd J. Bruce Fields 2008-10-20 317 * skip the lookup and just perform the other checks and possibly change b3d47676d474ecd J. Bruce Fields 2008-10-20 318 * the current task's credentials. 03550fac06c4f0c J. Bruce Fields 2008-03-14 319 * b3d47676d474ecd J. Bruce Fields 2008-10-20 320 * @type specifies the type of object expected using one of the S_IF* b3d47676d474ecd J. Bruce Fields 2008-10-20 321 * constants defined in include/linux/stat.h. The caller may use zero b3d47676d474ecd J. Bruce Fields 2008-10-20 322 * to indicate that it doesn't care, or a negative integer to indicate b3d47676d474ecd J. Bruce Fields 2008-10-20 323 * that it expects something not of the given type. 03550fac06c4f0c J. Bruce Fields 2008-03-14 324 * b3d47676d474ecd J. Bruce Fields 2008-10-20 325 * @access is formed from the NFSD_MAY_* constants defined in 93f580a9a2413de Oleg Drokin 2016-07-07 326 * fs/nfsd/vfs.h. 03550fac06c4f0c J. Bruce Fields 2008-03-14 327 */ 63e675e35f79eda NeilBrown 2024-07-01 328 static __be32 63e675e35f79eda NeilBrown 2024-07-01 329 __fh_verify(struct svc_rqst *rqstp, struct nfsd_net *nn, 63e675e35f79eda NeilBrown 2024-07-01 330 struct svc_fh *fhp, umode_t type, int access) 03550fac06c4f0c J. Bruce Fields 2008-03-14 @331 { 20ad856e47323e2 Amir Goldstein 2021-01-06 332 struct svc_export *exp = NULL; 03550fac06c4f0c J. Bruce Fields 2008-03-14 333 struct dentry *dentry; 03550fac06c4f0c J. Bruce Fields 2008-03-14 334 __be32 error; 03550fac06c4f0c J. Bruce Fields 2008-03-14 335 03550fac06c4f0c J. Bruce Fields 2008-03-14 336 if (!fhp->fh_dentry) { 63e675e35f79eda NeilBrown 2024-07-01 337 error = nfsd_set_fh_dentry(rqstp, nn, fhp); 03550fac06c4f0c J. Bruce Fields 2008-03-14 338 if (error) 03550fac06c4f0c J. Bruce Fields 2008-03-14 339 goto out; 864f0f61f829bac J. Bruce Fields 2009-11-25 340 } ^1da177e4c3f415 Linus Torvalds 2005-04-16 341 dentry = fhp->fh_dentry; ^1da177e4c3f415 Linus Torvalds 2005-04-16 342 exp = fhp->fh_export; 051382885552e12 Chuck Lever 2022-06-21 343 051382885552e12 Chuck Lever 2022-06-21 344 trace_nfsd_fh_verify(rqstp, fhp, type, access); 051382885552e12 Chuck Lever 2022-06-21 345 6fa02839bf9412e J. Bruce Fields 2007-11-12 346 /* 864f0f61f829bac J. Bruce Fields 2009-11-25 347 * We still have to do all these permission checks, even when 864f0f61f829bac J. Bruce Fields 2009-11-25 348 * fh_dentry is already set: 864f0f61f829bac J. Bruce Fields 2009-11-25 349 * - fh_verify may be called multiple times with different 864f0f61f829bac J. Bruce Fields 2009-11-25 350 * "access" arguments (e.g. nfsd_proc_create calls 864f0f61f829bac J. Bruce Fields 2009-11-25 351 * fh_verify(...,NFSD_MAY_EXEC) first, then later (in 864f0f61f829bac J. Bruce Fields 2009-11-25 352 * nfsd_create) calls fh_verify(...,NFSD_MAY_CREATE). 864f0f61f829bac J. Bruce Fields 2009-11-25 353 * - in the NFSv4 case, the filehandle may have been filled 864f0f61f829bac J. Bruce Fields 2009-11-25 354 * in by fh_compose, and given a dentry, but further 864f0f61f829bac J. Bruce Fields 2009-11-25 355 * compound operations performed with that filehandle 864f0f61f829bac J. Bruce Fields 2009-11-25 356 * still need permissions checks. In the worst case, a 864f0f61f829bac J. Bruce Fields 2009-11-25 357 * mountpoint crossing may have changed the export 864f0f61f829bac J. Bruce Fields 2009-11-25 358 * options, and we may now need to use a different uid 864f0f61f829bac J. Bruce Fields 2009-11-25 359 * (for example, if different id-squashing options are in 864f0f61f829bac J. Bruce Fields 2009-11-25 360 * effect on the new filesystem). 6fa02839bf9412e J. Bruce Fields 2007-11-12 361 */ 03a816b46d7eba7 Steve Dickson 2009-09-09 362 error = check_pseudo_root(rqstp, dentry, exp); 03a816b46d7eba7 Steve Dickson 2009-09-09 363 if (error) 03a816b46d7eba7 Steve Dickson 2009-09-09 364 goto out; 03a816b46d7eba7 Steve Dickson 2009-09-09 365 6fa02839bf9412e J. Bruce Fields 2007-11-12 366 error = nfsd_setuser_and_check_port(rqstp, exp); 7fc90ec93a5eb71 J. Bruce Fields 2006-06-30 367 if (error) 7fc90ec93a5eb71 J. Bruce Fields 2006-06-30 368 goto out; 7fc90ec93a5eb71 J. Bruce Fields 2006-06-30 369 e75b23f9e323b1e J. Bruce Fields 2016-07-19 370 error = nfsd_mode_check(rqstp, dentry, type); ^1da177e4c3f415 Linus Torvalds 2005-04-16 371 if (error) ^1da177e4c3f415 Linus Torvalds 2005-04-16 372 goto out; ^1da177e4c3f415 Linus Torvalds 2005-04-16 373 9091224f3cff472 J. Bruce Fields 2007-07-17 374 /* 9091224f3cff472 J. Bruce Fields 2007-07-17 375 * pseudoflavor restrictions are not enforced on NLM, 9091224f3cff472 J. Bruce Fields 2007-07-17 376 * which clients virtually always use auth_sys for, 9091224f3cff472 J. Bruce Fields 2007-07-17 377 * even while using RPCSEC_GSS for NFS. 9091224f3cff472 J. Bruce Fields 2007-07-17 378 */ 204f4ce75434c34 J. Bruce Fields 2011-04-08 379 if (access & NFSD_MAY_LOCK || access & NFSD_MAY_BYPASS_GSS) 04716e6621ff4ab J. Bruce Fields 2008-08-07 380 goto skip_pseudoflavor_check; 04716e6621ff4ab J. Bruce Fields 2008-08-07 381 /* 04716e6621ff4ab J. Bruce Fields 2008-08-07 382 * Clients may expect to be able to use auth_sys during mount, 04716e6621ff4ab J. Bruce Fields 2008-08-07 383 * even if they use gss for everything else; see section 2.3.2 04716e6621ff4ab J. Bruce Fields 2008-08-07 384 * of rfc 2623. 04716e6621ff4ab J. Bruce Fields 2008-08-07 385 */ 04716e6621ff4ab J. Bruce Fields 2008-08-07 386 if (access & NFSD_MAY_BYPASS_GSS_ON_ROOT 04716e6621ff4ab J. Bruce Fields 2008-08-07 387 && exp->ex_path.dentry == dentry) 04716e6621ff4ab J. Bruce Fields 2008-08-07 388 goto skip_pseudoflavor_check; 04716e6621ff4ab J. Bruce Fields 2008-08-07 389 32c1eb0cd7ee00b Andy Adamson 2007-07-17 390 error = check_nfsd_access(exp, rqstp); 32c1eb0cd7ee00b Andy Adamson 2007-07-17 391 if (error) 32c1eb0cd7ee00b Andy Adamson 2007-07-17 392 goto out; 32c1eb0cd7ee00b Andy Adamson 2007-07-17 393 04716e6621ff4ab J. Bruce Fields 2008-08-07 394 skip_pseudoflavor_check: ^1da177e4c3f415 Linus Torvalds 2005-04-16 395 /* Finally, check access permissions. */ 0ec757df9743025 J. Bruce Fields 2007-07-17 396 error = nfsd_permission(rqstp, exp, dentry, access); ^1da177e4c3f415 Linus Torvalds 2005-04-16 397 out: 93c128e709aec23 Jeff Layton 2022-10-12 398 trace_nfsd_fh_verify_err(rqstp, fhp, type, access, error); ^1da177e4c3f415 Linus Torvalds 2005-04-16 399 if (error == nfserr_stale) 4b14885411f74b2 Josef Bacik 2024-01-26 400 nfsd_stats_fh_stale_inc(nn, exp); ^1da177e4c3f415 Linus Torvalds 2005-04-16 401 return error; ^1da177e4c3f415 Linus Torvalds 2005-04-16 402 } ^1da177e4c3f415 Linus Torvalds 2005-04-16 403 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki