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>] [day] [month] [year] [list]
Message-ID: <202203091434.2vqTNOQH-lkp@intel.com>
Date:   Wed, 9 Mar 2022 14:50:57 +0800
From:   kernel test robot <lkp@...el.com>
To:     Paul Lawrence <paullawrence@...gle.com>
Cc:     kbuild-all@...ts.01.org,
        GNU/Weeb Mailing List <gwml@...r.gnuweeb.org>,
        linux-kernel@...r.kernel.org
Subject: [ammarfaizi2-block:google/android/kernel/common/android13-5.10
 9998/9999] fs/fuse/dev.c:1953:44: warning: cast from pointer to integer of
 different size

tree:   https://github.com/ammarfaizi2/linux-block google/android/kernel/common/android13-5.10
head:   5da5b1871950c71755fa5a0b88c78e2f2623da24
commit: 8efdff35e3052e44d519ccfb9d50594f5df0240b [9998/9999] ANDROID: fuse-bpf: Move fd operations to be synchronous
config: arm-randconfig-c002-20220309 (https://download.01.org/0day-ci/archive/20220309/202203091434.2vqTNOQH-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/ammarfaizi2/linux-block/commit/8efdff35e3052e44d519ccfb9d50594f5df0240b
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block google/android/kernel/common/android13-5.10
        git checkout 8efdff35e3052e44d519ccfb9d50594f5df0240b
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash fs/fuse/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   fs/fuse/dev.c: In function 'fuse_dev_do_write':
>> fs/fuse/dev.c:1953:44: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    1953 |                         febo->backing_fd = (uint64_t) fget(febo->backing_fd);
         |                                            ^
   fs/fuse/dev.c:1955:40: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    1955 |                         febo->bpf_fd = (uint64_t) fget(febo->bpf_fd);
         |                                        ^
--
   fs/fuse/dir.c: In function 'fuse_dentry_revalidate':
>> fs/fuse/dir.c:247:45: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     247 |                         struct file *file = (struct file *) bpf_outarg.backing_fd;
         |                                             ^
   fs/fuse/dir.c:254:45: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     254 |                         struct file *file = (struct file *) bpf_outarg.bpf_fd;
         |                                             ^


vim +1953 fs/fuse/dev.c

  1852	
  1853	/*
  1854	 * Write a single reply to a request.  First the header is copied from
  1855	 * the write buffer.  The request is then searched on the processing
  1856	 * list by the unique ID found in the header.  If found, then remove
  1857	 * it from the list and copy the rest of the buffer to the request.
  1858	 * The request is finished by calling fuse_request_end().
  1859	 */
  1860	static ssize_t fuse_dev_do_write(struct fuse_dev *fud,
  1861					 struct fuse_copy_state *cs, size_t nbytes)
  1862	{
  1863		int err;
  1864		struct fuse_conn *fc = fud->fc;
  1865		struct fuse_pqueue *fpq = &fud->pq;
  1866		struct fuse_req *req;
  1867		struct fuse_out_header oh;
  1868	
  1869		err = -EINVAL;
  1870		if (nbytes < sizeof(struct fuse_out_header))
  1871			goto out;
  1872	
  1873		err = fuse_copy_one(cs, &oh, sizeof(oh));
  1874		if (err)
  1875			goto copy_finish;
  1876	
  1877		err = -EINVAL;
  1878		if (oh.len != nbytes)
  1879			goto copy_finish;
  1880	
  1881		/*
  1882		 * Zero oh.unique indicates unsolicited notification message
  1883		 * and error contains notification code.
  1884		 */
  1885		if (!oh.unique) {
  1886			err = fuse_notify(fc, oh.error, nbytes - sizeof(oh), cs);
  1887			goto out;
  1888		}
  1889	
  1890		err = -EINVAL;
  1891		if (oh.error <= -512 || oh.error > 0)
  1892			goto copy_finish;
  1893	
  1894		spin_lock(&fpq->lock);
  1895		req = NULL;
  1896		if (fpq->connected)
  1897			req = request_find(fpq, oh.unique & ~FUSE_INT_REQ_BIT);
  1898	
  1899		err = -ENOENT;
  1900		if (!req) {
  1901			spin_unlock(&fpq->lock);
  1902			goto copy_finish;
  1903		}
  1904	
  1905		/* Is it an interrupt reply ID? */
  1906		if (oh.unique & FUSE_INT_REQ_BIT) {
  1907			__fuse_get_request(req);
  1908			spin_unlock(&fpq->lock);
  1909	
  1910			err = 0;
  1911			if (nbytes != sizeof(struct fuse_out_header))
  1912				err = -EINVAL;
  1913			else if (oh.error == -ENOSYS)
  1914				fc->no_interrupt = 1;
  1915			else if (oh.error == -EAGAIN)
  1916				err = queue_interrupt(req);
  1917	
  1918			fuse_put_request(req);
  1919	
  1920			goto copy_finish;
  1921		}
  1922	
  1923		clear_bit(FR_SENT, &req->flags);
  1924		list_move(&req->list, &fpq->io);
  1925		req->out.h = oh;
  1926		set_bit(FR_LOCKED, &req->flags);
  1927		spin_unlock(&fpq->lock);
  1928		cs->req = req;
  1929		if (!req->args->page_replace)
  1930			cs->move_pages = 0;
  1931	
  1932		if (oh.error)
  1933			err = nbytes != sizeof(oh) ? -EINVAL : 0;
  1934		else
  1935			err = copy_out_args(cs, req->args, nbytes);
  1936		fuse_copy_finish(cs);
  1937	
  1938		if (!err && req->in.h.opcode == FUSE_CANONICAL_PATH) {
  1939			char *path = (char *)req->args->out_args[0].value;
  1940	
  1941			path[req->args->out_args[0].size - 1] = 0;
  1942			req->out.h.error =
  1943				kern_path(path, 0, req->args->canonical_path);
  1944		}
  1945	
  1946		if (!err && (req->in.h.opcode == FUSE_LOOKUP ||
  1947			     req->in.h.opcode == (FUSE_LOOKUP | FUSE_POSTFILTER)) &&
  1948			req->args->out_args[1].size == sizeof(struct fuse_entry_bpf_out)) {
  1949			struct fuse_entry_bpf_out *febo = (struct fuse_entry_bpf_out *)
  1950					req->args->out_args[1].value;
  1951	
  1952			if (febo->backing_action == FUSE_ACTION_REPLACE)
> 1953				febo->backing_fd = (uint64_t) fget(febo->backing_fd);
  1954			if (febo->bpf_action == FUSE_ACTION_REPLACE)
  1955				febo->bpf_fd = (uint64_t) fget(febo->bpf_fd);
  1956		}
  1957	
  1958		spin_lock(&fpq->lock);
  1959		clear_bit(FR_LOCKED, &req->flags);
  1960		if (!fpq->connected)
  1961			err = -ENOENT;
  1962		else if (err)
  1963			req->out.h.error = -EIO;
  1964		if (!test_bit(FR_PRIVATE, &req->flags))
  1965			list_del_init(&req->list);
  1966		spin_unlock(&fpq->lock);
  1967	
  1968		fuse_request_end(req);
  1969	out:
  1970		return err ? err : nbytes;
  1971	
  1972	copy_finish:
  1973		fuse_copy_finish(cs);
  1974		goto out;
  1975	}
  1976	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ