From: kernel test robot <lkp@intel.com>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
LKML <linux-kernel@vger.kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, Matthieu Buffet <matthieu@buffet.re>
Subject: Re: [PATCH] tomoyo: fix socket permission checks
Date: Thu, 24 Sep 2026 08:34:06 +0800 [thread overview]
Message-ID: <202609240841.x5ug9vqH-lkp@intel.com> (raw)
In-Reply-To: <db497449-b16b-4a61-9f06-fbbe7a3dcc73@I-love.SAKURA.ne.jp>
Hi Tetsuo,
kernel test robot noticed the following build warnings:
[auto build test WARNING on linus/master]
[also build test WARNING on v7.3-rc4 next-20260922]
[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/Tetsuo-Handa/tomoyo-fix-socket-permission-checks/20260923-005744
base: linus/master
patch link: https://lore.kernel.org/r/db497449-b16b-4a61-9f06-fbbe7a3dcc73%40I-love.SAKURA.ne.jp
patch subject: [PATCH] tomoyo: fix socket permission checks
config: i386-randconfig-1300-20260924 (https://download.01.org/0day-ci/archive/20260924/202609240841.x5ug9vqH-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260924/202609240841.x5ug9vqH-lkp@intel.com/reproduce)
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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609240841.x5ug9vqH-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> security/tomoyo/tomoyo.c:554:22: sparse: sparse: restricted __be16 degrades to integer
security/tomoyo/tomoyo.c:555:22: sparse: sparse: restricted __be16 degrades to integer
vim +554 security/tomoyo/tomoyo.c
504
505 /**
506 * tomoyo_sctp_bind_connect - Check permission for sctp's bind or connext.
507 *
508 * @sk: Pointer to "struct sock".
509 * @optname: Type of operation.
510 * @address: Pointer to "struct sockaddr".
511 * @addrlen: Size of @address.
512 *
513 * Returns 0 on success, negative value otherwise.
514 */
515 static int tomoyo_sctp_bind_connect(struct sock *sk, int optname, struct sockaddr *address,
516 int addrlen)
517 {
518 int len, err, walk_size = 0;
519 void *addr_buf;
520 struct sockaddr *addr;
521
522 /* Process one or more addresses that may be IPv4 or IPv6 */
523 addr_buf = address;
524
525 while (walk_size < addrlen) {
526 if (walk_size + sizeof(sa_family_t) > addrlen)
527 return -EINVAL;
528
529 addr = addr_buf;
530 switch (addr->sa_family) {
531 case AF_INET:
532 len = sizeof(struct sockaddr_in);
533 break;
534 case AF_INET6:
535 len = sizeof(struct sockaddr_in6);
536 break;
537 default:
538 return -EINVAL;
539 }
540 if (walk_size + len > addrlen)
541 return -EINVAL;
542
543 switch (optname) {
544 /* Bind checks */
545 case SCTP_PRIMARY_ADDR:
546 case SCTP_SET_PEER_PRIMARY_ADDR:
547 case SCTP_SOCKOPT_BINDX_ADD:
548 err = tomoyo_socket_bind_permission(sk, addr, len);
549 if (err)
550 return err;
551 break;
552 /* Connect checks */
553 case SCTP_SOCKOPT_CONNECTX:
> 554 case SCTP_PARAM_SET_PRIMARY:
555 case SCTP_PARAM_ADD_IP:
556 case SCTP_SENDMSG_CONNECT:
557 err = tomoyo_socket_connect_permission(sk, addr, len);
558 if (err)
559 return err;
560 break;
561 }
562
563 addr_buf += len;
564 walk_size += len;
565 }
566
567 return 0;
568 }
569
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2026-09-24 0:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 15:57 Tetsuo Handa
2026-09-24 0:34 ` kernel test robot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202609240841.x5ug9vqH-lkp@intel.com \
--to=lkp@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthieu@buffet.re \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=penguin-kernel@i-love.sakura.ne.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®