All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 2287/14009] sound/core/rawmidi_compat.c:29:29: warning: taking address of packed member 'mode' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value
@ 2021-06-30 22:02 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-06-30 22:02 UTC (permalink / raw)
  To: David Henningsson
  Cc: clang-built-linux, kbuild-all, Linux Memory Management List,
	Takashi Iwai, Jaroslav Kysela

[-- Attachment #1: Type: text/plain, Size: 9341 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   2e0046650f0f192a84a1793f0dc2f0991ed9a3e4
commit: 08fdced60ca08e34e316a3ab945636fcdfcbc973 [2287/14009] ALSA: rawmidi: Add framing mode
config: mips-buildonly-randconfig-r005-20210630 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8d21d5472501460933e78aead04cf59579025ba4)
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
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=08fdced60ca08e34e316a3ab945636fcdfcbc973
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 08fdced60ca08e34e316a3ab945636fcdfcbc973
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips 

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

All warnings (new ones prefixed by >>):

   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:26:31: warning: taking address of packed member 'stream' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
           if (get_user(params.stream, &src->stream) ||
                                        ^~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:26:31: warning: taking address of packed member 'stream' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
           if (get_user(params.stream, &src->stream) ||
                                        ^~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:27:36: warning: taking address of packed member 'buffer_size' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.buffer_size, &src->buffer_size) ||
                                             ^~~~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:27:36: warning: taking address of packed member 'buffer_size' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.buffer_size, &src->buffer_size) ||
                                             ^~~~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:28:34: warning: taking address of packed member 'avail_min' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.avail_min, &src->avail_min) ||
                                           ^~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:28:34: warning: taking address of packed member 'avail_min' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.avail_min, &src->avail_min) ||
                                           ^~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   In file included from sound/core/rawmidi.c:1608:
>> sound/core/rawmidi_compat.c:29:29: warning: taking address of packed member 'mode' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.mode, &src->mode) ||
                                      ^~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
>> sound/core/rawmidi_compat.c:29:29: warning: taking address of packed member 'mode' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.mode, &src->mode) ||
                                      ^~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:30:21: warning: taking address of packed member 'no_active_sensing' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(val, &src->no_active_sensing))
                              ^~~~~~~~~~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:30:21: warning: taking address of packed member 'no_active_sensing' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(val, &src->no_active_sensing))
                              ^~~~~~~~~~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:63:31: warning: taking address of packed member 'stream' of class or structure 'compat_snd_rawmidi_status64' may result in an unaligned pointer value [-Waddress-of-packed-member]
           if (get_user(status.stream, &src->stream))
                                        ^~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:63:31: warning: taking address of packed member 'stream' of class or structure 'compat_snd_rawmidi_status64' may result in an unaligned pointer value [-Waddress-of-packed-member]
           if (get_user(status.stream, &src->stream))
                                        ^~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   12 warnings generated.


vim +29 sound/core/rawmidi_compat.c

    19	
    20	static int snd_rawmidi_ioctl_params_compat(struct snd_rawmidi_file *rfile,
    21						   struct snd_rawmidi_params32 __user *src)
    22	{
    23		struct snd_rawmidi_params params;
    24		unsigned int val;
    25	
    26		if (get_user(params.stream, &src->stream) ||
    27		    get_user(params.buffer_size, &src->buffer_size) ||
    28		    get_user(params.avail_min, &src->avail_min) ||
  > 29		    get_user(params.mode, &src->mode) ||
    30		    get_user(val, &src->no_active_sensing))
    31			return -EFAULT;
    32		params.no_active_sensing = val;
    33		switch (params.stream) {
    34		case SNDRV_RAWMIDI_STREAM_OUTPUT:
    35			if (!rfile->output)
    36				return -EINVAL;
    37			return snd_rawmidi_output_params(rfile->output, &params);
    38		case SNDRV_RAWMIDI_STREAM_INPUT:
    39			if (!rfile->input)
    40				return -EINVAL;
    41			return snd_rawmidi_input_params(rfile->input, &params);
    42		}
    43		return -EINVAL;
    44	}
    45	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 46454 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [linux-next:master 2287/14009] sound/core/rawmidi_compat.c:29:29: warning: taking address of packed member 'mode' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value
@ 2021-06-30 22:02 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-06-30 22:02 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 9485 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   2e0046650f0f192a84a1793f0dc2f0991ed9a3e4
commit: 08fdced60ca08e34e316a3ab945636fcdfcbc973 [2287/14009] ALSA: rawmidi: Add framing mode
config: mips-buildonly-randconfig-r005-20210630 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8d21d5472501460933e78aead04cf59579025ba4)
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
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=08fdced60ca08e34e316a3ab945636fcdfcbc973
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 08fdced60ca08e34e316a3ab945636fcdfcbc973
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips 

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

All warnings (new ones prefixed by >>):

   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:26:31: warning: taking address of packed member 'stream' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
           if (get_user(params.stream, &src->stream) ||
                                        ^~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:26:31: warning: taking address of packed member 'stream' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
           if (get_user(params.stream, &src->stream) ||
                                        ^~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:27:36: warning: taking address of packed member 'buffer_size' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.buffer_size, &src->buffer_size) ||
                                             ^~~~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:27:36: warning: taking address of packed member 'buffer_size' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.buffer_size, &src->buffer_size) ||
                                             ^~~~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:28:34: warning: taking address of packed member 'avail_min' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.avail_min, &src->avail_min) ||
                                           ^~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:28:34: warning: taking address of packed member 'avail_min' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.avail_min, &src->avail_min) ||
                                           ^~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   In file included from sound/core/rawmidi.c:1608:
>> sound/core/rawmidi_compat.c:29:29: warning: taking address of packed member 'mode' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.mode, &src->mode) ||
                                      ^~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
>> sound/core/rawmidi_compat.c:29:29: warning: taking address of packed member 'mode' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.mode, &src->mode) ||
                                      ^~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:30:21: warning: taking address of packed member 'no_active_sensing' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(val, &src->no_active_sensing))
                              ^~~~~~~~~~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:30:21: warning: taking address of packed member 'no_active_sensing' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(val, &src->no_active_sensing))
                              ^~~~~~~~~~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:63:31: warning: taking address of packed member 'stream' of class or structure 'compat_snd_rawmidi_status64' may result in an unaligned pointer value [-Waddress-of-packed-member]
           if (get_user(status.stream, &src->stream))
                                        ^~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:63:31: warning: taking address of packed member 'stream' of class or structure 'compat_snd_rawmidi_status64' may result in an unaligned pointer value [-Waddress-of-packed-member]
           if (get_user(status.stream, &src->stream))
                                        ^~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   12 warnings generated.


vim +29 sound/core/rawmidi_compat.c

    19	
    20	static int snd_rawmidi_ioctl_params_compat(struct snd_rawmidi_file *rfile,
    21						   struct snd_rawmidi_params32 __user *src)
    22	{
    23		struct snd_rawmidi_params params;
    24		unsigned int val;
    25	
    26		if (get_user(params.stream, &src->stream) ||
    27		    get_user(params.buffer_size, &src->buffer_size) ||
    28		    get_user(params.avail_min, &src->avail_min) ||
  > 29		    get_user(params.mode, &src->mode) ||
    30		    get_user(val, &src->no_active_sensing))
    31			return -EFAULT;
    32		params.no_active_sensing = val;
    33		switch (params.stream) {
    34		case SNDRV_RAWMIDI_STREAM_OUTPUT:
    35			if (!rfile->output)
    36				return -EINVAL;
    37			return snd_rawmidi_output_params(rfile->output, &params);
    38		case SNDRV_RAWMIDI_STREAM_INPUT:
    39			if (!rfile->input)
    40				return -EINVAL;
    41			return snd_rawmidi_input_params(rfile->input, &params);
    42		}
    43		return -EINVAL;
    44	}
    45	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 46454 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-30 22:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-30 22:02 [linux-next:master 2287/14009] sound/core/rawmidi_compat.c:29:29: warning: taking address of packed member 'mode' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value kernel test robot
2021-06-30 22:02 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.