mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Chengfeng Ye <cyeaa@connect.ust.hk>, stefanr@s5r6.in-berlin.de
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux1394-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, Chengfeng Ye <cyeaa@connect.ust.hk>
Subject: Re: [PATCH] firewire: fix potential uaf in outbound_phy_packet_callback()
Date: Fri, 5 Nov 2021 05:32:36 +0800	[thread overview]
Message-ID: <202111050559.XtYScFwi-lkp@intel.com> (raw)
In-Reply-To: <20211104153253.23941-1-cyeaa@connect.ust.hk>

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

Hi Chengfeng,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on ieee1394-linux1394/for-next]
[also build test WARNING on v5.15 next-20211104]
[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]

url:    https://github.com/0day-ci/linux/commits/Chengfeng-Ye/firewire-fix-potential-uaf-in-outbound_phy_packet_callback/20211104-233441
base:   https://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394.git for-next
config: x86_64-randconfig-r034-20211105 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 847a6807332b13f43704327c2d30103ec0347c77)
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/0day-ci/linux/commit/4374c2eea7055a681ca81f925ded194d11062af6
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Chengfeng-Ye/firewire-fix-potential-uaf-in-outbound_phy_packet_callback/20211104-233441
        git checkout 4374c2eea7055a681ca81f925ded194d11062af6
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64 

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 >>):

>> drivers/firewire/core-cdev.c:1499:17: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
           struct client *e_client = e->client;
                          ^
   1 warning generated.


vim +1499 drivers/firewire/core-cdev.c

  1477	
  1478	static void outbound_phy_packet_callback(struct fw_packet *packet,
  1479						 struct fw_card *card, int status)
  1480	{
  1481		struct outbound_phy_packet_event *e =
  1482			container_of(packet, struct outbound_phy_packet_event, p);
  1483	
  1484		switch (status) {
  1485		/* expected: */
  1486		case ACK_COMPLETE:	e->phy_packet.rcode = RCODE_COMPLETE;	break;
  1487		/* should never happen with PHY packets: */
  1488		case ACK_PENDING:	e->phy_packet.rcode = RCODE_COMPLETE;	break;
  1489		case ACK_BUSY_X:
  1490		case ACK_BUSY_A:
  1491		case ACK_BUSY_B:	e->phy_packet.rcode = RCODE_BUSY;	break;
  1492		case ACK_DATA_ERROR:	e->phy_packet.rcode = RCODE_DATA_ERROR;	break;
  1493		case ACK_TYPE_ERROR:	e->phy_packet.rcode = RCODE_TYPE_ERROR;	break;
  1494		/* stale generation; cancelled; on certain controllers: no ack */
  1495		default:		e->phy_packet.rcode = status;		break;
  1496		}
  1497		e->phy_packet.data[0] = packet->timestamp;
  1498	
> 1499		struct client *e_client = e->client;
  1500		queue_event(e->client, &e->event, &e->phy_packet,
  1501			    sizeof(e->phy_packet) + e->phy_packet.length, NULL, 0);
  1502		client_put(e_client);
  1503	}
  1504	

---
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: 31912 bytes --]

      reply	other threads:[~2021-11-04 21:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04 15:32 Chengfeng Ye
2021-11-04 21:32 ` 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=202111050559.XtYScFwi-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=cyeaa@connect.ust.hk \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=llvm@lists.linux.dev \
    --cc=stefanr@s5r6.in-berlin.de \
    /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®